Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavidhingra committed Aug 19, 2024
2 parents f70bd18 + 6a52e83 commit fb3f37b
Show file tree
Hide file tree
Showing 13 changed files with 527 additions and 334 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
env:
NEXT_VERSION: "${{ inputs.next-version }}"
outputs:
dmg_filename: "Wallet Recovery Wizard-${{ inputs.next-version }}.dmg"
dmg_filename: "Wallet Recovery Wizard-${{ inputs.next-version }}-arm64.dmg"
exe_filename: "Wallet Recovery Wizard-Setup-${{ inputs.next-version }}.exe"
deb_filename: "Wallet Recovery Wizard-Linux-${{ inputs.next-version }}.deb"
steps:
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
mac-build:
name: Create Mac release
runs-on: macos-12
runs-on: macos-14
needs:
- get-current-state
env:
Expand Down
14 changes: 12 additions & 2 deletions electron/main/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TrxConsolidationRecoveryOptions } from '../types';
import EthereumCommon from '@ethereumjs/common';

process.env.DIST_ELECTRON = join(__dirname, '../..');
process.env.DIST = join(process.env.DIST_ELECTRON, '../dist');
Expand Down Expand Up @@ -28,7 +29,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, Hteth } from '@bitgo/sdk-coin-eth';
import { AbstractEthLikeNewCoins, 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 All @@ -53,6 +54,7 @@ import * as ecc from 'tiny-secp256k1';
import { Hbar, Thbar } from '@bitgo/sdk-coin-hbar';
import { Algo, Talgo } from '@bitgo/sdk-coin-algo';
import { Sui, Tsui } from '@bitgo-beta/sdk-coin-sui';
import { EthLikeCoin, TethLikeCoin } from '@bitgo/sdk-coin-ethlike';

const bip32 = BIP32Factory(ecc);

Expand Down Expand Up @@ -140,6 +142,9 @@ sdk.register('algo', Algo.createInstance);
sdk.register('talgo', Talgo.createInstance);
sdk.register('sui', Sui.createInstance);
sdk.register('tsui', Tsui.createInstance);
sdk.register('baseeth', EthLikeCoin.createInstance);
sdk.register('tbaseeth', TethLikeCoin.createInstance);

Erc20Token.createTokenConstructors().forEach(({ name, coinConstructor }) => {
sdk.register(name, coinConstructor);
});
Expand Down Expand Up @@ -292,7 +297,12 @@ async function createWindow() {
);

ipcMain.handle('recover', async (event, coin, parameters) => {
const baseCoin = sdk.coin(coin) as AbstractUtxoCoin;
const baseCoin = sdk.coin(coin) as AbstractEthLikeNewCoins;
if (parameters.ethCommonParams) {
parameters.common = EthereumCommon.custom({
...parameters.ethCommonParams
});
}
return await baseCoin.recover(parameters);
});

Expand Down
5 changes: 5 additions & 0 deletions electron/preload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ import {
SuiRecoveryConsolidationRecoveryOptions,
} from '../types';

import type * as EthLikeCommon from '@ethereumjs/common';
import { EvmCcrNonBitgoCoinConfigType } from '../../src/helpers/config';

type User = { username: string };

type Commands = {
Expand Down Expand Up @@ -102,6 +105,8 @@ type Commands = {
};
tokenContractAddress?: string;
startingScanIndex?: number;
common?: EthLikeCommon.default;
ethCommonParams?: EvmCcrNonBitgoCoinConfigType | undefined;
}
): Promise<BackupKeyRecoveryTransansaction | FormattedOfflineVaultTxInfo>;
wrongChainRecover(
Expand Down
Loading

0 comments on commit fb3f37b

Please sign in to comment.