Skip to main content

SubscriptionNFTApi

@nevermined-io/sdk - v3.0.40 / SubscriptionNFTApi

Class: SubscriptionNFTApi

Allows the interaction with external ERC-721 NFT contracts built on top of the Nevermined NFT extra features.

Hierarchy

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new SubscriptionNFTApi(): SubscriptionNFTApi

Returns

SubscriptionNFTApi

Inherited from

NFT721Api.constructor

Properties

nftContract

nftContract: Nft721Contract

Inherited from

NFT721Api.nftContract

Defined in

src/nevermined/api/nfts/NFT721Api.ts:27


servicePlugin

servicePlugin: Object

Index signature

[key: string]: ServicePlugin\<Service>

Inherited from

NFT721Api.servicePlugin

Defined in

src/nevermined/api/RegistryBaseApi.ts:39

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:60


artifactsFolder

get artifactsFolder(): undefined | string

Returns

undefined | string

Inherited from

NFT721Api.artifactsFolder

Defined in

src/Instantiable.abstract.ts:137


circuitsFolder

get circuitsFolder(): undefined | string

Returns

undefined | string

Inherited from

NFT721Api.circuitsFolder

Defined in

src/Instantiable.abstract.ts:141


client

get client(): Web3Clients

Returns

Web3Clients

Inherited from

NFT721Api.client

Defined in

src/Instantiable.abstract.ts:89


config

get config(): NeverminedOptions

Returns

NeverminedOptions

Inherited from

NFT721Api.config

Defined in

src/Instantiable.abstract.ts:120


getContract

get getContract(): Nft721Contract

Gets the instance of the ERC-721 NFT Contract where the API is connected

Returns

Nft721Contract

The Nft721Contract instance

Inherited from

NFT721Api.getContract

Defined in

src/nevermined/api/nfts/NFT721Api.ts:68


instanceConfig

get instanceConfig(): InstantiableConfig

Returns

InstantiableConfig

Inherited from

NFT721Api.instanceConfig

Defined in

src/Instantiable.abstract.ts:145


instantiableConfig

get instantiableConfig(): undefined | InstantiableConfig

Returns

undefined | InstantiableConfig

Inherited from

NFT721Api.instantiableConfig

Defined in

src/Instantiable.abstract.ts:113


logger

get logger(): Logger

Returns

Logger

Inherited from

NFT721Api.logger

Defined in

src/Instantiable.abstract.ts:128


nevermined

get nevermined(): Nevermined

Returns

Nevermined

Inherited from

NFT721Api.nevermined

Defined in

src/Instantiable.abstract.ts:81


publicClient

get publicClient(): Object

Returns

Object

NameTypeDescription
accountundefinedThe Account of the Client.
batch?{ multicall?: boolean | { batchSize?: number ; wait?: number } }Flags for batch settings.
batch.multicall?boolean | { batchSize?: number ; wait?: number }Toggle to enable eth_call multicall aggregation.
cacheTimenumberTime (in ms) that cached data will remain in memory.
call(parameters: CallParameters\<undefined | Chain>) => Promise\<CallReturnType>-
ccipRead?false | { request?: (parameters: CcipRequestParameters) => Promise\<`0x${string}`> }CCIP Read configuration.
chainundefined | ChainChain for the client.
createBlockFilter() => Promise\<{ id: `0x${string}` ; request: EIP1193RequestFn\<readonly [{ Method: "eth_getFilterChanges" ; Parameters: [filterId: `0x${string}`] ; ReturnType: `0x${string}`[] | RpcLog[] }, { Method: "eth_getFilterLogs" ; Parameters: [filterId: `0x${string}`] ; ReturnType: RpcLog[] }, { Method: "eth_uninstallFilter" ; Parameters: [filterId: `0x${string}`] ; ReturnType: boolean }]> ; type: "block" }>-
createContractEventFilter\<TAbi, TEventName, TArgs, TStrict, TFromBlock, TToBlock>(args: CreateContractEventFilterParameters\<TAbi, TEventName, TArgs, TStrict, TFromBlock, TToBlock>) => Promise\<CreateContractEventFilterReturnType\<TAbi, TEventName, TArgs, TStrict, TFromBlock, TToBlock>>-
createEventFilter\<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock, _EventName, _Args>(args?: CreateEventFilterParameters\<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock, _EventName, _Args>) => Promise\<{ [K in string | number | symbol]: Filter\<"event", TAbiEvents, _EventName, _Args, TStrict, TFromBlock, TToBlock>[K] }>-
createPendingTransactionFilter() => Promise\<{ id: `0x${string}` ; request: EIP1193RequestFn\<readonly [{ Method: "eth_getFilterChanges" ; Parameters: [filterId: `0x${string}`] ; ReturnType: `0x${string}`[] | RpcLog[] }, { Method: "eth_getFilterLogs" ; Parameters: [filterId: `0x${string}`] ; ReturnType: RpcLog[] }, { Method: "eth_uninstallFilter" ; Parameters: [filterId: `0x${string}`] ; ReturnType: boolean }]> ; type: "transaction" }>-
estimateContractGas\<TChain, abi, functionName, args>(args: EstimateContractGasParameters\<abi, functionName, args, TChain>) => Promise\<bigint>-
estimateFeesPerGas\<TChainOverride, TType>(args?: EstimateFeesPerGasParameters\<undefined | Chain, TChainOverride, TType>) => Promise\<EstimateFeesPerGasReturnType>-
estimateGas(args: EstimateGasParameters\<undefined | Chain>) => Promise\<bigint>-
estimateMaxPriorityFeePerGas\<TChainOverride>(args?: { chain: null | TChainOverride }) => Promise\<bigint>-
extend\<client>(fn: (client: Client\<Transport, undefined | Chain, undefined, PublicRpcSchema, PublicActions\<Transport, undefined | Chain>>) => client) => Client\<Transport, undefined | Chain, undefined, PublicRpcSchema, { [K in string | number | symbol]: client[K] } & PublicActions\<Transport, undefined | Chain>>-
getBalance(args: GetBalanceParameters) => Promise\<bigint>-
getBlobBaseFee() => Promise\<bigint>-
getBlock\<TIncludeTransactions, TBlockTag>(args?: GetBlockParameters\<TIncludeTransactions, TBlockTag>) => Promise\<{ baseFeePerGas: null | bigint ; blobGasUsed: bigint ; difficulty: bigint ; excessBlobGas: bigint ; extraData: `0x${string}` ; gasLimit: bigint ; gasUsed: bigint ; hash: TBlockTag extends "pending" ? null : `0x${string}` ; logsBloom: TBlockTag extends "pending" ? null : `0x${string}` ; miner: `0x${string}` ; mixHash: `0x${string}` ; nonce: TBlockTag extends "pending" ? null : `0x${string}` ; number: TBlockTag extends "pending" ? null : bigint ; parentHash: `0x${string}` ; receiptsRoot: `0x${string}` ; sealFields: `0x${string}`[] ; sha3Uncles: `0x${string}` ; size: bigint ; stateRoot: `0x${string}` ; timestamp: bigint ; totalDifficulty: null | bigint ; transactions: TIncludeTransactions extends true ? ({ accessList?: undefined ; blobVersionedHashes?: undefined ; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}` ; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint ; chainId?: number ; from: `0x${string}` ; gas: bigint ; gasPrice: bigint ; hash: `0x${string}` ; input: `0x${string}` ; maxFeePerBlobGas?: undefined ; maxFeePerGas?: undefined ; maxPriorityFeePerGas?: undefined ; nonce: number ; r: `0x${string}` ; s: `0x${string}` ; to: null | `0x${string}` ; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number ; type: "legacy" ; typeHex: null | `0x${string}` ; v: bigint ; value: bigint ; yParity?: undefined } | { accessList: AccessList ; blobVersionedHashes?: undefined ; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}` ; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint ; chainId: number ; from: `0x${string}` ; gas: bigint ; gasPrice: bigint ; hash: `0x${string}` ; input: `0x${string}` ; maxFeePerBlobGas?: undefined ; maxFeePerGas?: undefined ; maxPriorityFeePerGas?: undefined ; nonce: number ; r: `0x${string}` ; s: `0x${string}` ; to: null | `0x${string}` ; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number ; type: "eip2930" ; typeHex: null | `0x${string}` ; v: bigint ; value: bigint ; yParity: number } | { accessList: AccessList ; blobVersionedHashes?: undefined ; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}` ; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint ; chainId: number ; from: `0x${string}` ; gas: bigint ; gasPrice?: undefined ; hash: `0x${string}` ; input: `0x${string}` ; maxFeePerBlobGas?: undefined ; maxFeePerGas: bigint ; maxPriorityFeePerGas: bigint ; nonce: number ; r: `0x${string}` ; s: `0x${string}` ; to: null | `0x${string}` ; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number ; type: "eip1559" ; typeHex: null | `0x${string}` ; v: bigint ; value: bigint ; yParity: number } | { accessList: AccessList ; blobVersionedHashes: `0x${string}`[] ; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}` ; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint ; chainId: number ; from: `0x${string}` ; gas: bigint ; gasPrice?: undefined ; hash: `0x${string}` ; input: `0x${string}` ; maxFeePerBlobGas: bigint ; maxFeePerGas: bigint ; maxPriorityFeePerGas: bigint ; nonce: number ; r: `0x${string}` ; s: `0x${string}` ; to: null | `0x${string}` ; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number ; type: "eip4844" ; typeHex: null | `0x${string}` ; v: bigint ; value: bigint ; yParity: number })[] : `0x${string}`[] ; transactionsRoot: `0x${string}` ; uncles: `0x${string}`[] ; withdrawals?: Withdrawal[] ; withdrawalsRoot?: `0x${string}` }>-
getBlockNumber(args?: GetBlockNumberParameters) => Promise\<bigint>-
getBlockTransactionCount(args?: GetBlockTransactionCountParameters) => Promise\<number>-
getBytecode(args: GetBytecodeParameters) => Promise\<GetBytecodeReturnType>-
getChainId() => Promise\<number>-
getContractEvents\<abi, eventName, strict, fromBlock, toBlock>(args: GetContractEventsParameters\<abi, eventName, strict, fromBlock, toBlock>) => Promise\<GetContractEventsReturnType\<abi, eventName, strict, fromBlock, toBlock>>-
getEnsAddress(args: { blockNumber?: bigint ; blockTag?: BlockTag ; coinType?: number ; gatewayUrls?: string[] ; name: string ; strict?: boolean ; universalResolverAddress?: `0x${string}` }) => Promise\<GetEnsAddressReturnType>-
getEnsAvatar(args: { assetGatewayUrls?: AssetGatewayUrls ; blockNumber?: bigint ; blockTag?: BlockTag ; gatewayUrls?: string[] ; name: string ; strict?: boolean ; universalResolverAddress?: `0x${string}` }) => Promise\<GetEnsAvatarReturnType>-
getEnsName(args: { address: `0x${string}` ; blockNumber?: bigint ; blockTag?: BlockTag ; gatewayUrls?: string[] ; strict?: boolean ; universalResolverAddress?: `0x${string}` }) => Promise\<GetEnsNameReturnType>-
getEnsResolver(args: { blockNumber?: bigint ; blockTag?: BlockTag ; name: string ; universalResolverAddress?: `0x${string}` }) => Promise\<`0x${string}`>-
getEnsText(args: { blockNumber?: bigint ; blockTag?: BlockTag ; gatewayUrls?: string[] ; key: string ; name: string ; strict?: boolean ; universalResolverAddress?: `0x${string}` }) => Promise\<GetEnsTextReturnType>-
getFeeHistory(args: GetFeeHistoryParameters) => Promise\<GetFeeHistoryReturnType>-
getFilterChanges\<TFilterType, TAbi, TEventName, TStrict, TFromBlock, TToBlock>(args: GetFilterChangesParameters\<TFilterType, TAbi, TEventName, TStrict, TFromBlock, TToBlock>) => Promise\<GetFilterChangesReturnType\<TFilterType, TAbi, TEventName, TStrict, TFromBlock, TToBlock>>-
getFilterLogs\<TAbi, TEventName, TStrict, TFromBlock, TToBlock>(args: GetFilterLogsParameters\<TAbi, TEventName, TStrict, TFromBlock, TToBlock>) => Promise\<GetFilterLogsReturnType\<TAbi, TEventName, TStrict, TFromBlock, TToBlock>>-
getGasPrice() => Promise\<bigint>-
getLogs\<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock>(args?: GetLogsParameters\<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock>) => Promise\<GetLogsReturnType\<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock>>-
getProof(args: GetProofParameters) => Promise\<GetProofReturnType>-
getStorageAt(args: GetStorageAtParameters) => Promise\<GetStorageAtReturnType>-
getTransaction\<TBlockTag>(args: GetTransactionParameters\<TBlockTag>) => Promise\<{ accessList?: undefined ; blobVersionedHashes?: undefined ; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}` ; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint ; chainId?: number ; from: `0x${string}` ; gas: bigint ; gasPrice: bigint ; hash: `0x${string}` ; input: `0x${string}` ; maxFeePerBlobGas?: undefined ; maxFeePerGas?: undefined ; maxPriorityFeePerGas?: undefined ; nonce: number ; r: `0x${string}` ; s: `0x${string}` ; to: null | `0x${string}` ; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number ; type: "legacy" ; typeHex: null | `0x${string}` ; v: bigint ; value: bigint ; yParity?: undefined } | { accessList: AccessList ; blobVersionedHashes?: undefined ; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}` ; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint ; chainId: number ; from: `0x${string}` ; gas: bigint ; gasPrice: bigint ; hash: `0x${string}` ; input: `0x${string}` ; maxFeePerBlobGas?: undefined ; maxFeePerGas?: undefined ; maxPriorityFeePerGas?: undefined ; nonce: number ; r: `0x${string}` ; s: `0x${string}` ; to: null | `0x${string}` ; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number ; type: "eip2930" ; typeHex: null | `0x${string}` ; v: bigint ; value: bigint ; yParity: number } | { accessList: AccessList ; blobVersionedHashes?: undefined ; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}` ; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint ; chainId: number ; from: `0x${string}` ; gas: bigint ; gasPrice?: undefined ; hash: `0x${string}` ; input: `0x${string}` ; maxFeePerBlobGas?: undefined ; maxFeePerGas: bigint ; maxPriorityFeePerGas: bigint ; nonce: number ; r: `0x${string}` ; s: `0x${string}` ; to: null | `0x${string}` ; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number ; type: "eip1559" ; typeHex: null | `0x${string}` ; v: bigint ; value: bigint ; yParity: number } | { accessList: AccessList ; blobVersionedHashes: `0x${string}`[] ; blockHash: TBlockTag extends "pending" ? true : false extends true ? null : `0x${string}` ; blockNumber: TBlockTag extends "pending" ? true : false extends true ? null : bigint ; chainId: number ; from: `0x${string}` ; gas: bigint ; gasPrice?: undefined ; hash: `0x${string}` ; input: `0x${string}` ; maxFeePerBlobGas: bigint ; maxFeePerGas: bigint ; maxPriorityFeePerGas: bigint ; nonce: number ; r: `0x${string}` ; s: `0x${string}` ; to: null | `0x${string}` ; transactionIndex: TBlockTag extends "pending" ? true : false extends true ? null : number ; type: "eip4844" ; typeHex: null | `0x${string}` ; v: bigint ; value: bigint ; yParity: number }>-
getTransactionConfirmations(args: GetTransactionConfirmationsParameters\<undefined | Chain>) => Promise\<bigint>-
getTransactionCount(args: GetTransactionCountParameters) => Promise\<number>-
getTransactionReceipt(args: GetTransactionReceiptParameters) => Promise\<TransactionReceipt>-
keystringA key for the client.
multicall\<contracts, allowFailure>(args: MulticallParameters\<contracts, allowFailure>) => Promise\<MulticallReturnType\<contracts, allowFailure>>-
namestringA name for the client.
pollingIntervalnumberFrequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds.
prepareTransactionRequest\<TRequest, TChainOverride, TAccountOverride>(args: PrepareTransactionRequestParameters\<undefined | Chain, undefined | Account, TChainOverride, TAccountOverride, TRequest>) => Promise\<{ [K in string | number | symbol]: (UnionRequiredBy\<Extract\<UnionOmit\<(...), (...)> & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)> extends true ? unknown : ExactPartial\<(...)>> & Object, ParameterTypeToParameters\<TRequest["parameters"] extends readonly PrepareTransactionRequestParameterType[] ? any[any][number] : "type" | "gas" | "nonce" | "blobVersionedHashes" | "chainId" | "fees">> & (unknown extends TRequest["kzg"] ? Object : Pick\<TRequest, "kzg">))[K] }>-
readContract\<abi, functionName, args>(args: ReadContractParameters\<abi, functionName, args>) => Promise\<ReadContractReturnType\<abi, functionName, args>>-
requestEIP1193RequestFn\<PublicRpcSchema>Request function wrapped with friendly error handling
sendRawTransaction(args: SendRawTransactionParameters) => Promise\<`0x${string}`>-
simulateContract\<abi, functionName, args, chainOverride, accountOverride>(args: SimulateContractParameters\<abi, functionName, args, undefined | Chain, chainOverride, accountOverride>) => Promise\<SimulateContractReturnType\<abi, functionName, args, undefined | Chain, undefined | Account, chainOverride, accountOverride>>-
transportTransportConfig\<string, EIP1193RequestFn> & Record\<string, any>The RPC transport
typestringThe type of client.
uidstringA unique ID for the client.
uninstallFilter(args: UninstallFilterParameters) => Promise\<boolean>-
verifyMessage(args: VerifyMessageParameters) => Promise\<boolean>-
verifyTypedData(args: VerifyTypedDataParameters) => Promise\<boolean>-
waitForTransactionReceipt(args: WaitForTransactionReceiptParameters\<undefined | Chain>) => Promise\<TransactionReceipt>-
watchBlockNumber(args: WatchBlockNumberParameters) => WatchBlockNumberReturnType-
watchBlocks\<TIncludeTransactions, TBlockTag>(args: WatchBlocksParameters\<Transport, undefined | Chain, TIncludeTransactions, TBlockTag>) => WatchBlocksReturnType-
watchContractEvent\<TAbi, TEventName, TStrict>(args: WatchContractEventParameters\<TAbi, TEventName, TStrict, Transport>) => WatchContractEventReturnType-
watchEvent\<TAbiEvent, TAbiEvents, TStrict>(args: WatchEventParameters\<TAbiEvent, TAbiEvents, TStrict, Transport>) => WatchEventReturnType-
watchPendingTransactions(args: WatchPendingTransactionsParameters\<Transport>) => WatchPendingTransactionsReturnType-

Inherited from

NFT721Api.publicClient

Defined in

src/Instantiable.abstract.ts:97


walletClient

get walletClient(): Object

Returns

Object

NameTypeDescription
accountundefined | AccountThe Account of the Client.
addChain(args: AddChainParameters) => Promise\<void>-
batch?{ multicall?: boolean | { batchSize?: number ; wait?: number } }Flags for batch settings.
batch.multicall?boolean | { batchSize?: number ; wait?: number }Toggle to enable eth_call multicall aggregation.
cacheTimenumberTime (in ms) that cached data will remain in memory.
ccipRead?false | { request?: (parameters: CcipRequestParameters) => Promise\<`0x${string}`> }CCIP Read configuration.
chainundefined | ChainChain for the client.
deployContract\<abi, chainOverride>(args: DeployContractParameters\<abi, undefined | Chain, undefined | Account, chainOverride>) => Promise\<`0x${string}`>-
extend\<client>(fn: (client: Client\<Transport, undefined | Chain, undefined | Account, WalletRpcSchema, WalletActions\<undefined | Chain, undefined | Account>>) => client) => Client\<Transport, undefined | Chain, undefined | Account, WalletRpcSchema, { [K in string | number | symbol]: client[K] } & WalletActions\<undefined | Chain, undefined | Account>>-
getAddresses() => Promise\<GetAddressesReturnType>-
getChainId() => Promise\<number>-
getPermissions() => Promise\<GetPermissionsReturnType>-
keystringA key for the client.
namestringA name for the client.
pollingIntervalnumberFrequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds.
prepareTransactionRequest\<TRequest, TChainOverride, TAccountOverride>(args: PrepareTransactionRequestParameters\<undefined | Chain, undefined | Account, TChainOverride, TAccountOverride, TRequest>) => Promise\<{ [K in string | number | symbol]: (UnionRequiredBy\<Extract\<UnionOmit\<(...), (...)> & ((...) extends (...) ? (...) : (...)) & ((...) extends (...) ? (...) : (...)), IsNever\<(...)> extends true ? unknown : ExactPartial\<(...)>> & Object, ParameterTypeToParameters\<TRequest["parameters"] extends readonly PrepareTransactionRequestParameterType[] ? any[any][number] : "type" | "gas" | "nonce" | "blobVersionedHashes" | "chainId" | "fees">> & (unknown extends TRequest["kzg"] ? Object : Pick\<TRequest, "kzg">))[K] }>-
requestEIP1193RequestFn\<WalletRpcSchema>Request function wrapped with friendly error handling
requestAddresses() => Promise\<RequestAddressesReturnType>-
requestPermissions(args: { eth_accounts: Record\<string, any> }) => Promise\<RequestPermissionsReturnType>-
sendRawTransaction(args: SendRawTransactionParameters) => Promise\<`0x${string}`>-
sendTransaction\<TRequest, TChainOverride>(args: SendTransactionParameters\<undefined | Chain, undefined | Account, TChainOverride, TRequest>) => Promise\<`0x${string}`>-
signMessage(args: SignMessageParameters\<undefined | Account>) => Promise\<`0x${string}`>-
signTransaction\<TChainOverride>(args: SignTransactionParameters\<undefined | Chain, undefined | Account, TChainOverride>) => Promise\<`0x02${string}` | `0x01${string}` | `0x03${string}` | TransactionSerializedLegacy>-
signTypedData\<TTypedData, TPrimaryType>(args: SignTypedDataParameters\<TTypedData, TPrimaryType, undefined | Account>) => Promise\<`0x${string}`>-
switchChain(args: SwitchChainParameters) => Promise\<void>-
transportTransportConfig\<string, EIP1193RequestFn> & Record\<string, any>The RPC transport
typestringThe type of client.
uidstringA unique ID for the client.
watchAsset(args: WatchAssetParams) => Promise\<boolean>-
writeContract\<abi, functionName, args, TChainOverride>(args: WriteContractParameters\<abi, functionName, args, undefined | Chain, undefined | Account, TChainOverride>) => Promise\<`0x${string}`>-

Inherited from

NFT721Api.walletClient

Defined in

src/Instantiable.abstract.ts:105

Methods

_details

_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 ; url: any }>

Get the details of an NFT

Parameters

NameTypeDescription
didstringThe Decentralized Identifier of the NFT asset.
ercTypeERCTypeThe 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 ; url: any }>

The details of the NFT.

Example

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._details

Defined in

src/nevermined/api/nfts/NFTsBaseApi.ts:152


access

access(did, from, destination?, fileIndex?, agreementId?, buyer?, babysig?, serviceReference?): Promise\<boolean>

Access the files associated with an NFT.

Parameters

NameTypeDefault valueDescription
didstringundefinedThe Decentralized Identifier of the NFT asset.
fromNvmAccountundefinedThe user account holding NFTs (after purchase) requesting the access
destination?stringundefinedThe download destination for the files.
fileIndex?numberundefinedThe index of the file. If unset will download all the files in the asset.
agreementIdstring'0x'The NFT sales agreement id.
buyer?stringundefinedKey which represent the buyer
babysig?Babysigundefined-
serviceReferencenumber | 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

const result = await nevermined.nfts1155.access(ddo.id, collector, '/tmp/')

Inherited from

NFT721Api.access

Defined in

src/nevermined/api/nfts/NFTsBaseApi.ts:427


addRating

addRating(did, newRating, numVotesAdded?, from, publishMetadata?, txParams?): SubscribablePromise\<UpdateProgressStep, DDO>

Given a DID, it adds a vote to the asset curation information.

Parameters

NameTypeDefault valueDescription
didstringundefinedDecentralized ID representing the unique id of an asset in a Nevermined network.
newRatingnumberundefinedNew average rating of the asset
numVotesAddednumber1Number of new votes added to the rating, typically just 1
fromNvmAccountundefinedAccount of the user updating the metadata
publishMetadataPublishMetadataOptionsPublishMetadataOptions.OnlyMetadataAPIIt allows to specify where to store the metadata
txParams?TxParametersundefinedOptional transaction parameters

Returns

SubscribablePromise\<UpdateProgressStep, DDO>

DDO The DDO updated

Inherited from

NFT721Api.addRating

Defined in

src/nevermined/api/RegistryBaseApi.ts:561


balanceOf

balanceOf(account): Promise\<bigint>

Get the NFT balance for a particular account/address

Parameters

NameTypeDescription
accountstring | NvmAccountThe account/address to check the balance of.

Returns

Promise\<bigint>

The balance of NFTs owned by the account.

Example

const balance = await nevermined.nfts721.balance(artist)

Inherited from

NFT721Api.balanceOf

Defined in

src/nevermined/api/nfts/NFT721Api.ts:506


burn

burn(tokenId, from, txParams?): Promise\<any>

Burn NFTs associated with an asset.

Parameters

NameTypeDescription
tokenIdstringThe identifier of the token to burn
fromNvmAccountThe account of the publisher of the NFT.
txParams?TxParametersOptional transaction parameters.

Returns

Promise\<any>

The TransactionReceipt

Remarks

The publisher can only burn NFTs that it owns. NFTs that were already transferred cannot be burned by the publisher.

Example

await nevermined.nfts721.burn(tokenId, artist)

Inherited from

NFT721Api.burn

Defined in

src/nevermined/api/nfts/NFT721Api.ts:348


buySecondaryMarketNft

buySecondaryMarketNft(from, nftAmount?, agreementIdSeed, conditionsTimeout?, txParams?): Promise\<boolean>

Buys a number of listed NFTs on secondary markets.

Parameters

NameTypeDescription
fromNvmAccountThe account of the buyer/consumer.
nftAmountbigintThe number of assets to buy. 1 by default.
agreementIdSeedstringThe seed of the initial sales agreement created off-chain.
conditionsTimeoutnumber[]The timeout for the conditions.
txParams?TxParametersOptional transaction parameters

Returns

Promise\<boolean>

true if the buy was successful.

Example

const result = await nevermined.nfts1155.buySecondaryMarketNft(collector, 1n, agreementId)

Throws

NFTError Thrown if there is an error buying the NFT.

Inherited from

NFT721Api.buySecondaryMarketNft

Defined in

src/nevermined/api/nfts/NFTsBaseApi.ts:345


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

NameTypeDescription
agreementIdstringThe NFT sales agreement id.
nftHolderstringThe address of the current owner of the NFT.
nftReceiverstringThe address where the NFT should be transferred.
did?stringThe Decentralized Identifier of the asset.
serviceIndex?anyThe 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

const receipt = await nevermined.nfts721.claim(agreementId, editor.getId(), subscriber.getId())

Inherited from

NFT721Api.claim

Defined in

src/nevermined/api/nfts/NFT721Api.ts:198


claimNFT

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

NameTypeDefault valueDescription
agreementIdstringundefinedThe NFT sales agreement id.
nftHolderstringundefinedThe address of the current owner of the NFT.
nftReceiverstringundefinedThe address where the NFT should be transferred.
numberEditionsbigintundefinedThe number of NFT editions to transfer. If the NFT is ERC-721 it should be 1
ercTypeERCType1155The Type of the NFT ERC (1155 or 721).
did?stringundefinedThe DID of the asset.
serviceIndex?numberundefinedThe 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

const receipt = await nevermined.nfts721.claim(
agreementId,
editor.getId(),
subscriber.getId(),
nftAmount,
721,
)

Throws

NFTError if Nevermined is not an operator for this NFT

Inherited from

NFT721Api.claimNFT

Defined in

src/nevermined/api/nfts/NFTsBaseApi.ts:52


create

create(nftAttributes, from, publicationOptions?, txParams?): SubscribablePromise\<CreateProgressStep, DDO>

Creates a new Nevermined asset associated to a NFT (ERC-721).

Parameters

NameTypeDescription
nftAttributesNFTAttributesAttributes describing the NFT (ERC-721) associated to the asset
fromNvmAccountThe account publishing the asset
publicationOptionsAssetPublicationOptionsAllows to specify the publication options of the off-chain and the on-chain data.
txParams?TxParametersOptional transaction parameters

Returns

SubscribablePromise\<CreateProgressStep, DDO>

The newly registered DDO.

Example


// 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 and PublishMetadataOptions

Inherited from

NFT721Api.create

Defined in

src/nevermined/api/nfts/NFT721Api.ts:102


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 ; url: any }>

Get the details of an NFT

Parameters

NameTypeDescription
didstringThe 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 ; url: any }>

The details of the NFT.

Example

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.details

Defined in

src/nevermined/api/nfts/NFT721Api.ts:638


getSubscriptionToken

getSubscriptionToken(did, from): Promise\<SubscriptionToken>

Get a JWT token for an asset associated with a webService

Parameters

NameTypeDescription
didstringThe did of the asset with a webService resource and an associated subscription
fromNvmAccountAccount of the user requesting the token

Returns

Promise\<SubscriptionToken>

SubscriptionToken

Example

const response = await nevermined.nfts721.getSubscriptionToken(serviceDDO.id, subscriber)

assert.isDefined(response.accessToken)
assert.isDefined(response.neverminedProxyUri)

Inherited from

NFT721Api.getSubscriptionToken

Defined in

src/nevermined/api/nfts/NFTsBaseApi.ts:490


grantOperatorRole

grantOperatorRole(operatorAddress, from, txParams?): Promise\<any>

Adds a operator (operatorAddress) to the NFT Contract. Granting and revoking operator permissions only can be done by the NFT Contract owner

Parameters

NameTypeDescription
operatorAddressstringThe address of the account to be added as operator in the NFT Contract
fromNvmAccountThe account giving operator permissions
txParams?TxParametersOptional transaction parameters.

Returns

Promise\<any>

The TransactionReceipt

Example

await nevermined.nfts721.grantOperatorRole(someoneElse, artist)

Inherited from

NFT721Api.grantOperatorRole

Defined in

src/nevermined/api/nfts/NFT721Api.ts:584


isApprovedForAll

isApprovedForAll(operatorAddress, from): Promise\<unknown>

Returns if the operatorAddress is approved

Parameters

NameTypeDescription
operatorAddressstringThe address to check the permissions
fromstringThe address of the account granting or revoking the permissions via setApprovalForAll.

Returns

Promise\<unknown>

Boolean saying if the operatorAddress is approved

Example

await nevermined.nfts721.isApprovedForAll(someoneElse, artist.getId())

Inherited from

NFT721Api.isApprovedForAll

Defined in

src/nevermined/api/nfts/NFT721Api.ts:490


isOperator

isOperator(nftContractAddress, operatorAddress, ercType?): Promise\<boolean>

Check if a particular address is the operator of given a NFT address.

Parameters

NameTypeDefault valueDescription
nftContractAddressstringundefinedThe DID of the NFT to check
operatorAddressstringundefinedThe address to check if operator status
ercTypeERCType1155The erc type of the NFT.

Returns

Promise\<boolean>

operator status of address as a boolean

Inherited from

NFT721Api.isOperator

Defined in

src/nevermined/api/nfts/NFTsBaseApi.ts:118


isOperatorOfDID

isOperatorOfDID(did, address): Promise\<boolean>

It checks if an address is an operator of the NFT associated to the asset

Parameters

NameTypeDescription
didstringThe Decentralized identifier of the NFT asset.
addressstringThe address to check if operator status

Returns

Promise\<boolean>

true if the address is an operator of the NFT

Inherited from

NFT721Api.isOperatorOfDID

Defined in

src/nevermined/api/nfts/NFT721Api.ts:648


list

list(did, list, from, publishMetadata?, txParams?): SubscribablePromise\<UpdateProgressStep, DDO>

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

NameTypeDefault valueDescription
didstringundefinedDecentralized ID representing the unique id of an asset in a Nevermined network.
listbooleanundefinedNeeds the asset to be listed or unlisted
fromNvmAccountundefinedAccount of the user updating the metadata
publishMetadataPublishMetadataOptionsPublishMetadataOptions.OnlyMetadataAPIIt allows to specify where to store the metadata
txParams?TxParametersundefinedOptional transaction parameters

Returns

SubscribablePromise\<UpdateProgressStep, DDO>

DDO The DDO updated

Inherited from

NFT721Api.list

Defined in

src/nevermined/api/RegistryBaseApi.ts:509


listOnSecondaryMarkets

listOnSecondaryMarkets(ddo, assetPrice, nftAmount, nftTransfer, provider, token, from): Promise\<string>

After purchase re-list an NFT to enable secondary market sales.

Parameters

NameTypeDescription
ddoDDOThe DDO of the asset.
assetPriceAssetPriceThe current setup of asset rewards.
nftAmountbigintThe number of NFTs put up for secondary sale.
nftTransferboolean-
providerstringThe address that will be the provider of the secondary sale.
tokenToken-
fromNvmAccountThe account of the current owner.

Returns

Promise\<string>

the agreementId of the secondary sale.

Example

const agreementId = await nevermined.nfts1155.listOnSecondaryMarkets(
ddo,
assetPrice,
numberNFTs,
collector.getId(),
token,
collector.getId(),
)

Throws

NFTError Thrown if there is an error listing the NFT.

Inherited from

NFT721Api.listOnSecondaryMarkets

Defined in

src/nevermined/api/nfts/NFTsBaseApi.ts:262


mint

mint(did, from, txParams?): Promise\<any>

It mints 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

NameTypeDescription
didstringThe Decentralized Identifier of the NFT asset.
fromNvmAccountThe account of the minter
txParams?TxParametersOptional transaction parameters.

Returns

Promise\<any>

The TransactionReceipt

Example

await nevermined.nfts721.mint(ddo.id, artist)

Inherited from

NFT721Api.mint

Defined in

src/nevermined/api/nfts/NFT721Api.ts:324


mintWithURL

mintWithURL(to, did, url, from, txParams?): Promise\<any>

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

NameTypeDescription
tostringThe address receiving the NFT minted
didstringThe Decentralized Identifier of the NFT asset.
urlstringThe URL with NFT metadata
fromNvmAccountThe account of the minter
txParams?TxParametersOptional transaction parameters.

Returns

Promise\<any>

The TransactionReceipt

Example

await nevermined.nfts721.mintWithURL(receiverAddress, ddo.id, nftMetadata, artist)

Inherited from

NFT721Api.mintWithURL

Defined in

src/nevermined/api/nfts/NFT721Api.ts:368


order

order(did, from, serviceReference?, txParams?): SubscribablePromise\<OrderProgressStep, string>

Order a NFT-721.

Parameters

NameTypeDefault valueDescription
didstringundefinedThe Decentralized Identifier of the NFT asset.
fromNvmAccountundefinedThe account of the NFT buyer.
serviceReferencenumber | ServiceType'nft-sales'The reference to identify wich service within the DDO to order
txParams?TxParametersundefinedOptional transaction parameters.

Returns

SubscribablePromise\<OrderProgressStep, 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

const agreementId = await nevermined.nfts721.order(ddo.id, collector)

Inherited from

NFT721Api.order

Defined in

src/nevermined/api/nfts/NFT721Api.ts:139


orderAsset

orderAsset(did, serviceReference, from, txParams?): SubscribablePromise\<OrderProgressStep, 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

NameTypeDescription
didstringDecentralized ID.
serviceReferencenumber | ServiceTypeService.
fromNvmAccountConsumer account.
txParams?TxParametersTransaction parameters

Returns

SubscribablePromise\<OrderProgressStep, string>

The agreement ID.

Inherited from

NFT721Api.orderAsset

Defined in

src/nevermined/api/RegistryBaseApi.ts:612


ownerOf

ownerOf(did): Promise\<string>

Gets the contract owner

Parameters

NameType
didstring

Returns

Promise\<string>

Address of the contract owner

Example

const nftContractOwner = new NvmAccount(await nevermined.nfts721.ownerOf())

Inherited from

NFT721Api.ownerOf

Defined in

src/nevermined/api/nfts/NFT721Api.ts:417


ownerOfAsset

ownerOfAsset(did): Promise\<string>

Given a DID it gets the owner of the NFT if that DID is used as tokenId

Parameters

NameTypeDescription
didstringThe Decentralized identifier of the NFT asset.

Returns

Promise\<string>

The address of the NFT owner.

Example

const owner = await nevermined.nfts721.ownerOfAsset(ddo.id, nftTokenAddress)

Inherited from

NFT721Api.ownerOfAsset

Defined in

src/nevermined/api/nfts/NFT721Api.ts:451


ownerOfAssetByAgreement

ownerOfAssetByAgreement(did, agreementId): Promise\<string>

Given a DID and an agreement id it gets the owner of the NFT

Parameters

NameTypeDescription
didstringThe Decentralized identifier of the NFT asset.
agreementIdstringThe NFT sales agreement id.

Returns

Promise\<string>

The address of the NFT owner.

Example

const owner = await nevermined.nfts721.ownerOfAssetByAgreement(ddo.id, agreementId)

Inherited from

NFT721Api.ownerOfAssetByAgreement

Defined in

src/nevermined/api/nfts/NFT721Api.ts:468


ownerOfTokenId

ownerOfTokenId(tokenId): Promise\<string>

Given some information, it gets the public address of the asset owner

Parameters

NameTypeDescription
tokenIdstringThe token id

Returns

Promise\<string>

The address of the NFT owner.

Example

const owner = await nevermined.nfts721.ownerOfTokenId(tokenId)

Inherited from

NFT721Api.ownerOfTokenId

Defined in

src/nevermined/api/nfts/NFT721Api.ts:434


registerNeverminedAsset

registerNeverminedAsset(assetAttributes, from, publicationOptions, nftAttributes?, txParams?): SubscribablePromise\<CreateProgressStep, DDO>

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

NameTypeDescription
assetAttributesAssetAttributesAttributes describing the asset
fromNvmAccountThe account publishing the asset
publicationOptionsAssetPublicationOptionsAllows to specify the publication options of the off-chain and the on-chain data.
nftAttributes?NFTAttributesAttributes describing the NFT (ERC-721) associated to the asset
txParams?TxParametersOptional transaction parameters

Returns

SubscribablePromise\<CreateProgressStep, DDO>

The metadata of the asset created (DDO)

See

PublishOnChainOptions and PublishMetadataOptions

Inherited from

NFT721Api.registerNeverminedAsset

Defined in

src/nevermined/api/RegistryBaseApi.ts:52


releaseRewards

releaseRewards(agreementId, did, from, serviceReference?, txParams?): Promise\<boolean>

Release the funds from escrow.

Parameters

NameTypeDefault valueDescription
agreementIdstringundefinedThe NFT sales agreement id.
didstringundefinedThe Decentralized identifier of the NFT asset.
fromNvmAccountundefinedThe current owner of the NFTs.
serviceReferencenumber | ServiceType'nft-sales'The reference to identify wich service within the DDO to release rewards
txParams?TxParametersundefinedOptional 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

const receipt = await nevermined.nfts721.releaseRewards(agreementId, ddo.id, artist)

Throws

NFTError Thrown if there is an error releasing the rewards.

Inherited from

NFT721Api.releaseRewards

Defined in

src/nevermined/api/nfts/NFT721Api.ts:283


releaseSecondaryMarketRewards

releaseSecondaryMarketRewards(owner, account, agreementIdSeed, txParams?): Promise\<boolean>

Used to release the secondary market NFT & the locked rewards.

Parameters

NameTypeDescription
ownerNvmAccountThe owner account.
accountNvmAccountAccount of the user sending the transaction
agreementIdSeedstringthe seed of the Agreement Id of the underlying service agreement.
txParams?TxParametersTransaction parameters

Returns

Promise\<boolean>

true if the transaction was successful.

Example

// TODO

Throws

NFTError Thrown if there is an error releasing the rewards.

Inherited from

NFT721Api.releaseSecondaryMarketRewards

Defined in

src/nevermined/api/nfts/NFT721Api.ts:529


resolveAsset

resolveAsset(did, policy?): Promise\<DDO>

Given an asset DID it returns the metadata of that asset represented by a DDO object. Depending of the resolution policy it prioritize fetching that Metadata from the Marketplace API or Immutable urls (like IPFS).

Parameters

NameTypeDefault valueDescription
didstringundefinedDecentralized ID.
policyDIDResolvePolicyDIDResolvePolicy.MetadataAPIFirstIt 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

Inherited from

NFT721Api.resolveAsset

Defined in

src/nevermined/api/RegistryBaseApi.ts:348


revokeOperatorRole

revokeOperatorRole(operatorAddress, from, txParams?): Promise\<any>

Revokes a minter (operatorAddress) of the NFT Contract. Granting and revoking minting permissions only can be done by the NFT Contract owner

Parameters

NameTypeDescription
operatorAddressstringThe address of the account to be revoked as operator in the NFT Contract
fromNvmAccountThe account revoking operator permissions
txParams?TxParametersOptional transaction parameters.

Returns

Promise\<any>

The TransactionReceipt

Example

await nevermined.nfts721.revokeOperatorRole(someoneElse, artist)

Inherited from

NFT721Api.revokeOperatorRole

Defined in

src/nevermined/api/nfts/NFT721Api.ts:610


setApprovalForAll

setApprovalForAll(target, approved, from, txParams?): Promise\<any>

Enable or disable NFT permissions for an operator.

Parameters

NameTypeDescription
targetstringThe address that of the operator we want to give transfer rights to.
approvedbooleanGive or remove transfer rights from the operator.
fromNvmAccountThe account that wants to give transfer rights to the operator.
txParams?TxParametersOptional transaction parameters.

Returns

Promise\<any>

The TransactionReceipt

Example

await nevermined.nfts721.setApprovalForAll(someoneElse, true, artist)

Inherited from

NFT721Api.setApprovalForAll

Defined in

src/nevermined/api/nfts/NFT721Api.ts:396


setInstanceConfig

setInstanceConfig(config): void

Parameters

NameType
configInstantiableConfig

Returns

void

Inherited from

NFT721Api.setInstanceConfig

Defined in

src/Instantiable.abstract.ts:163


transfer

transfer(agreementId, did, from, serviceReference?, txParams?): Promise\<boolean>

It transfers NFT-721 to the consumer. This method only will work if called by the owner of the asset or a provider.

Parameters

NameTypeDefault valueDescription
agreementIdstringundefinedThe NFT sales agreement id.
didstringundefinedThe Decentralized identifier of the NFT asset.
fromNvmAccountundefinedThe current owner of the NFTs.
serviceReferencenumber | ServiceType'nft-sales'The reference to identify wich service within the DDO to transfer
txParams?TxParametersundefinedOptional 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

const receipt = await nevermined.nfts721.transfer(agreementId, ddo.id, artist)

Throws

NFTError Thrown if there is an error transferring the NFT

Inherited from

NFT721Api.transfer

Defined in

src/nevermined/api/nfts/NFT721Api.ts:232


updateAsset

updateAsset(did, metadata, from, publishMetadataOptions?, txParams?): SubscribablePromise\<UpdateProgressStep, DDO>

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

NameTypeDefault valueDescription
didstringundefinedDecentralized ID representing the unique id of an asset in a Nevermined network.
metadataMetaDataundefinedMetadata describing the asset
fromNvmAccountundefinedAccount of the user updating the metadata
publishMetadataOptionsPublishMetadataOptionsPublishMetadataOptions.OnlyMetadataAPIIt allows to specify where to store the metadata
txParams?TxParametersundefinedOptional transaction parameters

Returns

SubscribablePromise\<UpdateProgressStep, DDO>

DDO The DDO updated

Inherited from

NFT721Api.updateAsset

Defined in

src/nevermined/api/RegistryBaseApi.ts:391


deployInstance

deployInstance(config, contractABI, from, args?): Promise\<SubscriptionNFTApi>

It deploys a new instance of the Subscription NFT (ERC-721) contract

Parameters

NameTypeDefault valueDescription
configNeverminedOptionsundefinedThe Nevermined config
contractABIanyundefinedThe ABI of the Subscription NFT Contract
fromNvmAccountundefinedThe account that will deploy the contract
argsnever[][]The list of arguments passed to the contract when is initialized

Returns

Promise\<SubscriptionNFTApi>

The Subscription NFT API instance SubscriptionNFTApi.

Defined in

src/nevermined/api/nfts/SubscriptionNFTApi.ts:45


getInstance

getInstance(config, nftContractAddress): Promise\<NFT721Api>

Create a new Nevermined NFTs (ERC-721) instance allowing to interact with that kind of NFTs.

Parameters

NameTypeDescription
configInstantiableConfigThe Nevermined config
nftContractAddressstringIf the Nft721 Contract is deployed in an address it will connect to that contract

Returns

Promise\<NFT721Api>

The NFTs 721 API instance NFT721Api.

Example

nfts721 = await Nft721Api.getInstance(instanceConfig, nftContractAddress)

Inherited from

NFT721Api.getInstance

Defined in

src/nevermined/api/nfts/NFT721Api.ts:44


getInstanceUsingABI

getInstanceUsingABI(config, nftContractAddress, solidityABI): Promise\<SubscriptionNFTApi>

It gets a Subscription NFT (ERC-721) instance

Parameters

NameTypeDescription
configInstantiableConfigThe Nevermined config
nftContractAddressstringIf the Subscription NFT Contract is deployed in an address it will connect to that contract
solidityABIanyThe ABI of the Contract

Returns

Promise\<SubscriptionNFTApi>

The Subscription NFT API instance SubscriptionNFTApi.

Defined in

src/nevermined/api/nfts/SubscriptionNFTApi.ts:20


getNFTContractAddress

getNFTContractAddress(ddo, serviceReference?): any

Gets the NFT contract address associated with a Nevermined asset from the DDO.

Parameters

NameTypeDefault valueDescription
ddoDDOundefinedThe DDO of the asset.
serviceReferencenumber | ServiceType'nft-access'The service type to look for the contract address

Returns

any

The NFT contract address.

Example

const nftContractAddress = NFT1155Api.getNFTContractAddress(ddo)

Inherited from

NFT721Api.getNFTContractAddress

Defined in

src/nevermined/api/nfts/NFTsBaseApi.ts:221


getServicePlugin

getServicePlugin(config): Object

Initializes the default Nevermined service plugins and return that instance

Parameters

NameTypeDescription
configInstantiableConfigNevermined config

Returns

Object

The Nevermined Service Plugin instance

NameType
accessAccessService
computeEscrowComputeExecutionTemplate
nft-accessNFTAccessService
nft-salesNFTSalesService

Inherited from

NFT721Api.getServicePlugin

Defined in

src/nevermined/api/RegistryBaseApi.ts:667


setInstanceConfig

setInstanceConfig\<T>(instance, instantiableConfig): void

Type parameters

NameType
Textends Instantiable

Parameters

NameType
instanceT
instantiableConfigInstantiableConfig

Returns

void

Inherited from

NFT721Api.setInstanceConfig

Defined in

src/Instantiable.abstract.ts:154