Skip to content

Commit 96f6801

Browse files
authored
Merge pull request #5437 from BitGo/fix-apt-fungible-address-to-assetId
feat(sdk-coin-apt): change fungibleAddress to assetId
2 parents b23f83a + 3c1bd56 commit 96f6801

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

modules/sdk-coin-apt/src/aptToken.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export class AptToken extends Apt {
3636
return this.tokenConfig.network;
3737
}
3838

39-
get fungibleAssestAddress(): string {
40-
return this.tokenConfig.fungibleAssetAddress;
39+
get assetId(): string {
40+
return this.tokenConfig.assetId;
4141
}
4242

4343
get decimalPlaces(): number {

modules/sdk-coin-apt/test/unit/aptToken.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe('Apt Tokens', function () {
2727
aptTokenCoin.name.should.equal('USD Tether');
2828
aptTokenCoin.coin.should.equal('tapt');
2929
aptTokenCoin.network.should.equal('Testnet');
30+
aptTokenCoin.assetId.should.equal('0xd5d0d561493ea2b9410f67da804653ae44e793c2423707d4f11edb2e38192050');
3031
aptTokenCoin.decimalPlaces.should.equal(6);
3132
});
3233
});

modules/statics/src/account.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export interface SuiCoinConstructorOptions extends AccountConstructorOptions {
112112
}
113113

114114
export interface AptCoinConstructorOptions extends AccountConstructorOptions {
115-
fungibleAssetAddress: string;
115+
assetId: string;
116116
}
117117

118118
type FiatCoinName = `fiat${string}` | `tfiat${string}`;
@@ -466,13 +466,13 @@ export class SuiCoin extends AccountCoinToken {
466466
*
467467
*/
468468
export class AptCoin extends AccountCoinToken {
469-
public fungibleAssetAddress: string;
469+
public assetId: string;
470470
constructor(options: AptCoinConstructorOptions) {
471471
super({
472472
...options,
473473
});
474474

475-
this.fungibleAssetAddress = options.fungibleAssetAddress;
475+
this.assetId = options.assetId;
476476
}
477477
}
478478

@@ -2337,7 +2337,7 @@ export function tsuiToken(
23372337
* @param name unique identifier of the token
23382338
* @param fullName Complete human-readable name of the token
23392339
* @param decimalPlaces Number of decimal places this token supports (divisibility exponent)
2340-
* @param fungibleAssetAddress Fungible asset address of this token
2340+
* @param assetId Asset Id of this token i.e. the unique identifier of the token for all tokens - fungible, non-fungible and legacy
23412341
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
23422342
* @param prefix Optional token prefix. Defaults to empty string
23432343
* @param suffix Optional token suffix. Defaults to token name.
@@ -2350,7 +2350,7 @@ export function aptToken(
23502350
name: string,
23512351
fullName: string,
23522352
decimalPlaces: number,
2353-
fungibleAssetAddress: string,
2353+
assetId: string,
23542354
asset: UnderlyingAsset,
23552355
features: CoinFeature[] = AccountCoin.DEFAULT_FEATURES,
23562356
prefix = '',
@@ -2364,7 +2364,7 @@ export function aptToken(
23642364
name,
23652365
fullName,
23662366
network,
2367-
fungibleAssetAddress,
2367+
assetId,
23682368
prefix,
23692369
suffix,
23702370
features,
@@ -2384,7 +2384,7 @@ export function aptToken(
23842384
* @param name unique identifier of the token
23852385
* @param fullName Complete human-readable name of the token
23862386
* @param decimalPlaces Number of decimal places this token supports (divisibility exponent)
2387-
* @param fungibleAssetAddress Fungible asset of this token
2387+
* @param assetId Asset Id of this token i.e. the unique identifier of the token for all tokens - fungible, non-fungible and legacy
23882388
* @param asset Asset which this coin represents. This is the same for both mainnet and testnet variants of a coin.
23892389
* @param prefix Optional token prefix. Defaults to empty string
23902390
* @param suffix Optional token suffix. Defaults to token name.
@@ -2397,7 +2397,7 @@ export function taptToken(
23972397
name: string,
23982398
fullName: string,
23992399
decimalPlaces: number,
2400-
fungibleAssetAddress: string,
2400+
assetId: string,
24012401
asset: UnderlyingAsset,
24022402
features: CoinFeature[] = AccountCoin.DEFAULT_FEATURES,
24032403
prefix = '',
@@ -2410,7 +2410,7 @@ export function taptToken(
24102410
name,
24112411
fullName,
24122412
decimalPlaces,
2413-
fungibleAssetAddress,
2413+
assetId,
24142414
asset,
24152415
features,
24162416
prefix,

modules/statics/src/coins.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20525,14 +20525,14 @@ export const coins = CoinMap.fromCoins([
2052520525
'USD Tether',
2052620526
6,
2052720527
'0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b',
20528-
UnderlyingAsset['tapt:usdt']
20528+
UnderlyingAsset['apt:usdt']
2052920529
),
2053020530
taptToken(
2053120531
'2695e728-96dd-46e6-9d01-bd0fdbe1ff38',
2053220532
'tapt:usdt',
2053320533
'USD Tether',
2053420534
6,
20535-
'0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b',
20535+
'0xd5d0d561493ea2b9410f67da804653ae44e793c2423707d4f11edb2e38192050',
2053620536
UnderlyingAsset['tapt:usdt']
2053720537
),
2053820538
fiat('3f89b1f5-4ada-49c0-a613-15e484d42426', 'fiatusd', 'US Dollar', Networks.main.fiat, 2, UnderlyingAsset.USD),

modules/statics/src/tokenConfig.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export type SuiTokenConfig = BaseNetworkConfig & {
8282
};
8383

8484
export type AptTokenConfig = BaseNetworkConfig & {
85-
fungibleAssetAddress: string;
85+
assetId: string;
8686
};
8787

8888
export interface Tokens {
@@ -523,7 +523,7 @@ const formattedAptTokens = coins.reduce((acc: AptTokenConfig[], coin) => {
523523
coin: coin.network.type === NetworkType.MAINNET ? 'apt' : 'tapt',
524524
network: coin.network.type === NetworkType.MAINNET ? 'Mainnet' : 'Testnet',
525525
name: coin.fullName,
526-
fungibleAssetAddress: coin.fungibleAssetAddress,
526+
assetId: coin.assetId,
527527
decimalPlaces: coin.decimalPlaces,
528528
});
529529
}

0 commit comments

Comments
 (0)