@nevermined-io/sdk - v3.0.44 / SubscriptionCreditsNFTApi
Allows the interaction with external ERC-1155 NFT contracts built on top of the Nevermined NFT extra features.
↳ SubscriptionCreditsNFTApi
• new SubscriptionCreditsNFTApi(): SubscriptionCreditsNFTApi
• nftContract: Nft1155Contract
src/nevermined/api/nfts/NFT1155Api.ts:26
• servicePlugin: Object
▪ [key: string
]: ServicePlugin
<Service
>
src/nevermined/api/RegistryBaseApi.ts:39
• get
address(): string
Gets the ERC-1155 NFT Contract address
string
The NFT contract address
NFT1155Api.address
src/nevermined/api/nfts/NFT1155Api.ts:64
• get
artifactsFolder(): undefined
| string
undefined
| string
NFT1155Api.artifactsFolder
src/Instantiable.abstract.ts:137
• get
circuitsFolder(): undefined
| string
undefined
| string
NFT1155Api.circuitsFolder
src/Instantiable.abstract.ts:141
• get
client(): Web3Clients
NFT1155Api.client
src/Instantiable.abstract.ts:89
• get
config(): NeverminedOptions
NFT1155Api.config
src/Instantiable.abstract.ts:120
• get
getContract(): Nft1155Contract
Gets the instance of the ERC-1155 NFT Contract where the API is connected
The Nft1155Contract
instance
NFT1155Api.getContract
src/nevermined/api/nfts/NFT1155Api.ts:72
• get
instanceConfig(): InstantiableConfig
NFT1155Api.instanceConfig
src/Instantiable.abstract.ts:145
• get
instantiableConfig(): undefined
| InstantiableConfig
undefined
| InstantiableConfig
NFT1155Api.instantiableConfig
src/Instantiable.abstract.ts:113
• get
logger(): Logger
Logger
NFT1155Api.logger
src/Instantiable.abstract.ts:128
• get
nevermined(): Nevermined
NFT1155Api.nevermined
src/Instantiable.abstract.ts:81
• get
publicClient(): Object
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 |
- |
NFT1155Api.publicClient
src/Instantiable.abstract.ts:97
• get
walletClient(): Object
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}`> |
- |
NFT1155Api.walletClient
src/Instantiable.abstract.ts:105
▸ _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
Name | Type | Description |
---|---|---|
did |
string |
The Decentralized Identifier of the NFT asset. |
ercType |
ERCType |
The type of NFT used |
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())
src/nevermined/api/nfts/NFTsBaseApi.ts:152
▸ access(did
, from
, destination?
, fileIndex?
, agreementId?
, buyer?
, babysig?
, serviceReference?
): Promise
<boolean
>
Access the files associated with an NFT.
Name | Type | Default value | Description |
---|---|---|---|
did |
string |
undefined |
The Decentralized Identifier of the NFT asset. |
from |
NvmAccount |
undefined |
The user account holding NFTs (after purchase) requesting the access |
destination? |
string |
undefined |
The download destination for the files. |
fileIndex? |
number |
undefined |
The index of the file. If unset will download all the files in the asset. |
agreementId |
string |
'0x' |
The NFT sales agreement id. |
buyer? |
string |
undefined |
Key which represent the buyer |
babysig? |
Babysig |
undefined |
- |
serviceReference |
number | ServiceType |
'nft-access' |
The service reference to use. By default is nft-access. |
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/')
src/nevermined/api/nfts/NFTsBaseApi.ts:427
▸ addRating(did
, newRating
, numVotesAdded?
, from
, publishMetadata?
, txParams?
): SubscribablePromise
<UpdateProgressStep
, DDO
>
Given a DID, it adds a vote to the asset curation information.
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 |
SubscribablePromise
<UpdateProgressStep
, DDO
>
DDO The DDO updated
src/nevermined/api/RegistryBaseApi.ts:564
▸ balance(did
, account
): Promise
<bigint
>
Get the NFT balance for a particular did associated to an account/address
Name | Type | Description |
---|---|---|
did |
string |
The Decentralized Identifier of the NFT asset. |
account |
string | NvmAccount |
The account/address to check the balance of. |
Promise
<bigint
>
The number of editions of a NFT owned by the account/address.
Example
const balance = await nevermined.nfts1155.balance(ddo.id, artist)
src/nevermined/api/nfts/NFT1155Api.ts:498
▸ burn(tokenId
, nftAmount
, from
, txParams?
): Promise
<any
>
It burns NFTs associated with an asset.
Name | Type | Description |
---|---|---|
tokenId |
string |
The Decentralized Identifier of the NFT asset. |
nftAmount |
bigint |
The amount of NFTs to burn. |
from |
NvmAccount |
The account of the publisher of the NFT with permissions to burn. |
txParams? |
TxParameters |
Optional transaction parameters. |
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.nfts1155.burn(did, 2n, artist)
src/nevermined/api/nfts/NFT1155Api.ts:189
▸ burnBatchFromHolders(holders
, tokenIds
, amounts
, from
, txParams?
): Promise
<any
>
Burns NFTs associated with an asset of a specific account.
Name | Type | Description |
---|---|---|
holders |
string [] |
Array of addresses of the accounts holding the NFT editions that are going to be burned |
tokenIds |
string [] |
Array of the NFT ids to burn |
amounts |
bigint [] |
Array of number of editions to burn |
from |
NvmAccount |
The account of the publisher of the NFT. |
txParams? |
TxParameters |
Optional transaction parameters. |
Promise
<any
>
The TransactionReceipt
Remarks
The publisher can only burn NFTs of an account if is an operator. NFTs that were already transferred cannot be burned by the publisher.
Example
await nevermined.nfts1155.burnBatchFromHolders(
[holder1, holder2],
[tokenId, tokenId],
[2n, 3n],
burner,
)
NFT1155Api.burnBatchFromHolders
src/nevermined/api/nfts/NFT1155Api.ts:251
▸ burnFromHolder(holder
, tokenId
, nftAmount
, from
, txParams?
): Promise
<any
>
Burns NFTs associated with an asset of a specific account.
Name | Type | Description |
---|---|---|
holder |
string |
The address of the account that holds the NFTs. |
tokenId |
string |
The TokenId of the NFT |
nftAmount |
bigint |
The amount of NFTs to burn. |
from |
NvmAccount |
The account of the publisher of the NFT. |
txParams? |
TxParameters |
Optional transaction parameters. |
Promise
<any
>
The TransactionReceipt
Remarks
The publisher can only burn NFTs of an account if is an operator. NFTs that were already transferred cannot be burned by the publisher.
Example
await nevermined.nfts1155.burnFromHolder(holder, tokenId, 2n, artist)
src/nevermined/api/nfts/NFT1155Api.ts:217
▸ buySecondaryMarketNft(from
, nftAmount?
, agreementIdSeed
, conditionsTimeout?
, txParams?
): Promise
<boolean
>
Buys a number of listed NFTs on secondary markets.
Name | Type | Description |
---|---|---|
from |
NvmAccount |
The account of the buyer/consumer. |
nftAmount |
bigint |
The number of assets to buy. 1 by default. |
agreementIdSeed |
string |
The seed of the initial sales agreement created off-chain. |
conditionsTimeout |
number [] |
The timeout for the conditions. |
txParams? |
TxParameters |
Optional transaction parameters |
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.
NFT1155Api.buySecondaryMarketNft
src/nevermined/api/nfts/NFTsBaseApi.ts:345
▸ claim(agreementId
, nftHolder
, nftReceiver
, numberEditions?
, did?
, serviceIndex?
): Promise
<boolean
>
Claims the transfer of a NFT to the Nevermined Node on behalf of the publisher.
Name | Type | Description |
---|---|---|
agreementId |
string |
The NFT sales agreement id. |
nftHolder |
string |
The address of the current owner of the NFT. |
nftReceiver |
string |
The address where the NFT should be transferred. |
numberEditions |
bigint |
The number of NFT editions to transfer. If the NFT is ERC-1155 it should be 1 |
did? |
string |
The Decentralized Identifier of the asset. |
serviceIndex? |
number |
The index of the service in the DDO that will be claimed |
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.nfts1155.claim(
agreementId,
publisherAddress,
subscriberAddress,
1n,
did,
)
src/nevermined/api/nfts/NFT1155Api.ts:354
▸ 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.
Name | Type | Default value | Description |
---|---|---|---|
agreementId |
string |
undefined |
The NFT sales agreement id. |
nftHolder |
string |
undefined |
The address of the current owner of the NFT. |
nftReceiver |
string |
undefined |
The address where the NFT should be transferred. |
numberEditions |
bigint |
undefined |
The number of NFT editions to transfer. If the NFT is ERC-721 it should be 1 |
ercType |
ERCType |
1155 |
The Type of the NFT ERC (1155 or 721). |
did? |
string |
undefined |
The DID of the asset. |
serviceIndex? |
number |
undefined |
The index of the service in the DDO that will be claimed |
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
src/nevermined/api/nfts/NFTsBaseApi.ts:52
▸ create(nftAttributes
, from
, publicationOptions?
, txParams?
): SubscribablePromise
<CreateProgressStep
, DDO
>
Creates a new Nevermined asset associated to a NFT (ERC-1155).
Name | Type | Description |
---|---|---|
nftAttributes |
NFTAttributes |
Attributes describing the NFT (ERC-1155) associated to 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 |
SubscribablePromise
<CreateProgressStep
, DDO
>
The newly registered DDO.
Example
const assetAttributes = AssetAttributes.getInstance({
metadata,
price: assetPrice,
serviceTypes: ['nft-sales', 'nft-access'],
})
const nftAttributes = NFTAttributes.getNFT1155Instance({
...assetAttributes,
nftContractAddress: nftUpgradeable.address,
cap: cappedAmount,
amount: numberNFTs,
royaltyAttributes,
preMint,
})
const ddo = await nevermined.nfts1155.create(nftAttributes, publisher)
See
PublishOnChainOptions and PublishMetadataOptions
src/nevermined/api/nfts/NFT1155Api.ts:107
▸ 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 a NFT
Name | Type | Description |
---|---|---|
did |
string |
The Decentralized Identifier of the NFT asset. |
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())
src/nevermined/api/nfts/NFT1155Api.ts:710
▸ getSubscriptionToken(did
, from
): Promise
<SubscriptionToken
>
Get a JWT token for an asset associated with a webService
Name | Type | Description |
---|---|---|
did |
string |
The did of the asset with a webService resource and an associated subscription |
from |
NvmAccount |
Account of the user requesting the token |
Promise
<SubscriptionToken
>
Example
const response = await nevermined.nfts721.getSubscriptionToken(serviceDDO.id, subscriber)
assert.isDefined(response.accessToken)
assert.isDefined(response.neverminedProxyUri)
NFT1155Api.getSubscriptionToken
src/nevermined/api/nfts/NFTsBaseApi.ts:490
▸ grantOperatorRole(operatorAddress
, from
, txParams?
): Promise
<any
>
Adds a minter (minterAddress
) to the NFT Contract.
Granting and revoking minting permissions only can be done by the NFT Contract owner
Name | Type | Description |
---|---|---|
operatorAddress |
string |
The address of the account to be added as operator in the NFT Contract |
from |
NvmAccount |
The account giving operator permissions |
txParams? |
TxParameters |
Optional transaction parameters. |
Promise
<any
>
The TransactionReceipt
Example
await nevermined.nfts1155.grantOperatorRole(someoneElse, artist)
src/nevermined/api/nfts/NFT1155Api.ts:656
▸ isApprovedForAll(operatorAddress
, from
): Promise
<unknown
>
Returns if the operatorAddress
is approved
Name | Type | Description |
---|---|---|
operatorAddress |
string |
The address to check the permissions |
from |
string |
The address of the account granting or revoking the permissions via setApprovalForAll . |
Promise
<unknown
>
Boolean saying if the operatorAddress
is approved
See
Example
await nevermined.nfts1155.isApprovedForAll(someoneElse, artist.getId())
src/nevermined/api/nfts/NFT1155Api.ts:572
▸ isOperator(nftContractAddress
, operatorAddress
, ercType?
): Promise
<boolean
>
Check if a particular address is the operator of given a NFT address.
Name | Type | Default value | Description |
---|---|---|---|
nftContractAddress |
string |
undefined |
The DID of the NFT to check |
operatorAddress |
string |
undefined |
The address to check if operator status |
ercType |
ERCType |
1155 |
The erc type of the NFT. |
Promise
<boolean
>
operator status of address as a boolean
src/nevermined/api/nfts/NFTsBaseApi.ts:118
▸ isOperatorOfDID(did
, address
, ercType?
): Promise
<boolean
>
Check if a particular address is the operator of a DID.
Name | Type | Default value | Description |
---|---|---|---|
did |
string |
undefined |
The DID of the NFT to check |
address |
string |
undefined |
The address to check if operator status |
ercType |
ERCType |
1155 |
The erc type of the NFT. |
Promise
<boolean
>
operator status of address as a boolean
src/nevermined/api/nfts/NFTsBaseApi.ts:93
▸ 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.
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 |
SubscribablePromise
<UpdateProgressStep
, DDO
>
DDO The DDO updated
src/nevermined/api/RegistryBaseApi.ts:512
▸ listOnSecondaryMarkets(ddo
, assetPrice
, nftAmount
, nftTransfer
, provider
, token
, from
): Promise
<string
>
After purchase re-list an NFT to enable secondary market sales.
Name | Type | Description |
---|---|---|
ddo |
DDO |
The DDO of the asset. |
assetPrice |
AssetPrice |
The current setup of asset rewards. |
nftAmount |
bigint |
The number of NFTs put up for secondary sale. |
nftTransfer |
boolean |
- |
provider |
string |
The address that will be the provider of the secondary sale. |
token |
Token |
- |
from |
NvmAccount |
The account of the current owner. |
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.
NFT1155Api.listOnSecondaryMarkets
src/nevermined/api/nfts/NFTsBaseApi.ts:262
▸ mint(did
, nftAmount
, receiver
, from
, data?
, txParams?
): Promise
<any
>
It mints the NFTs associated with an asset.
Name | Type | Description |
---|---|---|
did |
string |
The Decentralized Identifier of the NFT asset. |
nftAmount |
bigint |
The amount of NFTs to mint. |
receiver |
undefined | string |
Account address of the NFT receiver, if undefined the minter account will receive the NFT/s |
from |
NvmAccount |
The account minting the NFT. * |
data? |
string |
Data |
txParams? |
TxParameters |
Optional transaction parameters. |
Promise
<any
>
The TransactionReceipt
Remarks
This function can be called multiple times as long as the minting does not exceed the maximum cap set during creation.
Example
await nevermined.nfts1155.mint(did, 10n, artist)
src/nevermined/api/nfts/NFT1155Api.ts:149
▸ order(did
, numberEditions
, from
, serviceReference?
, txParams?
): SubscribablePromise
<OrderProgressStep
, string
>
It orders NFTs.
Name | Type | Default value | Description |
---|---|---|---|
did |
string |
undefined |
The Decentralized Identifier of the NFT asset. |
numberEditions |
bigint |
undefined |
The amount of NFTs to buy. |
from |
NvmAccount |
undefined |
The account of the NFT buyer. |
serviceReference |
number | ServiceType |
'nft-sales' |
The reference to identify wich service within the DDO to order |
txParams? |
TxParameters |
undefined |
Optional transaction parameters. |
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
agreementId = await nevermined.nfts1155.order(ddo.id, numberNFTs, collector)
src/nevermined/api/nfts/NFT1155Api.ts:284
▸ 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).
Name | Type | Description |
---|---|---|
did |
string |
Decentralized ID. |
serviceReference |
number | ServiceType |
Service. |
from |
NvmAccount |
Consumer account. |
txParams? |
TxParameters |
Transaction parameters |
SubscribablePromise
<OrderProgressStep
, string
>
The agreement ID.
src/nevermined/api/RegistryBaseApi.ts:615
▸ owner(): Promise
<string
>
Gets the contract owner
Promise
<string
>
Address of the contract owner
Example
const nftContractOwner = new NvmAccount(await nevermined.nfts1155.owner())
src/nevermined/api/nfts/NFT1155Api.ts:517
▸ 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.
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 |
SubscribablePromise
<CreateProgressStep
, DDO
>
The metadata of the asset created (DDO)
See
PublishOnChainOptions and PublishMetadataOptions
NFT1155Api.registerNeverminedAsset
src/nevermined/api/RegistryBaseApi.ts:52
▸ releaseRewards(agreementId
, did
, serviceReference?
, nftAmount
, from
, txParams?
): Promise
<boolean
>
Release the funds from escrow.
Name | Type | Default value | Description |
---|---|---|---|
agreementId |
string |
undefined |
The NFT sales agreement id. |
did |
string |
undefined |
The Decentralized identifier of the NFT asset. |
serviceReference |
number | ServiceType |
'nft-sales' |
The reference to identify wich service within the DDO to release rewards |
nftAmount |
bigint |
undefined |
The amount of NFTs to transfer. |
from |
NvmAccount |
undefined |
The current owner of the NFTs. |
txParams? |
TxParameters |
undefined |
Optional transaction parameters. |
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.nfts1155.releaseRewards(agreementId, ddo.id, numberNFTs, artist)
Throws
NFTError Thrown if there is an error releasing the rewards
src/nevermined/api/nfts/NFT1155Api.ts:457
▸ releaseSecondaryMarketRewards(owner
, consumer
, agreementIdSeed
, serviceReference?
, txParams?
): Promise
<boolean
>
Used to release the secondary market NFT & the locked rewards.
Name | Type | Default value | Description |
---|---|---|---|
owner |
NvmAccount |
undefined |
The owner account. |
consumer |
NvmAccount |
undefined |
The consumer account. |
agreementIdSeed |
string |
undefined |
the Id of the underlying service agreement seed. |
serviceReference |
number | ServiceType |
'nft-sales' |
The reference to identify wich service within the DDO to release rewards |
txParams? |
TxParameters |
undefined |
Optional transaction parameters. |
Promise
<boolean
>
true if the transaction was successful.
Example
// TODO
Throws
NFTError Thrown if there is an error releasing the rewards.
NFT1155Api.releaseSecondaryMarketRewards
src/nevermined/api/nfts/NFT1155Api.ts:594
▸ 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).
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) |
Promise
<DDO
>
src/nevermined/api/RegistryBaseApi.ts:349
▸ revokeOperatorRole(operatorAddress
, from
, txParams?
): Promise
<any
>
Revokes an address (operatorAddress
) of the NFT Contract as operator.
Granting and revoking minting permissions only can be done by the NFT Contract owner
Name | Type | Description |
---|---|---|
operatorAddress |
string |
The address of the account to be revoked as operator in the NFT Contract |
from |
NvmAccount |
The account revoking operator permissions |
txParams? |
TxParameters |
Optional transaction parameters. |
Promise
<any
>
The TransactionReceipt
Example
await nevermined.nfts1155.revokeOperatorRole(someoneElse, artist)
src/nevermined/api/nfts/NFT1155Api.ts:682
▸ setApprovalForAll(operatorAddress
, approved
, from
, txParams?
): Promise
<any
>
Enable or disable NFT permissions for an operator.
Name | Type | Description |
---|---|---|
operatorAddress |
string |
The address that of the operator we want to give transfer rights to. |
approved |
boolean |
Give or remove transfer rights from the operator. |
from |
NvmAccount |
The account that wants to give transfer rights to the operator. |
txParams? |
TxParameters |
Transaction additional parameters |
Promise
<any
>
The TransactionReceipt
See
Example
await nevermined.nfts1155.setApprovalForAll(someoneElse, true, artist)
src/nevermined/api/nfts/NFT1155Api.ts:542
▸ setInstanceConfig(config
): void
Name | Type |
---|---|
config |
InstantiableConfig |
void
src/Instantiable.abstract.ts:163
▸ transfer(agreementId
, did
, nftAmount
, from
, serviceReference?
, txParams?
): Promise
<boolean
>
Transfer NFTs to the consumer.
Name | Type | Default value | Description |
---|---|---|---|
agreementId |
string |
undefined |
The NFT sales agreement id. |
did |
string |
undefined |
The Decentralized identifier of the NFT asset. |
nftAmount |
bigint |
undefined |
The number of NFTs to transfer. |
from |
NvmAccount |
undefined |
The current owner of the NFTs. |
serviceReference |
number | ServiceType |
'nft-sales' |
The reference to identify wich service within the DDO to transfer |
txParams? |
TxParameters |
undefined |
Optional transaction parameters. |
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.nfts1155.transfer(agreementId, ddo.id, numberNFTs, artist)
Throws
NFTError Thrown if there is an error transferring the NFT
src/nevermined/api/nfts/NFT1155Api.ts:401
▸ 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.
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 |
SubscribablePromise
<UpdateProgressStep
, DDO
>
DDO The DDO updated
src/nevermined/api/RegistryBaseApi.ts:392
▸ deployInstance(config
, contractABI
, from
, args?
): Promise
<SubscriptionCreditsNFTApi
>
It deploys a new instance of the Subscription NFT (ERC-1155) contract
Name | Type | Default value | Description |
---|---|---|---|
config |
NeverminedOptions |
undefined |
The Nevermined config |
contractABI |
any |
undefined |
The ABI of the Subscription NFT Contract |
from |
NvmAccount |
undefined |
The account that will deploy the contract |
args |
never [] |
[] |
The list of arguments passed to the contract when is initialized |
Promise
<SubscriptionCreditsNFTApi
>
The Subscription NFT API instance SubscriptionCreditsNFTApi.
src/nevermined/api/nfts/SubscriptionCreditsNFTApi.ts:45
▸ getInstance(config
, nftContractInstance?
, nftContractAddress?
): Promise
<NFT1155Api
>
Create a new Nevermined NFTs (ERC-1155) instance allowing to interact with that kind of NFTs.
Name | Type | Description |
---|---|---|
config |
InstantiableConfig |
The Nevermined config |
nftContractInstance? |
Nft1155Contract |
If there is already deployed an instance of Nft1155Contract |
nftContractAddress? |
string |
If the Nft1155Contract is deployed in an address it will connect to that contract |
Promise
<NFT1155Api
>
The NFTs 1155 API instance NFT1155Api.
Example
nfts1155 = await Nft1155Api.getInstance(instanceConfig, nft1155Contract)
src/nevermined/api/nfts/NFT1155Api.ts:44
▸ getInstanceUsingABI(config
, nftContractAddress
, solidityABI
): Promise
<SubscriptionCreditsNFTApi
>
It gets a Subscription NFT (ERC-1155) instance
Name | Type | Description |
---|---|---|
config |
InstantiableConfig |
The Nevermined config |
nftContractAddress |
string |
If the Subscription NFT Contract is deployed in an address it will connect to that contract |
solidityABI |
any |
The ABI of the Contract |
Promise
<SubscriptionCreditsNFTApi
>
The Subscription NFT API instance SubscriptionCreditsNFTApi.
src/nevermined/api/nfts/SubscriptionCreditsNFTApi.ts:20
▸ getNFTContractAddress(ddo
, serviceReference?
): any
Gets the NFT contract address associated with a Nevermined asset from the DDO.
Name | Type | Default value | Description |
---|---|---|---|
ddo |
DDO |
undefined |
The DDO of the asset. |
serviceReference |
number | ServiceType |
'nft-access' |
The service type to look for the contract address |
any
The NFT contract address.
Example
const nftContractAddress = NFT1155Api.getNFTContractAddress(ddo)
NFT1155Api.getNFTContractAddress
src/nevermined/api/nfts/NFTsBaseApi.ts:221
▸ getServicePlugin(config
): Object
Initializes the default Nevermined service plugins and return that instance
Name | Type | Description |
---|---|---|
config |
InstantiableConfig |
Nevermined config |
Object
The Nevermined Service Plugin instance
Name | Type |
---|---|
access |
AccessService |
compute |
EscrowComputeExecutionTemplate |
nft-access |
NFTAccessService |
nft-sales |
NFTSalesService |
src/nevermined/api/RegistryBaseApi.ts:670
▸ setInstanceConfig<T
>(instance
, instantiableConfig
): void
Name | Type |
---|---|
T |
extends Instantiable |
Name | Type |
---|---|
instance |
T |
instantiableConfig |
InstantiableConfig |
void