2
2
AdaCoin ,
3
3
AlgoCoin ,
4
4
AptCoin ,
5
+ AptNFTCollection ,
5
6
ArbethERC20Token ,
6
7
AvaxERC20Token ,
7
8
BeraERC20Token ,
@@ -96,6 +97,10 @@ export type AptTokenConfig = BaseNetworkConfig & {
96
97
assetId : string ;
97
98
} ;
98
99
100
+ export type AptNFTCollectionConfig = BaseNetworkConfig & {
101
+ nftCollectionId : string ;
102
+ } ;
103
+
99
104
export type Sip10TokenConfig = BaseNetworkConfig & {
100
105
assetId : string ;
101
106
} ;
@@ -161,6 +166,7 @@ export interface Tokens {
161
166
} ;
162
167
apt : {
163
168
tokens : AptTokenConfig [ ] ;
169
+ nftCollections : AptNFTCollectionConfig [ ] ;
164
170
} ;
165
171
stx : {
166
172
tokens : Sip10TokenConfig [ ] ;
@@ -226,6 +232,7 @@ export interface Tokens {
226
232
} ;
227
233
apt : {
228
234
tokens : AptTokenConfig [ ] ;
235
+ nftCollections : AptNFTCollectionConfig [ ] ;
229
236
} ;
230
237
stx : {
231
238
tokens : Sip10TokenConfig [ ] ;
@@ -618,6 +625,21 @@ const getFormattedAptTokens = (customCoinMap = coins) =>
618
625
return acc ;
619
626
} , [ ] ) ;
620
627
628
+ const getFormattedAptNFTCollections = ( customCoinMap = coins ) =>
629
+ customCoinMap . reduce ( ( acc : AptNFTCollectionConfig [ ] , coin ) => {
630
+ if ( coin instanceof AptNFTCollection ) {
631
+ acc . push ( {
632
+ type : coin . name ,
633
+ coin : coin . network . type === NetworkType . MAINNET ? 'apt' : 'tapt' ,
634
+ network : coin . network . type === NetworkType . MAINNET ? 'Mainnet' : 'Testnet' ,
635
+ name : coin . fullName ,
636
+ nftCollectionId : coin . nftCollectionId ,
637
+ decimalPlaces : coin . decimalPlaces ,
638
+ } ) ;
639
+ }
640
+ return acc ;
641
+ } , [ ] ) ;
642
+
621
643
const getFormattedSip10Tokens = ( customCoinMap = coins ) =>
622
644
customCoinMap . reduce ( ( acc : Sip10TokenConfig [ ] , coin ) => {
623
645
if ( coin instanceof Sip10Token ) {
@@ -634,6 +656,7 @@ const getFormattedSip10Tokens = (customCoinMap = coins) =>
634
656
} , [ ] ) ;
635
657
636
658
export const getFormattedTokens = ( coinMap = coins ) : Tokens => {
659
+ const formattedAptNFTCollections = getFormattedAptNFTCollections ( coinMap ) ;
637
660
return {
638
661
bitcoin : {
639
662
eth : {
@@ -697,6 +720,9 @@ export const getFormattedTokens = (coinMap = coins): Tokens => {
697
720
} ,
698
721
apt : {
699
722
tokens : getFormattedAptTokens ( coinMap ) . filter ( ( token ) => token . network === 'Mainnet' ) ,
723
+ nftCollections : formattedAptNFTCollections . filter (
724
+ ( nftCollection : AptNFTCollectionConfig ) => nftCollection . network === 'Mainnet'
725
+ ) ,
700
726
} ,
701
727
stx : {
702
728
tokens : getFormattedSip10Tokens ( coinMap ) . filter ( ( token ) => token . network === 'Mainnet' ) ,
@@ -764,6 +790,9 @@ export const getFormattedTokens = (coinMap = coins): Tokens => {
764
790
} ,
765
791
apt : {
766
792
tokens : getFormattedAptTokens ( coinMap ) . filter ( ( token ) => token . network === 'Testnet' ) ,
793
+ nftCollections : formattedAptNFTCollections . filter (
794
+ ( nftCollection : AptNFTCollectionConfig ) => nftCollection . network === 'Testnet'
795
+ ) ,
767
796
} ,
768
797
stx : {
769
798
tokens : getFormattedSip10Tokens ( coinMap ) . filter ( ( token ) => token . network === 'Testnet' ) ,
0 commit comments