Skip to content

Commit

Permalink
feat: adding non-bitgo recovery support for coredao and oas
Browse files Browse the repository at this point in the history
Ticket: WIN-4290
  • Loading branch information
parasgarg-bitgo committed Jan 30, 2025
1 parent 480c0a2 commit d67e372
Show file tree
Hide file tree
Showing 7 changed files with 148 additions and 2 deletions.
14 changes: 14 additions & 0 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Atom, Tatom } from '@bitgo/sdk-coin-atom';
import { Arbeth, Tarbeth, ArbethToken } from '@bitgo/sdk-coin-arbeth';
import { Bld, Tbld } from '@bitgo/sdk-coin-bld';
import { Coreum, Tcoreum } from '@bitgo/sdk-coin-coreum';
import { Coredao, Tcoredao } from '@bitgo/sdk-coin-coredao';
import { Hash, Thash } from '@bitgo/sdk-coin-hash';
import { Injective, Tinjective } from '@bitgo/sdk-coin-injective';
import { Sei, Tsei } from '@bitgo/sdk-coin-sei';
Expand Down Expand Up @@ -39,6 +40,7 @@ import { Ethw } from '@bitgo/sdk-coin-ethw';
import { Etc, Tetc } from '@bitgo/sdk-coin-etc';
import { Ltc } from '@bitgo/sdk-coin-ltc';
import { Near, TNear } from '@bitgo/sdk-coin-near';
import { Oas, Toas } from '@bitgo/sdk-coin-oas';
import { Opeth, Topeth, OpethToken } from '@bitgo/sdk-coin-opeth';
import { Osmo, Tosmo } from '@bitgo/sdk-coin-osmo';
import { Polygon, Tpolygon, PolygonToken } from '@bitgo/sdk-coin-polygon';
Expand Down Expand Up @@ -156,6 +158,10 @@ sdk.register('sui', Sui.createInstance);
sdk.register('tsui', Tsui.createInstance);
sdk.register('thorchain:rune', Rune.createInstance);
sdk.register('tthorchain:rune', Trune.createInstance);
sdk.register('coredao', Coredao.createInstance);
sdk.register('tcoredao', Tcoredao.createInstance);
sdk.register('oas', Oas.createInstance);
sdk.register('toas', Toas.createInstance);

Erc20Token.createTokenConstructors().forEach(({ name, coinConstructor }) => {
sdk.register(name, coinConstructor);
Expand Down Expand Up @@ -286,6 +292,14 @@ async function createWindow() {
case 'tarbethToken':
sdk = new BitGoAPI({ env: environment, arbiscanApiToken: apiKey });
break;
case 'coredao':
case 'tcoredao':
sdk = new BitGoAPI({ env: environment, coredaoExplorerApiToken: apiKey });
break;
case 'oas':
case 'toas':
sdk = new BitGoAPI({ env: environment, oasExplorerApiToken: apiKey });
break;
case 'opeth':
case 'topeth':
case 'opethToken':
Expand Down
30 changes: 30 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@bitgo/sdk-coin-btc": "2.4.8",
"@bitgo/sdk-coin-btg": "2.1.8",
"@bitgo/sdk-coin-coreum": "21.0.27",
"@bitgo/sdk-coin-coredao": "1.2.10",
"@bitgo/sdk-coin-dash": "2.1.8",
"@bitgo/sdk-coin-doge": "2.1.8",
"@bitgo/sdk-coin-dot": "4.1.36",
Expand All @@ -38,6 +39,7 @@
"@bitgo/sdk-coin-injective": "3.0.27",
"@bitgo/sdk-coin-ltc": "3.1.8",
"@bitgo/sdk-coin-near": "2.0.58",
"@bitgo/sdk-coin-oas": "1.1.11",
"@bitgo/sdk-coin-opeth": "18.1.43",
"@bitgo/sdk-coin-osmo": "3.0.27",
"@bitgo/sdk-coin-polygon": "21.0.27",
Expand Down
4 changes: 3 additions & 1 deletion scripts/build-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const coins = [
'algo',
'bsc',
'sui',
'thorchain:rune'
'thorchain:rune',
'coredao',
'oas'
];

const paths = fs
Expand Down
44 changes: 43 additions & 1 deletion src/components/CryptocurrencyIcon/CryptocurrencyIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface CryptocurrencyIconProps {
| 'bsv'
| 'btc'
| 'btg'
| 'coredao'
| 'coreum'
| 'dash'
| 'doge'
Expand All @@ -22,6 +23,7 @@ export interface CryptocurrencyIconProps {
| 'injective'
| 'ltc'
| 'near'
| 'oas'
| 'opeth'
| 'osmo'
| 'polygon'
Expand Down Expand Up @@ -1824,7 +1826,47 @@ export function CryptocurrencyIcon({
</style>
<use id="Background" href="#img1" x="0" y="0" />
</svg>
)
);
case 'coredao':
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="32"
height="32"
version="1.2"
viewBox="0 0 32 32"
>
<defs>
<image
id="img2"
width="32"
height="32"
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAAAXNSR0IB2cksfwAAADNQTFRFEhIS/5IR4YIRa0ISiVIRTTISMCISIRoSpmISpmIReUoSiFISPyoS8IoRxHIRw3IS4YISJZADBQAAAWpJREFUeJztlttuwyAMhiFLuqqt+v6PuantqvWwbCGYgE8BIu1iCxcV4N8fJgVsaxY2uwL+A8Cafgmgcd4qQgWAsXlWAWKTHIQIwAYJIQBaCLq9BwWP4AGJ0+buBy+PTABZUwuCAli1jMCA15vvdDdeaL9UAF5p+Ji+u/1k0ZYdpJvfXgUzBuyu1L13v7AoqCNCDNh/OMwldk97oNcA3ub+fNAdLtPA5gGsoTsdr1QWALvHyEwAPgVO2hdEMHN96wDts2ALFFD4DTCgexizBOBVtYDkDlQAJskK+F0AL8kGDEl5SqgVgBQRJIdTPgA/iSYdqY8qQcTvaHQpGEDISt4+7OMnoVqI3t9JGUDzlx0Tw+jOZzeU2hpgh330/i2U8ivJzoLueGKn2fqAixTmju/igtwkPgnUPavE0YskqUqbjt9Zc1fKvA5VVIVl3tBCdaa4qwC2nigDjOb9eU6htc3ubX6JRW0F/AnANwm/tUGfnIZxAAAAAElFTkSuQmCC"
></image>
</defs>
<use id="Background" x="0" y="0" href="#img2"></use>
</svg>
);
case 'oas':
return (
<svg
xmlns="http://www.w3.org/2000/svg"
width="32"
height="32"
version="1.2"
viewBox="0 0 32 32"
>
<defs>
<image
id="img1"
width="32"
height="32"
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEU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/9dLF9htHlsXjosEzySovd8q1b+UMXU9SZoHyLdh98RSOR24A+So+ARDU+ooBkJDm9tZfvlfhr5czhVSd2VdddysxAGyJ2/hvxWSie/Lrf39p8PsP1gQGjrOeR9wAAAAASUVORK5CYII="
></image>
</defs>
<use id="Background" x="0" y="0" href="#img1"></use>
</svg>
);
default:
return null;
}
Expand Down
4 changes: 4 additions & 0 deletions src/containers/NonBitGoRecoveryCoin/NonBitGoRecoveryCoin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ function Form() {
case 'tetc':
case 'arbeth':
case 'tarbeth':
case 'coredao':
case 'tcoredao':
case 'oas':
case 'toas':
case 'opeth':
case 'topeth':
case 'polygon':
Expand Down
52 changes: 52 additions & 0 deletions src/helpers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,28 @@ export const allCoinMetas: Record<string, CoinMetadata> = {
defaultGasLimit: '1,000,000',
defaultGasLimitNum: 1000000,
},
coredao: {
Title: 'COREDAO',
Description: 'Core BlockChain',
Icon: 'coredao',
value: 'coredao',
isTssSupported: true,
ApiKeyProvider: 'scan.coredao.org',
minGasLimit: '400,000',
defaultGasLimit: '1,000,000',
defaultGasLimitNum: 1000000,
},
oas: {
Title: 'OAS',
Description: 'Oasys BlockChain',
Icon: 'oas',
value: 'oas',
isTssSupported: true,
ApiKeyProvider: 'explorer.oasys.games',
minGasLimit: '400,000',
defaultGasLimit: '1,000,000',
defaultGasLimitNum: 1000000,
},
opeth: {
Title: 'OPETH',
Description: 'Optimism',
Expand Down Expand Up @@ -449,6 +471,28 @@ export const allCoinMetas: Record<string, CoinMetadata> = {
defaultGasLimit: '500,000',
defaultGasLimitNum: 500000,
},
tcoredao: {
Title: 'TCOREDAO',
Description: 'Testnet Core BlockChain',
Icon: 'coredao',
value: 'tcoredao',
isTssSupported: true,
ApiKeyProvider: 'scan.test.btcs.network',
minGasLimit: '400,000',
defaultGasLimit: '1,000,000',
defaultGasLimitNum: 1000000,
},
toas: {
Title: 'TOAS',
Description: 'Testnet Oasys BlockChain',
Icon: 'oas',
value: 'toas',
isTssSupported: true,
ApiKeyProvider: 'explorer.testnet.oasys.games',
minGasLimit: '400,000',
defaultGasLimit: '1,000,000',
defaultGasLimitNum: 1000000,
},
topeth: {
Title: 'TOPETH',
Description: 'Testnet Optimism Ethereum',
Expand Down Expand Up @@ -674,6 +718,8 @@ export const buildUnsignedSweepCoins: Record<
allCoinMetas.avaxcToken,
allCoinMetas.arbeth,
allCoinMetas.arbethToken,
allCoinMetas.coredao,
allCoinMetas.oas,
allCoinMetas.opeth,
allCoinMetas.opethToken,
allCoinMetas.polygon,
Expand Down Expand Up @@ -705,6 +751,8 @@ export const buildUnsignedSweepCoins: Record<
allCoinMetas.tavaxcToken,
allCoinMetas.tarbeth,
allCoinMetas.tarbethToken,
allCoinMetas.tcoredao,
allCoinMetas.toas,
allCoinMetas.topeth,
allCoinMetas.topethToken,
allCoinMetas.tpolygon,
Expand Down Expand Up @@ -744,6 +792,8 @@ export const nonBitgoRecoveryCoins: Record<BitgoEnv, readonly CoinMetadata[]> =
allCoinMetas.avaxcToken,
allCoinMetas.arbeth,
allCoinMetas.arbethToken,
allCoinMetas.coredao,
allCoinMetas.oas,
allCoinMetas.opeth,
allCoinMetas.opethToken,
allCoinMetas.near,
Expand Down Expand Up @@ -786,6 +836,8 @@ export const nonBitgoRecoveryCoins: Record<BitgoEnv, readonly CoinMetadata[]> =
allCoinMetas.tavaxcToken,
allCoinMetas.tarbeth,
allCoinMetas.tarbethToken,
allCoinMetas.tcoredao,
allCoinMetas.toas,
allCoinMetas.topeth,
allCoinMetas.topethToken,
allCoinMetas.tnear,
Expand Down

0 comments on commit d67e372

Please sign in to comment.