Skip to content

Commit 91cab7c

Browse files
authored
Merge pull request #5129 from BitGo/COIN-2257-apt-statics
Add Apt Coin to Statics
2 parents 80a2dd5 + 3d1c70d commit 91cab7c

File tree

5 files changed

+49
-2
lines changed

5 files changed

+49
-2
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ describe('Coins', () => {
3333
XrpToken: 1,
3434
Rune: 1,
3535
Trune: 1,
36-
Apt: 1,
37-
Tapt: 1,
3836
};
3937
Object.keys(BitGoJS.Coin)
4038
.filter((coinName) => !excludedKeys[coinName])

modules/statics/src/base.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export enum CoinKind {
2222
export enum CoinFamily {
2323
ADA = 'ada',
2424
ALGO = 'algo',
25+
APT = 'apt',
2526
ARBETH = 'arbeth',
2627
ATOM = 'atom',
2728
AVAXC = 'avaxc',
@@ -2351,6 +2352,7 @@ export enum KeyCurve {
23512352
*/
23522353
export enum BaseUnit {
23532354
ATOM = 'uatom',
2355+
APT = 'octa',
23542356
ETH = 'wei',
23552357
BTC = 'satoshi',
23562358
BSC = 'jager',

modules/statics/src/coins.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,15 @@ const COREDAO_FEATURES = [
364364
CoinFeature.USES_NON_PACKED_ENCODING_FOR_TXDATA,
365365
CoinFeature.BULK_TRANSACTION,
366366
];
367+
const APT_FEATURES = [
368+
...AccountCoin.DEFAULT_FEATURES,
369+
CoinFeature.TSS,
370+
CoinFeature.TSS_COLD,
371+
CoinFeature.STAKING,
372+
CoinFeature.BULK_TRANSACTION,
373+
CoinFeature.BULK_STAKING_TRANSACTION,
374+
CoinFeature.SUPPORTS_TOKENS,
375+
];
367376
const ETH_FEATURES_WITH_FRANKFURT = [...ETH_FEATURES, CoinFeature.CUSTODY_BITGO_FRANKFURT];
368377
const SOL_TOKEN_FEATURES_WITH_FRANKFURT = [...SOL_TOKEN_FEATURES, CoinFeature.CUSTODY_BITGO_FRANKFURT];
369378
const XLM_TOKEN_FEATURES_WITH_FRANKFURT = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.CUSTODY_BITGO_FRANKFURT];
@@ -1292,6 +1301,28 @@ export const coins = CoinMap.fromCoins([
12921301
BaseUnit.ETH,
12931302
COREDAO_FEATURES
12941303
),
1304+
account(
1305+
'75a71e9c-e3a0-4852-8e4b-9613ffed2a4c',
1306+
'apt',
1307+
'Aptos',
1308+
Networks.main.apt,
1309+
8,
1310+
UnderlyingAsset.APT,
1311+
BaseUnit.APT,
1312+
APT_FEATURES,
1313+
KeyCurve.Ed25519
1314+
),
1315+
account(
1316+
'7aca10bf-79dd-428b-aeb6-54f03f9aec0f',
1317+
'tapt',
1318+
'Testnet Apt',
1319+
Networks.test.apt,
1320+
8,
1321+
UnderlyingAsset.APT,
1322+
BaseUnit.APT,
1323+
APT_FEATURES,
1324+
KeyCurve.Ed25519
1325+
),
12951326
erc20CompatibleAccountCoin(
12961327
'bfae821b-cf3a-4190-b1a8-a54af51d730e',
12971328
'celo',

modules/statics/src/networks.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@ class AdaTestnet extends Testnet implements AdaNetwork {
151151
stakeKeyDeposit = 2000000;
152152
}
153153

154+
class Apt extends Mainnet implements AccountNetwork {
155+
name = 'Apt';
156+
family = CoinFamily.APT;
157+
explorerUrl = 'https://explorer.aptoslabs.com/?network=mainnet';
158+
}
159+
160+
class AptTestnet extends Testnet implements AccountNetwork {
161+
name = 'Testnet Apt';
162+
family = CoinFamily.APT;
163+
explorerUrl = 'https://explorer.aptoslabs.com/?network=testnet';
164+
}
165+
154166
class Arbitrum extends Mainnet implements EthereumNetwork {
155167
name = 'Arbitrum';
156168
family = CoinFamily.ARBETH;
@@ -1124,6 +1136,7 @@ export const Networks = {
11241136
main: {
11251137
ada: Object.freeze(new Ada()),
11261138
algorand: Object.freeze(new Algorand()),
1139+
apt: Object.freeze(new Apt()),
11271140
arbitrum: Object.freeze(new Arbitrum()),
11281141
atom: Object.freeze(new Atom()),
11291142
avalancheC: Object.freeze(new AvalancheC()),
@@ -1183,6 +1196,7 @@ export const Networks = {
11831196
test: {
11841197
ada: Object.freeze(new AdaTestnet()),
11851198
algorand: Object.freeze(new AlgorandTestnet()),
1199+
apt: Object.freeze(new AptTestnet()),
11861200
arbitrum: Object.freeze(new ArbitrumTestnet()),
11871201
atom: Object.freeze(new AtomTestnet()),
11881202
avalancheC: Object.freeze(new AvalancheCTestnet()),

modules/statics/test/unit/fixtures/expectedColdFeatures.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const expectedColdFeatures = {
6464
],
6565
justTSS: [
6666
'ada',
67+
'apt',
6768
'atom',
6869
'bld',
6970
'bsc',
@@ -81,6 +82,7 @@ export const expectedColdFeatures = {
8182
'zeta',
8283
'tada',
8384
'tatom',
85+
'tapt',
8486
'tbld',
8587
'tbsc',
8688
'tcoreum',

0 commit comments

Comments
 (0)