Skip to content

Commit 35fbc36

Browse files
committed
chore: add soneium support
Ticket: WIN-5847
1 parent 561af1a commit 35fbc36

File tree

8 files changed

+81
-5
lines changed

8 files changed

+81
-5
lines changed

electron/main/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ import { Wemix,Twemix } from '@bitgo/sdk-coin-wemix';
7676
import { Tao, Ttao } from '@bitgo/sdk-coin-tao';
7777
import { Icp, Ticp } from '@bitgo/sdk-coin-icp';
7878
import { Stx, Tstx, Sip10Token } from '@bitgo/sdk-coin-stx';
79+
import { Soneium, Tsoneium } from '@bitgo/sdk-coin-soneium';
7980

8081
const bip32 = BIP32Factory(ecc);
8182

@@ -195,6 +196,8 @@ sdk.register('icp', Icp.createInstance);
195196
sdk.register('ticp', Ticp.createInstance);
196197
sdk.register('stx', Stx.createInstance);
197198
sdk.register('tstx', Tstx.createInstance);
199+
sdk.register('soneium', Soneium.createInstance);
200+
sdk.register('tsoneium', Tsoneium.createInstance);
198201

199202
Erc20Token.createTokenConstructors().forEach(({ name, coinConstructor }) => {
200203
sdk.register(name, coinConstructor);
@@ -372,7 +375,10 @@ async function createWindow() {
372375
case 'baseeth':
373376
case 'tbaseeth':
374377
sdk = new BitGoAPI({ env: environment, baseethApiToken: apiKey });
375-
378+
case 'soneium':
379+
case 'tsoneium':
380+
sdk = new BitGoAPI({ env: environment, soneiumExplorerApiToken: apiKey });
381+
break;
376382
default:
377383
sdk = new BitGoAPI({ env: environment });
378384
}

package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"@bitgo/sdk-coin-ada": "4.11.5",
1717
"@bitgo/sdk-coin-algo": "2.3.5",
1818
"@bitgo/sdk-coin-arbeth": "21.6.5",
19-
"@bitgo/sdk-coin-atom": "13.5.5",
2019
"@bitgo/sdk-coin-asi": "1.2.0",
20+
"@bitgo/sdk-coin-atom": "13.5.5",
2121
"@bitgo/sdk-coin-avaxc": "6.1.5",
2222
"@bitgo/sdk-coin-baby": "1.5.5",
2323
"@bitgo/sdk-coin-bch": "2.2.5",
@@ -42,8 +42,8 @@
4242
"@bitgo/sdk-coin-hash": "3.1.5",
4343
"@bitgo/sdk-coin-hbar": "2.2.5",
4444
"@bitgo/sdk-coin-icp": "1.17.5",
45-
"@bitgo/sdk-coin-injective": "3.1.5",
4645
"@bitgo/sdk-coin-initia": "2.1.5",
46+
"@bitgo/sdk-coin-injective": "3.1.5",
4747
"@bitgo/sdk-coin-ltc": "3.2.5",
4848
"@bitgo/sdk-coin-near": "2.7.0",
4949
"@bitgo/sdk-coin-oas": "2.2.5",
@@ -54,6 +54,7 @@
5454
"@bitgo/sdk-coin-sei": "3.1.5",
5555
"@bitgo/sdk-coin-sgb": "1.3.5",
5656
"@bitgo/sdk-coin-sol": "4.12.5",
57+
"@bitgo/sdk-coin-soneium": "^1.4.0",
5758
"@bitgo/sdk-coin-stx": "3.8.5",
5859
"@bitgo/sdk-coin-sui": "5.15.5",
5960
"@bitgo/sdk-coin-tao": "1.8.5",

scripts/build-icons.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ const coins = [
5353
'stx',
5454
'asi',
5555
'initia',
56-
'cronos'
56+
'cronos',
57+
'soneium'
5758
];
5859

5960
const paths = fs

src/components/CryptocurrencyIcon/CryptocurrencyIcon.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ export interface CryptocurrencyIconProps {
5151
| 'stx'
5252
| 'cronos'
5353
| 'initia'
54-
| 'asi';
54+
| 'asi'
55+
| 'soneium';
5556
Size: 'small' | 'medium' | 'large';
5657
}
5758

@@ -2105,6 +2106,30 @@ export function CryptocurrencyIcon({
21052106
</g>
21062107
</svg>
21072108
);
2109+
case 'soneium':
2110+
return (
2111+
<svg
2112+
xmlns="http://www.w3.org/2000/svg"
2113+
width="32"
2114+
height="32"
2115+
viewBox="0 0 32 32"
2116+
>
2117+
<g id="surface1">
2118+
<path
2119+
fill="#FDFDFD"
2120+
d="M15.969-.055h.281c1.465.012 2.848.11 4.25.555.082.027.168.05.25.078 3.688 1.16 6.79 3.555 8.875 6.797.082.125.16.25.246.379 2.117 3.445 2.75 7.98 1.86 11.918C31 22.57 29.561 25.098 27.5 27.25l-.258.281c-2.453 2.598-6.316 4.375-9.887 4.516-.44.012-.882.012-1.324.008h-.281c-1.465-.012-2.848-.11-4.25-.555l-.25-.078c-3.687-1.16-6.79-3.555-8.875-6.797-.082-.125-.16-.25-.246-.379-2.117-3.445-2.75-7.98-1.86-11.918C1 9.43 2.439 6.902 4.5 4.75l.258-.281C7.618 1.445 11.87-.09 15.968-.055m0 0"
2121+
></path>
2122+
<path
2123+
fill="#010101"
2124+
d="M20.168 3.36c.152.046.3.093.457.14.094.027.184.059.281.086.11.05.11.05.219.102.086.039.168.074.254.117q.128.06.262.125.138.066.277.136c2.125 1.059 4.129 2.75 5.332 4.809l.133.219c1.777 2.969 2.387 6.547 1.55 9.93-.554 2.097-1.44 4.003-2.933 5.601-.094.098-.094.098-.187.2-1.665 1.765-3.512 2.902-5.79 3.722-.082.031-.164.058-.25.09-1.23.422-2.441.527-3.734.52q-.2 0-.406.003c-.758-.004-1.41-.066-2.133-.285.5-.602 1.027-1.168 1.582-1.723.074-.078.152-.152.234-.234.16-.16.32-.324.485-.484.246-.247.488-.493.734-.735.692-.691 1.375-1.379 2.121-2.012 1.762-1.519 3.578-3.382 4.305-5.648.027-.09.059-.176.086-.266.496-1.761.254-3.59-.547-5.21-1.047-1.829-2.473-2.965-4.477-3.626-1.156-.296-2.48-.343-3.648-.062.18-.414.41-.695.723-1.02q.14-.147.293-.3c.105-.11.21-.215.316-.328q.165-.165.328-.332.345-.354.692-.7.352-.358.699-.722.505-.521 1.015-1.035c.157-.16.157-.16.313-.329.82-.812.82-.812 1.414-.75m0 0"
2125+
></path>
2126+
<path
2127+
fill="#010101"
2128+
d="M16.094 2.719q.202.001.41-.004c.715.004 1.324.043 1.996.285-.633.77-1.328 1.473-2.035 2.176l-.598.597a34 34 0 0 1-1.863 1.754c-.559.493-1.086 1.02-1.613 1.543-.063.059-.121.121-.184.184-.934.93-1.766 1.867-2.457 2.996-.066.102-.129.207-.2.313-.16.265-.296.53-.425.812q-.058.128-.121.262c-.66 1.77-.324 3.96.426 5.64.996 1.864 2.566 3.016 4.53 3.688.747.21 1.47.203 2.243.183q.204-.002.418-.003.499-.007 1.004-.02c-.602.73-1.258 1.402-1.926 2.066l-.547.547c-.586.586-1.18 1.16-1.816 1.696-.309.28-.57.593-.832.918-.414.242-.813.136-1.254.023a7 7 0 0 1-.953-.43l-.262-.133c-3.277-1.73-5.62-4.527-6.746-8.062-1.039-3.426-.621-6.922 1-10.094 1.766-3.125 4.566-5.43 8.008-6.453 1.27-.344 2.48-.492 3.797-.484m0 0"
2129+
></path>
2130+
</g>
2131+
</svg>
2132+
);
21082133
default:
21092134
return null;
21102135
}

src/containers/BuildUnsignedSweepCoin/BuildUnsignedSweepCoin.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ function Form() {
139139
case 'toas':
140140
case 'coredao':
141141
case 'tcoredao':
142+
case 'soneium':
143+
case 'tsoneium':
142144
return (
143145
<EthLikeForm
144146
key={coin}

src/containers/NonBitGoRecoveryCoin/NonBitGoRecoveryCoin.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,8 @@ function Form() {
362362
case 'twemix':
363363
case 'xdc':
364364
case 'txdc':
365+
case 'soneium':
366+
case 'tsoneium':
365367
return (
366368
<EthereumForm
367369
key={coin}

src/helpers/config.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,16 @@ export const allCoinMetas: Record<string, CoinMetadata> = {
435435
Icon: 'cronos',
436436
value: 'cronos',
437437
},
438+
soneium: {
439+
Title: 'SONEIUM',
440+
Description: 'Soneium',
441+
Icon: 'soneium',
442+
value: 'soneium',
443+
ApiKeyProvider: 'etherscan.io',
444+
minGasLimit: '400,000',
445+
defaultGasLimit: '1,000,000',
446+
defaultGasLimitNum: 1000000,
447+
},
438448
suiToken: {
439449
Title: 'SUI Token',
440450
Description: 'Sui Token',
@@ -695,6 +705,16 @@ export const allCoinMetas: Record<string, CoinMetadata> = {
695705
Icon: 'sol',
696706
value: 'tsolToken',
697707
},
708+
tsoneium: {
709+
Title: 'TSONEIUM',
710+
Description: 'Testnet Soneium',
711+
Icon: 'soneium',
712+
value: 'tsoneium',
713+
ApiKeyProvider: 'etherscan.io',
714+
minGasLimit: '400,000',
715+
defaultGasLimit: '500,000',
716+
defaultGasLimitNum: 500000,
717+
},
698718
tpolygon: {
699719
Title: 'TPOLYGON',
700720
Description: 'Polygon Mumbai Testnet',
@@ -946,6 +966,7 @@ export const buildUnsignedSweepCoins: Record<
946966
allCoinMetas.oas,
947967
allCoinMetas.stx,
948968
allCoinMetas.sip10Token,
969+
allCoinMetas.soneium,
949970
] as const,
950971
test: [
951972
allCoinMetas.tbtc,
@@ -988,6 +1009,7 @@ export const buildUnsignedSweepCoins: Record<
9881009
allCoinMetas.toas,
9891010
allCoinMetas.tstx,
9901011
allCoinMetas.tsip10Token,
1012+
allCoinMetas.tsoneium,
9911013
] as const,
9921014
};
9931015

@@ -1054,6 +1076,7 @@ export const nonBitgoRecoveryCoins: Record<BitgoEnv, readonly CoinMetadata[]> =
10541076
allCoinMetas.initia,
10551077
allCoinMetas.stx,
10561078
allCoinMetas.sip10Token,
1079+
allCoinMetas.soneium,
10571080
] as const,
10581081
test: [
10591082
allCoinMetas.tbtc,
@@ -1110,6 +1133,7 @@ export const nonBitgoRecoveryCoins: Record<BitgoEnv, readonly CoinMetadata[]> =
11101133
allCoinMetas.tinitia,
11111134
allCoinMetas.tstx,
11121135
allCoinMetas.tsip10Token,
1136+
allCoinMetas.tsoneium,
11131137
] as const,
11141138
};
11151139

0 commit comments

Comments
 (0)