@@ -78,6 +78,10 @@ export interface Erc20ConstructorOptions extends AccountConstructorOptions {
7878 contractAddress : string ;
7979}
8080
81+ export interface CollectionIdConstructorOptions extends AccountConstructorOptions {
82+ collectionId : string ;
83+ }
84+
8185export interface StellarCoinConstructorOptions extends AccountConstructorOptions {
8286 domain : string ;
8387}
@@ -180,6 +184,20 @@ export class ContractAddressDefinedToken extends AccountCoinToken {
180184 }
181185}
182186
187+ /**
188+ * Used for blockchains that support NFT collections.
189+ */
190+ export class CollectionIdDefinedToken extends AccountCoinToken {
191+ public collectionId : string ;
192+
193+ constructor ( options : CollectionIdConstructorOptions ) {
194+ super ( {
195+ ...options ,
196+ } ) ;
197+ this . collectionId = options . collectionId ;
198+ }
199+ }
200+
183201/**
184202 * ERC20 token addresses are Base58 formatted on some blockchains.
185203 */
@@ -501,6 +519,12 @@ export class AptCoin extends AccountCoinToken {
501519 }
502520}
503521
522+ /**
523+ * The Apt network supports non-fungible tokens (Digital Asset Standard)
524+ * Every NFT belongs to an NFT collection.
525+ */
526+ export class AptNFTCollection extends CollectionIdDefinedToken { }
527+
504528/**
505529 * Fiat currencies, such as USD, EUR, or YEN.
506530 */
@@ -2513,6 +2537,51 @@ export function aptToken(
25132537 ) ;
25142538}
25152539
2540+ /**
2541+ * Factory function for Apt NFT collections.
2542+ *
2543+ * @param id uuid v4
2544+ * @param name unique identifier of the NFT collection
2545+ * @param fullName Complete human-readable name of the NFT collection
2546+ * @param collectionId collection ID of the non-fungible tokens (NFTs)
2547+ * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
2548+ * @param prefix Optional token prefix. Defaults to empty string
2549+ * @param suffix Optional token suffix. Defaults to token name.
2550+ * @param network Optional token network. Defaults to APT main network.
2551+ * @param features Features of this coin. Defaults to the DEFAULT_FEATURES and REQUIRES_RESERVE defined in `AccountCoin`
2552+ * @param primaryKeyCurve The elliptic curve for this chain/token
2553+ */
2554+ export function aptNFTCollection (
2555+ id : string ,
2556+ name : string ,
2557+ fullName : string ,
2558+ collectionId : string ,
2559+ asset : UnderlyingAsset ,
2560+ features : CoinFeature [ ] = AccountCoin . DEFAULT_FEATURES ,
2561+ prefix = '' ,
2562+ suffix : string = name . toUpperCase ( ) ,
2563+ network : AccountNetwork = Networks . main . apt ,
2564+ primaryKeyCurve : KeyCurve = KeyCurve . Ed25519
2565+ ) {
2566+ return Object . freeze (
2567+ new AptNFTCollection ( {
2568+ id,
2569+ name,
2570+ fullName,
2571+ network,
2572+ collectionId,
2573+ prefix,
2574+ suffix,
2575+ features,
2576+ decimalPlaces : 0 ,
2577+ asset,
2578+ isToken : true ,
2579+ primaryKeyCurve,
2580+ baseUnit : BaseUnit . APT ,
2581+ } )
2582+ ) ;
2583+ }
2584+
25162585/**
25172586 * Factory function for testnet apt token instances.
25182587 *
@@ -2556,6 +2625,35 @@ export function taptToken(
25562625 ) ;
25572626}
25582627
2628+ /**
2629+ * Factory function for testnet Apt NFT collections.
2630+ *
2631+ * @param id uuid v4
2632+ * @param name unique identifier of the NFT collection
2633+ * @param fullName Complete human-readable name of the NFT collection
2634+ * @param collectionId collection ID of the non-fungible tokens (NFTs)
2635+ * @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
2636+ * @param prefix Optional token prefix. Defaults to empty string
2637+ * @param suffix Optional token suffix. Defaults to token name.
2638+ * @param network Optional token network. Defaults to APT test network.
2639+ * @param features Features of this coin. Defaults to the DEFAULT_FEATURES and REQUIRES_RESERVE defined in `AccountCoin`
2640+ * @param primaryKeyCurve The elliptic curve for this chain/token
2641+ */
2642+ export function taptNFTCollection (
2643+ id : string ,
2644+ name : string ,
2645+ fullName : string ,
2646+ collectionId : string ,
2647+ asset : UnderlyingAsset ,
2648+ features : CoinFeature [ ] = AccountCoin . DEFAULT_FEATURES ,
2649+ prefix = '' ,
2650+ suffix : string = name . toUpperCase ( ) ,
2651+ network : AccountNetwork = Networks . test . apt ,
2652+ primaryKeyCurve : KeyCurve = KeyCurve . Ed25519
2653+ ) {
2654+ return aptNFTCollection ( id , name , fullName , collectionId , asset , features , prefix , suffix , network , primaryKeyCurve ) ;
2655+ }
2656+
25592657/**
25602658 * Factory function for fiat coin instances.
25612659 *
0 commit comments