Skip to content

Commit

Permalink
feat(statics): add zketh coin config
Browse files Browse the repository at this point in the history
Ticket: WIN-1421
  • Loading branch information
ajays97 committed Dec 18, 2023
1 parent 17cd108 commit 9f03344
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/bitgo/test/v2/unit/keychains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ describe('V2 Keychains', function () {
n.asset !== UnderlyingAsset.ISLM &&
n.asset !== UnderlyingAsset.ARBETH && // TODO(WIN-692): remove this once coin-specific module for arbeth is added
n.asset !== UnderlyingAsset.OPETH && // TODO(WIN-692): remove this once coin-specific module for opeth is added
n.asset !== UnderlyingAsset.ZKETH && // TODO(WIN-1427): remove this once coin-specific module for zketh is added
coinFamilyValues.includes(n.name)
);

Expand Down
2 changes: 2 additions & 0 deletions modules/statics/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export enum CoinFamily {
XTZ = 'xtz',
ZEC = 'zec',
ZETA = 'zeta',
ZKETH = 'zketh',
}

/**
Expand Down Expand Up @@ -319,6 +320,7 @@ export enum UnderlyingAsset {
XTZ = 'xtz',
ZEC = 'zec',
ZETA = 'zeta',
ZKETH = 'zketh',

// ERC 20 tokens
'$Evmosia.com' = '$evmosia.com',
Expand Down
21 changes: 21 additions & 0 deletions modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ const GENERIC_TOKEN_FEATURES = [
const TON_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.TSS, CoinFeature.TSS_COLD, CoinFeature.STAKING];
const ARBETH_FEATURES = [...ETH_FEATURES, CoinFeature.MULTISIG_COLD, CoinFeature.EVM_WALLET];
const OPETH_FEATURES = [...ETH_FEATURES, CoinFeature.MULTISIG_COLD, CoinFeature.EVM_WALLET];
const ZKETH_FEATURES = [...ETH_FEATURES, CoinFeature.MULTISIG_COLD, CoinFeature.EVM_WALLET];

export const coins = CoinMap.fromCoins([
utxo(
Expand Down Expand Up @@ -1187,6 +1188,26 @@ export const coins = CoinMap.fromCoins([
BaseUnit.ETH,
OPETH_FEATURES
),
account(
'53b1e350-f907-45ec-abf7-11d132547055',
'zketh',
'zkSync Ethereum',
Networks.main.zkSync,
18,
UnderlyingAsset.ZKETH,
BaseUnit.ETH,
ZKETH_FEATURES
),
account(
'e34d835d-5730-4b66-96f1-cace79e2bc88',
'tzketh',
'Testnet zkSync Ethereum',
Networks.test.zkSync,
18,
UnderlyingAsset.ZKETH,
BaseUnit.ETH,
ZKETH_FEATURES
),
erc20CompatibleAccountCoin(
'bfae821b-cf3a-4190-b1a8-a54af51d730e',
'celo',
Expand Down
22 changes: 22 additions & 0 deletions modules/statics/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,26 @@ class OptimismTestnet extends Testnet implements EthereumNetwork {
tokenOperationHashPrefix = 'OPETH-ERC20';
}

class ZkSync extends Mainnet implements EthereumNetwork {
name = 'ZkSync';
family = CoinFamily.ZKETH;
explorerUrl = 'https://explorer.zksync.io/tx/';
accountExplorerUrl = 'https://explorer.zksync.io/address/';
chainId = 324;
nativeCoinOperationHashPrefix = 'ZKETH';
tokenOperationHashPrefix = 'ZKETH-ERC20';
}

class ZkSyncTestnet extends Testnet implements EthereumNetwork {
name = 'ZkSyncTestnet';
family = CoinFamily.ZKETH;
explorerUrl = 'https://sepolia.explorer.zksync.io/tx/';
accountExplorerUrl = 'https://sepolia.explorer.zksync.io/address/';
chainId = 300;
nativeCoinOperationHashPrefix = 'ZKETH';
tokenOperationHashPrefix = 'ZKETH-ERC20';
}

export const Networks = {
main: {
ada: Object.freeze(new Ada()),
Expand Down Expand Up @@ -977,6 +997,7 @@ export const Networks = {
xtz: Object.freeze(new Xtz()),
zCash: Object.freeze(new ZCash()),
zeta: Object.freeze(new Zeta()),
zkSync: Object.freeze(new ZkSync()),
},
test: {
ada: Object.freeze(new AdaTestnet()),
Expand Down Expand Up @@ -1031,5 +1052,6 @@ export const Networks = {
xtz: Object.freeze(new XtzTestnet()),
zCash: Object.freeze(new ZCashTestnet()),
zeta: Object.freeze(new ZetaTestnet()),
zkSync: Object.freeze(new ZkSyncTestnet()),
},
};

0 comments on commit 9f03344

Please sign in to comment.