Skip to content

Commit

Permalink
feat(statics): added ICP to statics
Browse files Browse the repository at this point in the history
TICKET: WIN-4236
  • Loading branch information
mohd-kashif committed Jan 9, 2025
1 parent 8c5559e commit 1e83738
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/statics/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export enum CoinFamily {
FIAT = 'fiat',
HASH = 'hash', // Provenance
HBAR = 'hbar',
ICP = 'icp',
INJECTIVE = 'injective',
ISLM = 'islm',
KAVA = 'kava',
Expand Down Expand Up @@ -359,6 +360,7 @@ export enum UnderlyingAsset {
GTC = 'gtc',
HASH = 'hash', // Provenance
HBAR = 'hbar', // Hedera main coin
ICP = 'icp',
INJECTIVE = 'injective',
ISLM = 'islm',
KAVA = 'kava',
Expand Down Expand Up @@ -2454,6 +2456,7 @@ export enum BaseUnit {
TCOREUM = 'utestcore', // Coreum testnet uses different name for native coin
ISLM = 'aISLM',
RUNE = 'rune',
ICP = 'icp',
}

export interface BaseCoinConstructorOptions {
Expand Down
31 changes: 31 additions & 0 deletions modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,15 @@ const APT_FEATURES = [
CoinFeature.BULK_STAKING_TRANSACTION,
CoinFeature.SUPPORTS_TOKENS,
];
const ICP_FEATURES = [
...AccountCoin.DEFAULT_FEATURES,
CoinFeature.TSS,
CoinFeature.TSS_COLD,
CoinFeature.STAKING,
CoinFeature.BULK_TRANSACTION,
CoinFeature.BULK_STAKING_TRANSACTION,
CoinFeature.SUPPORTS_TOKENS,
];
const ETH_FEATURES_WITH_FRANKFURT = [...ETH_FEATURES, CoinFeature.CUSTODY_BITGO_FRANKFURT];
const ETH_FEATURES_WITH_FRANKFURT_GERMANY = [...ETH_FEATURES_WITH_FRANKFURT, CoinFeature.CUSTODY_BITGO_GERMANY];
const SOL_TOKEN_FEATURES_WITH_FRANKFURT = [
Expand Down Expand Up @@ -1418,6 +1427,28 @@ export const coins = CoinMap.fromCoins([
APT_FEATURES,
KeyCurve.Ed25519
),
account(
'35254b6a-5370-4e22-844b-be504b510103',
'icp',
'internet computer',
Networks.main.icp,
8,
UnderlyingAsset.ICP,
BaseUnit.ICP,
ICP_FEATURES,
KeyCurve.Ed25519
),
account(
'ce572773-26c2-4038-a96d-26649a9a96df',
'ticp',
'Testnet icp',
Networks.test.icp,
8,
UnderlyingAsset.ICP,
BaseUnit.ICP,
ICP_FEATURES,
KeyCurve.Ed25519
),
erc20CompatibleAccountCoin(
'bfae821b-cf3a-4190-b1a8-a54af51d730e',
'celo',
Expand Down
13 changes: 13 additions & 0 deletions modules/statics/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ class AptTestnet extends Testnet implements AccountNetwork {
explorerUrl = 'https://explorer.aptoslabs.com/?network=testnet';
}

class Icp extends Mainnet implements AccountNetwork {
name = 'Icp';
family = CoinFamily.ICP;
explorerUrl = 'https://www.icpexplorer.org'; //TODO update to the prod rosetta explorer ticket: WIN-4236
}

class IcpTestnet extends Testnet implements AccountNetwork {
name = 'Testnet Icp';
family = CoinFamily.ICP;
explorerUrl = 'https://www.icpexplorer.org'; //TODO update to the test rosetta explorer ticket: WIN-4236
}
class Arbitrum extends Mainnet implements EthereumNetwork {
name = 'Arbitrum';
family = CoinFamily.ARBETH;
Expand Down Expand Up @@ -1176,6 +1187,7 @@ export const Networks = {
fiat: Object.freeze(new Fiat()),
hash: Object.freeze(new Hash()),
hedera: Object.freeze(new Hedera()),
icp: Object.freeze(new Icp()),
injective: Object.freeze(new Injective()),
islm: Object.freeze(new Islm()),
kava: Object.freeze(new Kava()),
Expand Down Expand Up @@ -1236,6 +1248,7 @@ export const Networks = {
ethereumClassicTestnet: Object.freeze(new EthereumClassicTestnet()),
hash: Object.freeze(new HashTestnet()),
hedera: Object.freeze(new HederaTestnet()),
icp: Object.freeze(new IcpTestnet()),
injective: Object.freeze(new InjectiveTestnet()),
islm: Object.freeze(new IslmTestnet()),
kava: Object.freeze(new KavaTestnet()),
Expand Down
2 changes: 2 additions & 0 deletions modules/statics/test/unit/fixtures/expectedColdFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const expectedColdFeatures = {
'coreum',
'dot',
'hash',
'icp',
'islm',
'injective',
'kava',
Expand All @@ -89,6 +90,7 @@ export const expectedColdFeatures = {
'thash',
'thorchain:rune',
'tia',
'ticp',
'tislm',
'tinjective',
'tkava',
Expand Down

0 comments on commit 1e83738

Please sign in to comment.