Skip to content

Commit c230ecb

Browse files
committed
chore(sdk-coin-sui): add contractAddress to tokenConfig
TICKET: WIN-4531
1 parent 319629c commit c230ecb

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

modules/sdk-coin-sui/src/suiToken.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ export class SuiToken extends Sui {
5252
return this.tokenConfig.decimalPlaces;
5353
}
5454

55+
get contractAddress(): string {
56+
return this.tokenConfig.contractAddress;
57+
}
58+
5559
getChain(): string {
5660
return this.tokenConfig.type;
5761
}

modules/sdk-coin-sui/test/unit/suiToken.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,15 @@ describe('Sui Tokens', function () {
2828
suiTokenCoin.coin.should.equal('tsui');
2929
suiTokenCoin.network.should.equal('Testnet');
3030
suiTokenCoin.decimalPlaces.should.equal(6);
31+
suiTokenCoin.packageId.should.equal('0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8');
32+
suiTokenCoin.module.should.equal('deep');
33+
suiTokenCoin.symbol.should.equal('DEEP');
34+
suiTokenCoin.contractAddress.should.equal(
35+
'0x36dbef866a1d62bf7328989a10fb2f07d769f4ee587c0de4a0a256e57e0a58a8::deep::DEEP'
36+
);
37+
const [packageId, module, symbol] = suiTokenCoin.contractAddress.split('::');
38+
packageId.should.equal(suiTokenCoin.packageId);
39+
module.should.equal(suiTokenCoin.module);
40+
symbol.should.equal(suiTokenCoin.symbol);
3141
});
3242
});

modules/statics/src/tokenConfig.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export type SuiTokenConfig = BaseNetworkConfig & {
7979
packageId: string;
8080
module: string;
8181
symbol: string;
82+
contractAddress: string;
8283
};
8384

8485
export type AptTokenConfig = BaseNetworkConfig & {
@@ -511,6 +512,7 @@ const formattedSuiTokens = coins.reduce((acc: SuiTokenConfig[], coin) => {
511512
packageId: coin.packageId,
512513
module: coin.module,
513514
symbol: coin.symbol,
515+
contractAddress: coin.contractAddress,
514516
});
515517
}
516518
return acc;

0 commit comments

Comments
 (0)