AssetsApi
@nevermined-io/sdk - v3.0.44 / 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
Hierarchy
↳
AssetsApi
Table of contents
Constructors
Properties
Accessors
- artifactsFolder
- circuitsFolder
- client
- config
- instanceConfig
- instantiableConfig
- logger
- nevermined
- publicClient
- walletClient
Methods
- access
- addRating
- consumerAssets
- create
- download
- getNftContractAddress
- getPermissions
- grantPermissions
- list
- order
- orderAsset
- owner
- ownerAssets
- ownerSignature
- registerNeverminedAsset
- resolve
- resolveAsset
- retire
- revokePermissions
- setInstanceConfig
- transferOwnership
- update
- updateAsset
- getInstance
- getServicePlugin
- setInstanceConfig
Constructors
constructor
• new AssetsApi(config
): AssetsApi
Creates a new AssetsApi
Parameters
Name | Type | Description |
---|---|---|
config | InstantiableConfig | Configuration of the Nevermined instance |
Returns
Overrides
Defined in
src/nevermined/api/AssetsApi.ts:87
Properties
providers
• providers: Providers
Utilities about the providers associated to an asset
Defined in
src/nevermined/api/AssetsApi.ts:80
servicePlugin
• servicePlugin: Object
Index signature
▪ [key: string
]: ServicePlugin
\<Service
>
Inherited from
Defined in
src/nevermined/api/RegistryBaseApi.ts:39
Accessors
artifactsFolder
• get
artifactsFolder(): undefined
| string
Returns
undefined
| string
Inherited from
RegistryBaseApi.artifactsFolder
Defined in
src/Instantiable.abstract.ts:137
circuitsFolder
• get
circuitsFolder(): undefined
| string
Returns
undefined
| string
Inherited from
RegistryBaseApi.circuitsFolder
Defined in
src/Instantiable.abstract.ts:141
client
• get
client(): Web3Clients
Returns
Inherited from
RegistryBaseApi.client
Defined in
src/Instantiable.abstract.ts:89
config
• get
config(): NeverminedOptions
Returns
Inherited from
RegistryBaseApi.config
Defined in
src/Instantiable.abstract.ts:120
instanceConfig
• get
instanceConfig(): InstantiableConfig
Returns
Inherited from
RegistryBaseApi.instanceConfig
Defined in
src/Instantiable.abstract.ts:145
instantiableConfig
• get
instantiableConfig(): undefined
| InstantiableConfig
Returns
undefined
| InstantiableConfig
Inherited from
RegistryBaseApi.instantiableConfig
Defined in
src/Instantiable.abstract.ts:113
logger
• get
logger(): Logger
Returns
Logger
Inherited from
RegistryBaseApi.logger
Defined in
src/Instantiable.abstract.ts:128
nevermined
• get
nevermined(): Nevermined
Returns
Inherited from
RegistryBaseApi.nevermined
Defined in
src/Instantiable.abstract.ts:81
publicClient
• get
publicClient(): Object
Returns
Object
Name | Type | Description |
---|---|---|
account | undefined | The 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. |
cacheTime | number | Time (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. |
chain | undefined | Chain | Chain 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 > | - |
key | string | A key for the client. |
multicall | \<contracts, allowFailure>(args : MulticallParameters \<contracts , allowFailure >) => Promise \<MulticallReturnType \<contracts , allowFailure >> | - |
name | string | A name for the client. |
pollingInterval | number | Frequency (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 >> | - |
request | EIP1193RequestFn \<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 >> | - |
transport | TransportConfig \<string , EIP1193RequestFn > & Record \<string , any > | The RPC transport |
type | string | The type of client. |
uid | string | A 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
RegistryBaseApi.publicClient
Defined in
src/Instantiable.abstract.ts:97
walletClient
• get
walletClient(): Object
Returns
Object
Name | Type | Description |
---|---|---|
account | undefined | Account | The 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. |
cacheTime | number | Time (in ms) that cached data will remain in memory. |
ccipRead? | false | { request? : (parameters : CcipRequestParameters ) => Promise \<`0x${string}`> } | CCIP Read configuration. |
chain | undefined | Chain | Chain 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 > | - |
key | string | A key for the client. |
name | string | A name for the client. |
pollingInterval | number | Frequency (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] }> | - |
request | EIP1193RequestFn \<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 > | - |
transport | TransportConfig \<string , EIP1193RequestFn > & Record \<string , any > | The RPC transport |
type | string | The type of client. |
uid | string | A 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
RegistryBaseApi.walletClient
Defined in
src/Instantiable.abstract.ts:105
Methods
access
▸ access(agreementId
, did
, serviceReference
, from
, 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 | 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 |
from | NvmAccount | 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 | 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:217
addRating
▸ addRating(did
, newRating
, numVotesAdded?
, from
, publishMetadata?
, txParams?
): SubscribablePromise
\<UpdateProgressStep
, DDO
>
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 |
from | NvmAccount | undefined | Account of the user updating the metadata |
publishMetadata | PublishMetadataOptions | PublishMetadataOptions.OnlyMetadataAPI | It allows to specify where to store the metadata |
txParams? | TxParameters | undefined | Optional transaction parameters |
Returns
SubscribablePromise
\<UpdateProgressStep
, DDO
>
DDO The DDO updated
Inherited from
Defined in
src/nevermined/api/RegistryBaseApi.ts:564
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:360
create
▸ create(assetAttributes
, from
, publicationOptions?
, txParams?
): SubscribablePromise
\<CreateProgressStep
, DDO
>
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
Parameters
Name | Type | Description |
---|---|---|
assetAttributes | AssetAttributes | Attributes describing the asset |
from | NvmAccount | The account publishing the asset |
publicationOptions | AssetPublicationOptions | Allows to specify the publication options of the off-chain and the on-chain data. |
txParams? | TxParameters | Optional transaction parameters |
Returns
SubscribablePromise
\<CreateProgressStep
, DDO
>
The metadata of the asset created (DDO)
Example
const assetAttributes = AssetAttributes.getInstance({
metadata,
price: assetPrice,
serviceTypes: ['sales', 'access'],
})
const ddo = await nevermined.assets.create(assetAttributes, publisher, PublishMetadata.IPFS)
See
PublishOnChainOptions and PublishMetadataOptions
Defined in
src/nevermined/api/AssetsApi.ts:134
download
▸ download(did
, from
, 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. |
from | NvmAccount | undefined | The account of the asset owner |
resultPath? | string | undefined | Path to be the files downloader |
fileIndex | number | -1 | The index of the file |
serviceType | ServiceType | 'access' | Service type. 'access' by default |
buyer? | string | undefined | Key which represent the buyer |
babysig? | Babysig | undefined | An elliptic curve signature |
Returns
Promise
\<string
>
Status, path destination if resultPath is provided
Defined in
src/nevermined/api/AssetsApi.ts:390
getNftContractAddress
▸ getNftContractAddress(ddo
, serviceType?
): string
Get the NFT contract address associated with a Nevermined asset.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
ddo | DDO | undefined | The DDO of the asset. |
serviceType | ServiceType | 'nft-access' | The service type to use to get the NFT contract address. |
Returns
string
The NFT contract address.
Example
nevermined.assets.getNftContractAddress(ddo)
Throws
DDOError - If the NFT contract address is not found in the DDO.
Defined in
src/nevermined/api/AssetsApi.ts:509
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:491
grantPermissions
▸ grantPermissions(did
, grantAddress
, from
, txParams?
): Promise
\<any
>
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 |
grantAddress | string | The account address to grant the permissions |
from | NvmAccount | Account sending the request. It must be the owner of the asset |
txParams? | TxParameters | Transaction parameters |
Returns
Promise
\<any
>
Defined in
src/nevermined/api/AssetsApi.ts:448
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
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 |
from | NvmAccount | undefined | Account of the user updating the metadata |
publishMetadata | PublishMetadataOptions | PublishMetadataOptions.OnlyMetadataAPI | It allows to specify where to store the metadata |
txParams? | TxParameters | undefined | Optional transaction parameters |
Returns
SubscribablePromise
\<UpdateProgressStep
, DDO
>
DDO The DDO updated
Inherited from
Defined in
src/nevermined/api/RegistryBaseApi.ts:512
order
▸ order(did
, serviceReference?
, from
, txParams?
): SubscribablePromise
\<OrderProgressStep
, 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 | '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 |
from | NvmAccount | undefined | The account of the user ordering the asset |
txParams? | TxParameters | undefined | Optional transaction parameters |
Returns
SubscribablePromise
\<OrderProgressStep
, string
>
The agreement ID identifying the order
Defined in
src/nevermined/api/AssetsApi.ts:194
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
Name | Type | Description |
---|---|---|
did | string | Decentralized ID. |
serviceReference | number | ServiceType | Service. |
from | NvmAccount | Consumer account. |
txParams? | TxParameters | Transaction parameters |
Returns
SubscribablePromise
\<OrderProgressStep
, string
>
The agreement ID.
Inherited from
Defined in
src/nevermined/api/RegistryBaseApi.ts:615
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:276
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:305
ownerSignature
▸ ownerSignature(did
): Promise
\<string
>
Returns the owner from the signature included in the DDO.
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:285
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
Name | Type | Description |
---|---|---|
assetAttributes | AssetAttributes | Attributes describing the asset |
from | NvmAccount | The account publishing the asset |
publicationOptions | AssetPublicationOptions | Allows to specify the publication options of the off-chain and the on-chain data. |
nftAttributes? | NFTAttributes | Attributes describing the NFT (ERC-721) associated to the asset |
txParams? | TxParameters | Optional transaction parameters |
Returns
SubscribablePromise
\<CreateProgressStep
, DDO
>
The metadata of the asset created (DDO)
See
PublishOnChainOptions and PublishMetadataOptions
Inherited from
RegistryBaseApi.registerNeverminedAsset
Defined in
src/nevermined/api/RegistryBaseApi.ts:52
resolve
▸ resolve(did
, policy?
): Promise
\<DDO
>
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 | 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
>
Defined in
src/nevermined/api/AssetsApi.ts:100
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
Name | Type | Default value | Description |
---|---|---|---|
did | string | undefined | Decentralized ID. |
policy | DIDResolvePolicy | 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
>
Inherited from
Defined in
src/nevermined/api/RegistryBaseApi.ts:349
retire
▸ retire(did
): Promise
\<Response
>
Retires the metadata of an asset from the Marketplace API. This allows the owner to unlist the asset from the marketplace.
Parameters
Name | Type | Description |
---|---|---|
did | string | the unique identifier of the asset |
Returns
Promise
\<Response
>
the HTTP response
Defined in
src/nevermined/api/AssetsApi.ts:373
revokePermissions
▸ revokePermissions(did
, revokeAddress
, from
, txParams?
): Promise
\<any
>
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 |
revokeAddress | string | The account address to revoke the permissions |
from | NvmAccount | Account sending the request. It must be the owner of the asset |
txParams? | TxParameters | Transaction parameters |
Returns
Promise
\<any
>
Defined in
src/nevermined/api/AssetsApi.ts:471
setInstanceConfig
▸ setInstanceConfig(config
): void
Parameters
Name | Type |
---|---|
config | InstantiableConfig |
Returns
void
Inherited from
RegistryBaseApi.setInstanceConfig
Defined in
src/Instantiable.abstract.ts:163
transferOwnership
▸ transferOwnership(did
, newOwner
, from
, newUserId?
, txParams?
): Promise
\<any
>
Transfer ownership of an asset.
Parameters
Name | Type | Description |
---|---|---|
did | string | Asset DID. |
newOwner | string | Ethereum address of the new owner of the DID. |
from | NvmAccount | Account owning the DID and doing the transfer of ownership |
newUserId? | string | User Id of the new user getting the ownership of the asset |
txParams? | TxParameters | Transaction parameters |
Returns
Promise
\<any
>
Returns transaction receipt.
Defined in
src/nevermined/api/AssetsApi.ts:318
update
▸ update(did
, metadata
, from
, publishMetadata?
, 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
Name | Type | Default value | Description |
---|---|---|---|
did | string | undefined | Decentralized ID representing the unique id of an asset in a Nevermined network. |
metadata | MetaData | undefined | Metadata describing the asset |
from | NvmAccount | undefined | Account of the user updating the metadata |
publishMetadata | PublishMetadataOptions | PublishMetadataOptions.OnlyMetadataAPI | It allows to specify where to store the metadata |
txParams? | TxParameters | undefined | Optional transaction parameters |
Returns
SubscribablePromise
\<UpdateProgressStep
, DDO
>
DDO The DDO updated
Example
const ddoUpdated = await nevermined.assets.update(
ddo.shortId(),
updatedMetadata,
publisher,
PublishMetadata.IPFS,
)
Defined in
src/nevermined/api/AssetsApi.ts:172
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
Name | Type | Default value | Description |
---|---|---|---|
did | string | undefined | Decentralized ID representing the unique id of an asset in a Nevermined network. |
metadata | MetaData | undefined | Metadata describing the asset |
from | NvmAccount | undefined | Account of the user updating the metadata |
publishMetadataOptions | PublishMetadataOptions | PublishMetadataOptions.OnlyMetadataAPI | It allows to specify where to store the metadata |
txParams? | TxParameters | undefined | Optional transaction parameters |
Returns
SubscribablePromise
\<UpdateProgressStep
, DDO
>
DDO The DDO updated
Inherited from
Defined in
src/nevermined/api/RegistryBaseApi.ts:392
getInstance
▸ getInstance(..._args
): any
Parameters
Name | Type |
---|---|
..._args | any |
Returns
any
Inherited from
Defined in
src/Instantiable.abstract.ts:150
getServicePlugin
▸ getServicePlugin(config
): Object
Initializes the default Nevermined service plugins and return that instance
Parameters
Name | Type | Description |
---|---|---|
config | InstantiableConfig | Nevermined config |
Returns
Object
The Nevermined Service Plugin instance
Name | Type |
---|---|
access | AccessService |
compute | EscrowComputeExecutionTemplate |
nft-access | NFTAccessService |
nft-sales | NFTSalesService |
Inherited from
RegistryBaseApi.getServicePlugin
Defined in
src/nevermined/api/RegistryBaseApi.ts:670
setInstanceConfig
▸ setInstanceConfig\<T
>(instance
, instantiableConfig
): void
Type parameters
Name | Type |
---|---|
T | extends Instantiable |
Parameters
Name | Type |
---|---|
instance | T |
instantiableConfig | InstantiableConfig |
Returns
void
Inherited from
RegistryBaseApi.setInstanceConfig