NftApi
public protocol NftApi : BaseApi
Undocumented
-
get(byId:)
Default implementationGet NFT by id.
Throws
DCoreException.Network.notFound
if NFT does not exist.Default Implementation
Declaration
Swift
func get(byId id: ObjectIdConvertible) -> Single<Nft>
Parameters
id
NFT object id, as
NftObjectId
orString
format.Return Value
Nft
. -
getAll(byIds:)
Default implementationGet NFTs by id.
Default Implementation
Declaration
Swift
func getAll(byIds ids: [ObjectIdConvertible]) -> Single<[Nft]>
Parameters
ids
NFT object ids, as
NftObjectId
orString
format.Return Value
Array of
Nft
objects -
get(byReference:)
Default implementationGet NFT by reference.
Throws
DCoreException.Network.notFound
if NFT does not exist.Default Implementation
Parameters
reference
NFT object id or symbol, as
String
format.Return Value
Nft
. -
get(bySymbol:)
Default implementationGet NFT by symbol.
Throws
DCoreException.Network.notFound
if NFT does not exist.Default Implementation
Declaration
Swift
func get(bySymbol symbol: String) -> Single<Nft>
Parameters
symbol
NFT symbol, as
String
format.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
bound
lower bound of symbol names to retrieve
limit
maximum number of NFTs to fetch (must not exceed 100)
Return Value
Array of found
Nft
objects. -
getDataRaw(byId:)
Default implementationGet NFT data instance with raw model.
Throws
DCoreException.Network.notFound
if NFT does not exist.Default Implementation
Declaration
Swift
func getDataRaw(byId id: ObjectIdConvertible) -> Single<NftData<RawNft>>
Parameters
id
NFT data object id, as
NftDataObjectId
orString
format.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
ids
NFT data object ids, as
NftDataObjectId
orString
format.Return Value
Array of
NftData<RawNft>
objects. -
getData(byId:)
Default implementationGet NFT data instance with parsed model.
Throws
DCoreException.Network.notFound
if NFT does not exist.Default Implementation
Declaration
Swift
func getData<T>(byId id: ObjectIdConvertible) -> Single<NftData<T>> where T : NftModel
Parameters
id
NFT data object id, as
NftDataObjectId
orString
format.Return Value
NftData
object. -
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 : NftModel
Parameters
ids
NFT data object ids, as
NftDataObjectId
orString
format.Return Value
Array of
NftData
objects. -
listDataRaw(byNftId:)
Default implementationGet NFT data instances with raw model.
Default Implementation
Declaration
Swift
func listDataRaw(byNftId nftId: ObjectIdConvertible) -> Single<[NftData<RawNft>]>
Parameters
nftId
NFT object id as
NftObjectId
orString
format.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 : NftModel
Parameters
nftId
NFT object id as
NftObjectId
orString
format.Return Value
Array of
NftData
objects. -
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
nftDataId
NFT data object id, as
NftDataObjectId
orString
format.Return Value
Array of
TransactionDetail
objects 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
account
Account object id, as
AccountObjectId
orString
format.nftIds
NFT object ids to filter, or empty list to fetch all, as
NftObjectId
orString
format.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 : NftModel
Parameters
account
Account object id, as
AccountObjectId
orString
format.nftIds
NFT object ids to filter, or empty list to fetch all, as
NftObjectId
orString
format.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
credentials
issuer account credentials.
reference
NFT object id or symbol.
maxSupply
update NFT max suppy.
fixedMaxSupply
update NFT max supply is fixed.
description
update text description.
fee
AssetAmount
fee for the operation, if leftAssetAmount.unset
the fee will be computed in DCT asset, defaultAssetAmount.unset
.Return Value
TransactionConfirmation
that 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 : NftModel
Parameters
credentials
issuer account credentials.
id
NFT data object id, as
NftDataObjectId
orString
format.newData
data model with values.
fee
AssetAmount
fee for the operation, if leftAssetAmount.unset
the fee will be computed in DCT asset, defaultAssetAmount.unset
.Return Value
TransactionConfirmation
that 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 : NftModel
Parameters
credentials
account credentials issuing the NFT.
reference
NFT object id or symbol.
to
account object id receiving the NFT data instance as
AccountObjectId
orString
format.data
data model with values.
memo
optional message.
fee
AssetAmount
fee for the operation, if leftAssetAmount.unset
the fee will be computed in DCT asset, defaultAssetAmount.unset
.Return Value
TransactionConfirmation
that 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
credentials
NFT data instance owner credentials.
to
account object id receiving the NFT data instance as
AccountObjectId
orString
format.id
NFT data object id, as
NftDataObjectId
orString
format.memo
optional message.
fee
AssetAmount
fee for the operation, if leftAssetAmount.unset
the fee will be computed in DCT asset, defaultAssetAmount.unset
.Return Value
TransactionConfirmation
that NFT was transfered.