@@ -29,7 +29,12 @@ import { Dash } from '@bitgo/sdk-coin-dash';
2929import { Doge , Tdoge } from '@bitgo/sdk-coin-doge' ;
3030import { Dot , Tdot } from '@bitgo/sdk-coin-dot' ;
3131import { Eos , Teos } from '@bitgo/sdk-coin-eos' ;
32- import { AbstractEthLikeNewCoins , Erc20Token , Eth , Hteth } from '@bitgo/sdk-coin-eth' ;
32+ import {
33+ AbstractEthLikeNewCoins ,
34+ Erc20Token ,
35+ Eth ,
36+ Hteth ,
37+ } from '@bitgo/sdk-coin-eth' ;
3338import { Ethw } from '@bitgo/sdk-coin-ethw' ;
3439import { Etc , Tetc } from '@bitgo/sdk-coin-etc' ;
3540import { Ltc } from '@bitgo/sdk-coin-ltc' ;
@@ -56,6 +61,7 @@ import { Hbar, Thbar } from '@bitgo/sdk-coin-hbar';
5661import { Algo , Talgo } from '@bitgo/sdk-coin-algo' ;
5762import { EthLikeCoin , TethLikeCoin } from '@bitgo/sdk-coin-ethlike' ;
5863import { Sui , Tsui } from '@bitgo/sdk-coin-sui' ;
64+ import { loadWebAssembly } from '@bitgo/sdk-opensslbytes' ;
5965
6066const bip32 = BIP32Factory ( ecc ) ;
6167
@@ -303,10 +309,17 @@ async function createWindow() {
303309 const baseCoin = sdk . coin ( coin ) as AbstractEthLikeNewCoins ;
304310 if ( parameters . ethCommonParams ) {
305311 parameters . common = EthereumCommon . custom ( {
306- ...parameters . ethCommonParams
312+ ...parameters . ethCommonParams ,
307313 } ) ;
308314 }
309- return await baseCoin . recover ( parameters ) ;
315+ const openSSLBytes = loadWebAssembly ( ) . buffer ;
316+ return await baseCoin . recover (
317+ {
318+ ...parameters ,
319+ openSSLBytes,
320+ } ,
321+ openSSLBytes
322+ ) ;
310323 } ) ;
311324
312325 ipcMain . handle ( 'broadcastTransaction' , async ( event , coin , parameters ) => {
@@ -455,22 +468,17 @@ async function createWindow() {
455468 return response ;
456469 } ) ;
457470
458- ipcMain . handle (
459- 'sweepV1' ,
460- async ( event , coin , parameters ) => {
461- switch ( coin ) {
462- case 'btc' :
463- case 'tbtc' : {
464- const coinInstance = sdk . coin ( coin ) as AbstractUtxoCoin ;
465- return await coinInstance . sweepV1 ( parameters ) ;
466- }
467- default :
468- return new Error (
469- `Coin: ${ coin } does not support v1 wallets sweep`
470- ) ;
471+ ipcMain . handle ( 'sweepV1' , async ( event , coin , parameters ) => {
472+ switch ( coin ) {
473+ case 'btc' :
474+ case 'tbtc' : {
475+ const coinInstance = sdk . coin ( coin ) as AbstractUtxoCoin ;
476+ return await coinInstance . sweepV1 ( parameters ) ;
471477 }
478+ default :
479+ return new Error ( `Coin: ${ coin } does not support v1 wallets sweep` ) ;
472480 }
473- ) ;
481+ } ) ;
474482}
475483
476484void app . whenReady ( ) . then ( createWindow ) ;
0 commit comments