Skip to content

Commit

Permalink
feat: onboard eth testnet holesky
Browse files Browse the repository at this point in the history
Ticket: WIN-710
  • Loading branch information
dpkjnr committed Jan 10, 2024
1 parent dac8218 commit 6265f1b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { Dash } from '@bitgo/sdk-coin-dash';
import { Doge, Tdoge } from '@bitgo/sdk-coin-doge';
import { Dot, Tdot } from '@bitgo/sdk-coin-dot';
import { Eos, Teos } from '@bitgo/sdk-coin-eos';
import { Erc20Token, Eth, Gteth } from '@bitgo/sdk-coin-eth';
import { Erc20Token, Eth, Hteth } from '@bitgo/sdk-coin-eth';
import { Ethw } from '@bitgo/sdk-coin-ethw';
import { Ltc } from '@bitgo/sdk-coin-ltc';
import { Near, TNear } from '@bitgo/sdk-coin-near';
Expand Down Expand Up @@ -80,7 +80,7 @@ let sdk = new BitGoAPI({
sdk.register('btc', Btc.createInstance);
sdk.register('tbtc', Tbtc.createInstance);
sdk.register('eth', Eth.createInstance);
sdk.register('gteth', Gteth.createInstance);
sdk.register('hteth', Hteth.createInstance);
sdk.register('ethw', Ethw.createInstance);
sdk.register('eos', Eos.createInstance);
sdk.register('teos', Teos.createInstance);
Expand Down Expand Up @@ -228,10 +228,10 @@ async function createWindow() {
async (event, environment, coin, apiKey) => {
switch (coin) {
case 'eth':
case 'gteth':
case 'hteth':
case 'ethw':
case 'erc20':
case 'gterc20':
case 'hterc20':
sdk = new BitGoAPI({ env: environment, etherscanApiToken: apiKey });
break;
case 'avaxc':
Expand Down
22 changes: 11 additions & 11 deletions src/containers/BuildUnsignedSweepCoin/BuildUnsignedSweepCoin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function Form() {
/>
);
case 'eth':
case 'gteth':
case 'hteth':
case 'arbeth':
case 'tarbeth':
case 'opeth':
Expand Down Expand Up @@ -815,7 +815,7 @@ function Form() {
/>
);
case 'erc20':
case 'gterc20':
case 'hterc20':
return (
<Erc20TokenForm
key={coin}
Expand All @@ -828,7 +828,7 @@ function Form() {
coin,
values.apiKey
);
const parentCoin = env === 'test' ? 'gteth' : 'eth';
const parentCoin = env === 'test' ? 'hteth' : 'eth';
const chainData = await getTokenChain(
values.tokenAddress.toLowerCase(),
parentCoin
Expand All @@ -850,7 +850,7 @@ function Form() {
maxPriorityFeePerGas: toWei(maxPriorityFeePerGas),
},
replayProtectionOptions: {
chain: bitGoEnvironment === 'prod' ? 1 : 5,
chain: bitGoEnvironment === 'prod' ? 1 : 17000,
hardfork: 'london',
},
bitgoKey: '',
Expand Down Expand Up @@ -881,13 +881,13 @@ function Form() {
JSON.stringify(
includePubsInUnsignedSweep
? {
...recoverData,
...(await includePubsForToken(
values.tokenAddress.toLowerCase(),
coin,
values
)),
}
...recoverData,
...(await includePubsForToken(
values.tokenAddress.toLowerCase(),
coin,
values
)),
}
: recoverData,
null,
2
Expand Down
8 changes: 4 additions & 4 deletions src/containers/NonBitGoRecoveryCoin/NonBitGoRecoveryCoin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function Form() {
/>
);
case 'eth':
case 'gteth':
case 'hteth':
case 'arbeth':
case 'tarbeth':
case 'opeth':
Expand Down Expand Up @@ -947,7 +947,7 @@ function Form() {
/>
);
case 'erc20':
case 'gterc20':
case 'hterc20':
return (
<Erc20TokenForm
key={coin}
Expand All @@ -960,7 +960,7 @@ function Form() {
coin,
values.apiKey
);
const parentCoin = env === 'test' ? 'gteth' : 'eth';
const parentCoin = env === 'test' ? 'hteth' : 'eth';
const chainData = await getTokenChain(
values.tokenAddress.toLowerCase(),
parentCoin
Expand All @@ -977,7 +977,7 @@ function Form() {
maxPriorityFeePerGas: toWei(maxPriorityFeePerGas),
},
replayProtectionOptions: {
chain: bitGoEnvironment === 'prod' ? 1 : 5,
chain: bitGoEnvironment === 'prod' ? 1 : 17000,
hardfork: 'london',
},
bitgoKey: '',
Expand Down
24 changes: 12 additions & 12 deletions src/helpers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,19 @@ export const allCoinMetas: Record<string, CoinMetadata> = {
Icon: 'xlm',
value: 'txlm',
},
gteth: {
Title: 'GTETH',
Description: 'Goerli Testnet Ethereum',
hteth: {
Title: 'HTETH',
Description: 'Holesky Testnet Ethereum',
Icon: 'eth',
value: 'gteth',
value: 'hteth',
ApiKeyProvider: 'etherscan.com',
isTssSupported: true,
},
gterc20: {
Title: 'GTERC',
Description: 'Goerli Testnet ERC20 Token',
hterc20: {
Title: 'HTERC',
Description: 'Holesky Testnet ERC20 Token',
Icon: 'eth',
value: 'gterc20',
value: 'hterc20',
},
ttrx: {
Title: 'TTRX',
Expand Down Expand Up @@ -438,8 +438,8 @@ export const buildUnsignedSweepCoins: Record<
allCoinMetas.tbtc,
allCoinMetas.txrp,
allCoinMetas.txlm,
allCoinMetas.gteth,
allCoinMetas.gterc20,
allCoinMetas.hteth,
allCoinMetas.hterc20,
allCoinMetas.ttrx,
allCoinMetas.teos,
allCoinMetas.tavaxc,
Expand Down Expand Up @@ -495,8 +495,8 @@ export const nonBitgoRecoveryCoins: Record<BitgoEnv, readonly CoinMetadata[]> =
allCoinMetas.tbtc,
allCoinMetas.txrp,
allCoinMetas.txlm,
allCoinMetas.gteth,
allCoinMetas.gterc20,
allCoinMetas.hteth,
allCoinMetas.hterc20,
allCoinMetas.ttrx,
allCoinMetas.teos,
allCoinMetas.tavaxc,
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function getEthLikeRecoveryChainId(
coinName: string,
bitGoEnvironment: string
) {
return coinName === 'ethw' ? 10001 : bitGoEnvironment === 'prod' ? 1 : 5;
return coinName === 'ethw' ? 10001 : bitGoEnvironment === 'prod' ? 1 : 17000;
}

export type BitgoEnv = 'prod' | 'test';
Expand Down

0 comments on commit 6265f1b

Please sign in to comment.