Skip to content

Commit 07cc5f0

Browse files
authored
Merge pull request #5875 from BitGo/coin-3613-generic-nft-statics
refactor(apt): rename collectionId field to nftCollectionId
2 parents d67bcad + 1193767 commit 07cc5f0

File tree

4 files changed

+27
-15
lines changed

4 files changed

+27
-15
lines changed

modules/statics/src/account.ts

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ export interface Erc20ConstructorOptions extends AccountConstructorOptions {
7878
contractAddress: string;
7979
}
8080

81-
export interface CollectionIdConstructorOptions extends AccountConstructorOptions {
82-
collectionId: string;
81+
export interface NFTCollectionIdConstructorOptions extends AccountConstructorOptions {
82+
nftCollectionId: string;
8383
}
8484

8585
export interface StellarCoinConstructorOptions extends AccountConstructorOptions {
@@ -187,14 +187,14 @@ export class ContractAddressDefinedToken extends AccountCoinToken {
187187
/**
188188
* Used for blockchains that support NFT collections.
189189
*/
190-
export class CollectionIdDefinedToken extends AccountCoinToken {
191-
public collectionId: string;
190+
export class NFTCollectionIdDefinedToken extends AccountCoinToken {
191+
public nftCollectionId: string;
192192

193-
constructor(options: CollectionIdConstructorOptions) {
193+
constructor(options: NFTCollectionIdConstructorOptions) {
194194
super({
195195
...options,
196196
});
197-
this.collectionId = options.collectionId;
197+
this.nftCollectionId = options.nftCollectionId;
198198
}
199199
}
200200

@@ -523,7 +523,7 @@ export class AptCoin extends AccountCoinToken {
523523
* The Apt network supports non-fungible tokens (Digital Asset Standard)
524524
* Every NFT belongs to an NFT collection.
525525
*/
526-
export class AptNFTCollection extends CollectionIdDefinedToken {}
526+
export class AptNFTCollection extends NFTCollectionIdDefinedToken {}
527527

528528
/**
529529
* Fiat currencies, such as USD, EUR, or YEN.
@@ -2543,7 +2543,7 @@ export function aptToken(
25432543
* @param id uuid v4
25442544
* @param name unique identifier of the NFT collection
25452545
* @param fullName Complete human-readable name of the NFT collection
2546-
* @param collectionId collection ID of the non-fungible tokens (NFTs)
2546+
* @param nftCollectionId collection ID of the non-fungible tokens (NFTs)
25472547
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
25482548
* @param prefix Optional token prefix. Defaults to empty string
25492549
* @param suffix Optional token suffix. Defaults to token name.
@@ -2555,7 +2555,7 @@ export function aptNFTCollection(
25552555
id: string,
25562556
name: string,
25572557
fullName: string,
2558-
collectionId: string,
2558+
nftCollectionId: string,
25592559
asset: UnderlyingAsset,
25602560
features: CoinFeature[] = AccountCoin.DEFAULT_FEATURES,
25612561
prefix = '',
@@ -2569,7 +2569,7 @@ export function aptNFTCollection(
25692569
name,
25702570
fullName,
25712571
network,
2572-
collectionId,
2572+
nftCollectionId,
25732573
prefix,
25742574
suffix,
25752575
features,
@@ -2631,7 +2631,7 @@ export function taptToken(
26312631
* @param id uuid v4
26322632
* @param name unique identifier of the NFT collection
26332633
* @param fullName Complete human-readable name of the NFT collection
2634-
* @param collectionId collection ID of the non-fungible tokens (NFTs)
2634+
* @param nftCollectionId collection ID of the non-fungible tokens (NFTs)
26352635
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
26362636
* @param prefix Optional token prefix. Defaults to empty string
26372637
* @param suffix Optional token suffix. Defaults to token name.
@@ -2643,15 +2643,26 @@ export function taptNFTCollection(
26432643
id: string,
26442644
name: string,
26452645
fullName: string,
2646-
collectionId: string,
2646+
nftCollectionId: string,
26472647
asset: UnderlyingAsset,
26482648
features: CoinFeature[] = AccountCoin.DEFAULT_FEATURES,
26492649
prefix = '',
26502650
suffix: string = name.toUpperCase(),
26512651
network: AccountNetwork = Networks.test.apt,
26522652
primaryKeyCurve: KeyCurve = KeyCurve.Ed25519
26532653
) {
2654-
return aptNFTCollection(id, name, fullName, collectionId, asset, features, prefix, suffix, network, primaryKeyCurve);
2654+
return aptNFTCollection(
2655+
id,
2656+
name,
2657+
fullName,
2658+
nftCollectionId,
2659+
asset,
2660+
features,
2661+
prefix,
2662+
suffix,
2663+
network,
2664+
primaryKeyCurve
2665+
);
26552666
}
26562667

26572668
/**

modules/statics/src/coins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3120,7 +3120,7 @@ function getAptTokenInitializer(token: AmsTokenConfig) {
31203120
// used for non-fungible token (NFT) collections
31213121
return {
31223122
initFunc: aptNFTCollection as (...args: unknown[]) => Readonly<BaseCoin>,
3123-
objectId: token.collectionId,
3123+
objectId: token.nftCollectionId,
31243124
};
31253125
}
31263126

modules/statics/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export {
1616
EosCoin,
1717
AlgoCoin,
1818
AvaxERC20Token,
19+
NFTCollectionIdDefinedToken,
1920
SolCoin,
2021
HederaToken,
2122
TronErc20Coin,

modules/statics/src/tokenConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ export interface AmsTokenConfig {
247247
primaryKeyCurve?: string;
248248
contractAddress?: string;
249249
tokenAddress?: string;
250-
collectionId?: string;
250+
nftCollectionId?: string;
251251
alias?: string;
252252
contractName?: string;
253253
tokenId?: string;

0 commit comments

Comments
 (0)