Skip to content

Commit

Permalink
Merge pull request #3739 from BitGo/WIN-141-sdk-zeta-add-static-in-bi…
Browse files Browse the repository at this point in the history
…tgo-js

chore(static): update statics for zeta chain
  • Loading branch information
grsind19 authored Jul 19, 2023
2 parents 03f0246 + eeb3f88 commit 45cb0cf
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 1 deletion.
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 @@ -59,6 +59,7 @@ describe('V2 Keychains', function () {
n.asset !== UnderlyingAsset.AVAXP &&
n.asset !== UnderlyingAsset.DOGE &&
n.asset !== UnderlyingAsset.ETHW &&
n.asset !== UnderlyingAsset.ZETA &&
coinFamilyValues.includes(n.name)
);

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

/**
Expand Down Expand Up @@ -262,6 +263,7 @@ export enum UnderlyingAsset {
XRP = 'xrp',
XTZ = 'xtz',
ZEC = 'zec',
ZETA = 'zeta',

// ERC 20 tokens
'1INCH' = '1inch',
Expand Down Expand Up @@ -1291,6 +1293,7 @@ export enum BaseUnit {
BLD = 'ubld',
SEI = 'usei',
INJECTIVE = 'inj',
ZETA = 'azeta',
}

export interface BaseCoinConstructorOptions {
Expand Down
22 changes: 21 additions & 1 deletion modules/statics/src/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ const INJECTIVE_FEATURES = [
CoinFeature.TSS_COLD,
CoinFeature.STAKING,
];

const ZETA_FEATURES = [...AccountCoin.DEFAULT_FEATURES, CoinFeature.TSS, CoinFeature.TSS_COLD, CoinFeature.STAKING];
const GENERIC_TOKEN_FEATURES = [
CoinFeature.ACCOUNT_MODEL,
CoinFeature.REQUIRES_BIG_NUMBER,
Expand Down Expand Up @@ -901,6 +901,26 @@ export const coins = CoinMap.fromCoins([
BaseUnit.SEI,
SEI_FEATURES
),
account(
'9fbfb875-fb80-4a37-b844-48b9e48dfcdd',
'zeta',
'Zeta',
Networks.main.zeta,
6,
UnderlyingAsset.ZETA,
BaseUnit.ZETA,
ZETA_FEATURES
),
account(
'1aeb7754-1518-4aac-8cc0-e4bb07713a31',
'tzeta',
'Testnet Zeta',
Networks.test.zeta,
6,
UnderlyingAsset.ZETA,
BaseUnit.ZETA,
ZETA_FEATURES
),
account(
'5f9506c5-f10a-43c2-92d3-52941083bbc7',
'injective',
Expand Down
15 changes: 15 additions & 0 deletions modules/statics/src/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,19 @@ class SeiTestnet extends Testnet implements AccountNetwork {
explorerUrl = 'https://sei.explorers.guru/transaction/';
}

class Zeta extends Mainnet implements AccountNetwork {
name = 'Zeta';
family = CoinFamily.ZETA;
// TODO(WIN-142): Zeta is still only in testnet update to mainnet url when it's live
explorerUrl = 'https://explorer.zetachain.com/cc/tx/';
}

class ZetaTestnet extends Testnet implements AccountNetwork {
name = 'Testnet Zeta';
family = CoinFamily.ZETA;
explorerUrl = 'https://athens3.explorer.zetachain.com/cc/tx/';
}

class Injective extends Mainnet implements AccountNetwork {
name = 'Injective';
family = CoinFamily.INJECTIVE;
Expand Down Expand Up @@ -822,6 +835,7 @@ export const Networks = {
xrp: Object.freeze(new Xrp()),
xtz: Object.freeze(new Xtz()),
zCash: Object.freeze(new ZCash()),
zeta: Object.freeze(new Zeta()),
},
test: {
ada: Object.freeze(new AdaTestnet()),
Expand Down Expand Up @@ -867,5 +881,6 @@ export const Networks = {
xrp: Object.freeze(new XrpTestnet()),
xtz: Object.freeze(new XtzTestnet()),
zCash: Object.freeze(new ZCashTestnet()),
zeta: Object.freeze(new ZetaTestnet()),
},
};
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 @@ -60,6 +60,7 @@ export const expectedColdFeatures = {
'sei',
'sol',
'sui',
'zeta',
'tada',
'tatom',
'tbld',
Expand All @@ -74,6 +75,7 @@ export const expectedColdFeatures = {
'tsol',
'tsui',
'ttia',
'tzeta',
],
neither: [
'ethw',
Expand Down

0 comments on commit 45cb0cf

Please sign in to comment.