NftApi
public protocol NftApi : BaseApi
Undocumented
-
get(byId:)Default implementationGet NFT by id.
Throws
DCoreException.Network.notFoundif NFT does not exist.Default Implementation
Declaration
Swift
func get(byId id: ObjectIdConvertible) -> Single<Nft>Parameters
idNFT object id, as
NftObjectIdorStringformat.Return Value
Nft. -
getAll(byIds:)Default implementationGet NFTs by id.
Default Implementation
Declaration
Swift
func getAll(byIds ids: [ObjectIdConvertible]) -> Single<[Nft]>Parameters
idsNFT object ids, as
NftObjectIdorStringformat.Return Value
Array of
Nftobjects -
get(byReference:)Default implementationGet NFT by reference.
Throws
DCoreException.Network.notFoundif NFT does not exist.Default Implementation
Parameters
referenceNFT object id or symbol, as
Stringformat.Return Value
Nft. -
get(bySymbol:)Default implementationGet NFT by symbol.
Throws
DCoreException.Network.notFoundif NFT does not exist.Default Implementation
Declaration
Swift
func get(bySymbol symbol: String) -> Single<Nft>Parameters
symbolNFT symbol, as
Stringformat.Return Value
Nft. -
getAll(bySymbols:)Default implementation -
listAllRelative(byLower:limit:)Default implementationGet NFTs alphabetically by symbol name
Default Implementation
Declaration
Swift
func listAllRelative(byLower bound: String, limit: Int) -> Single<[Nft]>Parameters
boundlower bound of symbol names to retrieve
limitmaximum number of NFTs to fetch (must not exceed 100)
Return Value
Array of found
Nftobjects. -
getDataRaw(byId:)Default implementationGet NFT data instance with raw model.
Throws
DCoreException.Network.notFoundif NFT does not exist.Default Implementation
Declaration
Swift
func getDataRaw(byId id: ObjectIdConvertible) -> Single<NftData<RawNft>>Parameters
idNFT data object id, as
NftDataObjectIdorStringformat.Return Value
NftData<RawNft>object. -
getAllDataRaw(byIds:)Default implementationGet NFT data instances with raw model.
Default Implementation
Declaration
Swift
func getAllDataRaw(byIds ids: [ObjectIdConvertible]) -> Single<[NftData<RawNft>]>Parameters
idsNFT data object ids, as
NftDataObjectIdorStringformat.Return Value
Array of
NftData<RawNft>objects. -
getData(byId:)Default implementationGet NFT data instance with parsed model.
Throws
DCoreException.Network.notFoundif NFT does not exist.Default Implementation
Declaration
Swift
func getData<T>(byId id: ObjectIdConvertible) -> Single<NftData<T>> where T : NftModelParameters
idNFT data object id, as
NftDataObjectIdorStringformat.Return Value
NftDataobject. -
getAllData(byIds:)Default implementationGet NFT data instances with parsed model.
Default Implementation
Declaration
Swift
func getAllData<T>(byIds ids: [ObjectIdConvertible]) -> Single<[NftData<T>]> where T : NftModelParameters
idsNFT data object ids, as
NftDataObjectIdorStringformat.Return Value
Array of
NftDataobjects. -
listDataRaw(byNftId:)Default implementationGet NFT data instances with raw model.
Default Implementation
Declaration
Swift
func listDataRaw(byNftId nftId: ObjectIdConvertible) -> Single<[NftData<RawNft>]>Parameters
nftIdNFT object id as
NftObjectIdorStringformat.Return Value
Array of
NftData<RawNft>objects. -
listData(byNftId:)Default implementationGet NFT data instances with parsed model.
Default Implementation
Declaration
Swift
func listData<T>(byNftId nftId: ObjectIdConvertible) -> Single<[NftData<T>]> where T : NftModelParameters
nftIdNFT object id as
NftObjectIdorStringformat.Return Value
Array of
NftDataobjects. -
searchNftHistory(byNftDataId:)Default implementationSearch NFT history, lists transfer and issue operations for NFT data instance object id.
Default Implementation
Declaration
Swift
func searchNftHistory(byNftDataId nftDataId: ObjectIdConvertible) -> Single<[TransactionDetail]>Parameters
nftDataIdNFT data object id, as
NftDataObjectIdorStringformat.Return Value
Array of
TransactionDetailobjects representing transfer and issue operations. -
countAllNft()Default implementationCount all NFTs
Default Implementation
Declaration
Swift
func countAllNft() -> Single<UInt64>Return Value
count of NFT definitions
-
countAllNftData()Default implementationCount all NFT data instances
Default Implementation
Declaration
Swift
func countAllNftData() -> Single<UInt64>Return Value
count of NFT data instances
-
getNftBalancesRaw(account:nftIds:)Default implementationGet NFT balances per account with raw model
Default Implementation
Declaration
Swift
func getNftBalancesRaw(account: AccountObjectIdConvertible, nftIds: [ObjectIdConvertible]) -> Single<[NftData<RawNft>]>Parameters
accountAccount object id, as
AccountObjectIdorStringformat.nftIdsNFT object ids to filter, or empty list to fetch all, as
NftObjectIdorStringformat.Return Value
NFT data instances with raw model
-
getNftBalances(account:nftIds:)Default implementationGet NFT balances per account with parsed model
Default Implementation
Declaration
Swift
func getNftBalances<T>(account: AccountObjectIdConvertible, nftIds: [ObjectIdConvertible]) -> Single<[NftData<T>]> where T : NftModelParameters
accountAccount object id, as
AccountObjectIdorStringformat.nftIdsNFT object ids to filter, or empty list to fetch all, as
NftObjectIdorStringformat.Return Value
NFT data instances with parsed model
-
create(credentials:symbol:maxSupply:fixedMaxSupply:description:nftModel:transferable:fee:)Default implementationUndocumented
Default Implementation
Undocumented
Declaration
Swift
func create<T>(credentials: Credentials, symbol: String, maxSupply: UInt32, fixedMaxSupply: Bool, description: String, nftModel: T.Type, transferable: Bool, fee: AssetAmount) -> Single<TransactionConfirmation> where T : NftModel -
update(credentials:reference:maxSupply:fixedMaxSupply:description:fee:)Default implementationUpdate NFT
Default Implementation
Declaration
Swift
func update(credentials: Credentials, reference: Nft.Reference, maxSupply: UInt32?, fixedMaxSupply: Bool?, description: String?, fee: AssetAmount) -> Single<TransactionConfirmation>Parameters
credentialsissuer account credentials.
referenceNFT object id or symbol.
maxSupplyupdate NFT max suppy.
fixedMaxSupplyupdate NFT max supply is fixed.
descriptionupdate text description.
feeAssetAmountfee for the operation, if leftAssetAmount.unsetthe fee will be computed in DCT asset, defaultAssetAmount.unset.Return Value
TransactionConfirmationthat NFT was updated. -
updateData(credentials:id:newData:fee:)Default implementationUpdate NFT data instance
Default Implementation
Declaration
Swift
func updateData<T>(credentials: Credentials, id: ObjectIdConvertible, newData: T, fee: AssetAmount) -> Single<TransactionConfirmation> where T : NftModelParameters
credentialsissuer account credentials.
idNFT data object id, as
NftDataObjectIdorStringformat.newDatadata model with values.
feeAssetAmountfee for the operation, if leftAssetAmount.unsetthe fee will be computed in DCT asset, defaultAssetAmount.unset.Return Value
TransactionConfirmationthat NFT data instance was updated. -
issue(credentials:reference:to:data:memo:fee:)Default implementationIssue NFT. Creates a NFT data instance.
Default Implementation
Declaration
Swift
func issue<T>(credentials: Credentials, reference: Nft.Reference, to: AccountObjectIdConvertible, data: T?, memo: Memo?, fee: AssetAmount) -> Single<TransactionConfirmation> where T : NftModelParameters
credentialsaccount credentials issuing the NFT.
referenceNFT object id or symbol.
toaccount object id receiving the NFT data instance as
AccountObjectIdorStringformat.datadata model with values.
memooptional message.
feeAssetAmountfee for the operation, if leftAssetAmount.unsetthe fee will be computed in DCT asset, defaultAssetAmount.unset.Return Value
TransactionConfirmationthat NFT was issued. -
transfer(credentials:to:id:memo:fee:)Default implementationTransfer NFT data instance.
Default Implementation
Declaration
Swift
func transfer(credentials: Credentials, to: AccountObjectIdConvertible, id: ObjectIdConvertible, memo: Memo?, fee: AssetAmount) -> Single<TransactionConfirmation>Parameters
credentialsNFT data instance owner credentials.
toaccount object id receiving the NFT data instance as
AccountObjectIdorStringformat.idNFT data object id, as
NftDataObjectIdorStringformat.memooptional message.
feeAssetAmountfee for the operation, if leftAssetAmount.unsetthe fee will be computed in DCT asset, defaultAssetAmount.unset.Return Value
TransactionConfirmationthat NFT was transfered.
View on GitHub
Install in Dash
NftApi Protocol Reference