This repository was archived by the owner on Feb 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +12
-11
lines changed
Expand file tree Collapse file tree 3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,8 @@ program.parse();
7272 accountWithSigner
7373 . filter ( ( x ) => ! x . privateKey )
7474 . forEach ( ( x ) => {
75- const signer = defaultSigners . find ( ( y ) =>
76- equalSigner ( x . signer , y . signer )
75+ const signer = defaultSigners . find (
76+ ( y ) => x . signer && equalSigner ( x . signer , y . signer )
7777 ) ;
7878 if ( signer ) {
7979 x . privateKey = signer . privateKey ;
Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ import { Account } from "../../ui/pickAccounts";
33
44export const detect = async ( accounts : Account [ ] ) : Promise < string [ ] > => {
55 return accounts
6- . filter ( ( { version } ) => lt ( version , "0.2.1" ) )
6+ . filter ( ( { version } ) => version && lt ( version , "0.2.1" ) )
77 . map ( ( { address } ) => address ) ;
88} ;
Original file line number Diff line number Diff line change @@ -5,15 +5,15 @@ import { formatTokenBalanceShort } from "../tokenFormatting";
55export interface BaseAccount {
66 address : string ;
77 networkId : string ;
8- signer : string ;
9- version : string ;
8+ signer : string | null ;
9+ version : string | null ;
1010 privateKey ?: string ;
1111 derivationPath ?: string ;
1212}
1313
1414export interface Account extends BaseAccount {
1515 balances : { [ token : string ] : string } ;
16- implementation : string ;
16+ implementation : string | null ;
1717}
1818
1919interface PickAccountsOptions {
@@ -46,11 +46,12 @@ export async function pickAccounts(
4646 formatTokenBalanceShort ( account . balances , network )
4747 ) . filter ( ( [ , balance ] ) => balance !== "0.0" ) ;
4848 return {
49- title : `${ truncateAddress ( account . address ) } (Signer: ${ truncateHex (
50- account . signer
51- ) } , Implementation: ${ truncateAddress ( account . implementation ) } ${
52- balances . length ? ", " : ""
53- } ${ balances
49+ title : `${ truncateAddress ( account . address ) } (${
50+ account . signer && `Signer: ${ truncateHex ( account . signer ) } , `
51+ } ${
52+ account . implementation &&
53+ `Implementation: ${ truncateAddress ( account . implementation ) } `
54+ } ${ balances . length ? ", " : "" } ${ balances
5455 . map ( ( [ token , balance ] ) => `${ balance } ${ token } ` )
5556 . join ( ", " ) } )`,
5657 value : account . address ,
You can’t perform that action at this time.
0 commit comments