Skip to content

Commit 2074e44

Browse files
authored
Merge pull request #5432 from BitGo/COIN-2903-onboard-apt-usdt
feat(statics): add apt usdt token
2 parents 88f35ca + 37224e8 commit 2074e44

File tree

6 files changed

+64
-2
lines changed

6 files changed

+64
-2
lines changed

modules/bitgo/src/v2/coinFactory.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
Ada,
1515
Algo,
1616
Apt,
17+
AptToken,
1718
Arbeth,
1819
ArbethToken,
1920
Atom,
@@ -353,6 +354,10 @@ function registerCoinConstructors(globalCoinFactory: CoinFactory): void {
353354
XrpToken.createTokenConstructors().forEach(({ name, coinConstructor }) =>
354355
globalCoinFactory.register(name, coinConstructor)
355356
);
357+
358+
AptToken.createTokenConstructors().forEach(({ name, coinConstructor }) =>
359+
globalCoinFactory.register(name, coinConstructor)
360+
);
356361
}
357362

358363
const GlobalCoinFactory: CoinFactory = new CoinFactory();

modules/bitgo/src/v2/coins/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { AbstractUtxoCoin } from '@bitgo/abstract-utxo';
22
import { AbstractLightningCoin } from '@bitgo/abstract-lightning';
33
import { Ada, Tada } from '@bitgo/sdk-coin-ada';
44
import { Algo, AlgoToken, Talgo } from '@bitgo/sdk-coin-algo';
5-
import { Apt, Tapt } from '@bitgo/sdk-coin-apt';
5+
import { Apt, Tapt, AptToken } from '@bitgo/sdk-coin-apt';
66
import { Arbeth, Tarbeth, ArbethToken } from '@bitgo/sdk-coin-arbeth';
77
import { Atom, Tatom } from '@bitgo/sdk-coin-atom';
88
import { AvaxC, AvaxCToken, TavaxC } from '@bitgo/sdk-coin-avaxc';
@@ -60,7 +60,7 @@ import { Zketh, Tzketh, ZkethToken } from '@bitgo/sdk-coin-zketh';
6060
export { AbstractUtxoCoin };
6161
export { AbstractLightningCoin };
6262
export { Algo, AlgoToken, Talgo };
63-
export { Apt, Tapt };
63+
export { Apt, Tapt, AptToken };
6464
export { Arbeth, Tarbeth, ArbethToken };
6565
export { Ada, Tada };
6666
export { Atom, Tatom };

modules/bitgo/test/browser/browser.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ describe('Coins', () => {
3535
Trune: 1,
3636
Tao: 1,
3737
Ttao: 1,
38+
AptToken: 1,
3839
};
3940
Object.keys(BitGoJS.Coin)
4041
.filter((coinName) => !excludedKeys[coinName])
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import 'should';
2+
3+
import { TestBitGo, TestBitGoAPI } from '@bitgo/sdk-test';
4+
import { BitGoAPI } from '@bitgo/sdk-api';
5+
import { AptToken } from '../../src';
6+
7+
describe('Apt Tokens', function () {
8+
let bitgo: TestBitGoAPI;
9+
let aptTokenCoin;
10+
const tokenName = 'tapt:usdt';
11+
12+
before(function () {
13+
bitgo = TestBitGo.decorate(BitGoAPI, { env: 'test' });
14+
AptToken.createTokenConstructors().forEach(({ name, coinConstructor }) => {
15+
bitgo.safeRegister(name, coinConstructor);
16+
});
17+
bitgo.initializeTestVars();
18+
aptTokenCoin = bitgo.coin(tokenName);
19+
});
20+
21+
it('should return constants', function () {
22+
aptTokenCoin.getChain().should.equal(tokenName);
23+
aptTokenCoin.getBaseChain().should.equal('tapt');
24+
aptTokenCoin.getFullName().should.equal('Apt Token');
25+
aptTokenCoin.getBaseFactor().should.equal(1e6);
26+
aptTokenCoin.type.should.equal(tokenName);
27+
aptTokenCoin.name.should.equal('USD Tether');
28+
aptTokenCoin.coin.should.equal('tapt');
29+
aptTokenCoin.network.should.equal('Testnet');
30+
aptTokenCoin.decimalPlaces.should.equal(6);
31+
});
32+
});

modules/statics/src/base.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,6 +2440,12 @@ export enum UnderlyingAsset {
24402440
// Sui testnet tokens
24412441
'tsui:deep' = 'tsui:deep',
24422442
'tsui:wal' = 'tsui:wal',
2443+
2444+
// Apt tokens
2445+
'apt:usdt' = 'apt:usdt',
2446+
2447+
// Apt testnet tokens
2448+
'tapt:usdt' = 'tapt:usdt',
24432449
}
24442450

24452451
/**

modules/statics/src/coins.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
solToken,
2222
stellarToken,
2323
suiToken,
24+
aptToken,
2425
talgoToken,
2526
tarbethErc20,
2627
tavaxErc20,
@@ -42,6 +43,7 @@ import {
4243
tzkethErc20,
4344
xrpToken,
4445
zkethErc20,
46+
taptToken,
4547
} from './account';
4648
import { Ada, ada } from './ada';
4749
import { avaxp } from './avaxp';
@@ -20508,6 +20510,22 @@ export const coins = CoinMap.fromCoins([
2050820510
UnderlyingAsset['tsui:wal'],
2050920511
[...SUI_TOKEN_FEATURES, CoinFeature.STAKING]
2051020512
),
20513+
aptToken(
20514+
'e8bfdab3-4ef6-4b39-9450-d9cb59593f7a',
20515+
'apt:usdt',
20516+
'USD Tether',
20517+
6,
20518+
'0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b',
20519+
UnderlyingAsset['tapt:usdt']
20520+
),
20521+
taptToken(
20522+
'2695e728-96dd-46e6-9d01-bd0fdbe1ff38',
20523+
'tapt:usdt',
20524+
'USD Tether',
20525+
6,
20526+
'0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b',
20527+
UnderlyingAsset['tapt:usdt']
20528+
),
2051120529
fiat('3f89b1f5-4ada-49c0-a613-15e484d42426', 'fiatusd', 'US Dollar', Networks.main.fiat, 2, UnderlyingAsset.USD),
2051220530
fiat(
2051320531
'8691cc4f-a425-4192-b6cb-3b0b6f646cbc',

0 commit comments

Comments
 (0)