Merge pull request #14767 from brave/brave_24824
Warmup Filecoin Ledger account before transaction
This commit is contained in:
@@ -122,6 +122,10 @@ export default class FilecoinLedgerKeyring implements LedgerFilecoinKeyring {
|
||||
Method: parsed.Method,
|
||||
Params: parsed.Params
|
||||
}
|
||||
|
||||
// Accounts must be warmed up before signing.
|
||||
await this.provider?.getAccounts()
|
||||
|
||||
const signed: SignedLotusMessage = await this.provider?.sign(parsed.From, lotusMessage)
|
||||
return { success: true, payload: signed }
|
||||
} catch (e) {
|
||||
|
||||
+12
-1
@@ -40,6 +40,17 @@ export interface Props {
|
||||
onClickInstructions: () => void
|
||||
}
|
||||
|
||||
function getAppName (coinType: BraveWallet.CoinType): string {
|
||||
switch (coinType) {
|
||||
case BraveWallet.CoinType.SOL:
|
||||
return 'Solana'
|
||||
case BraveWallet.CoinType.FIL:
|
||||
return 'Filecoin'
|
||||
default:
|
||||
return 'Ethereum'
|
||||
}
|
||||
}
|
||||
|
||||
export const ConnectHardwareWalletPanel = ({
|
||||
onCancel,
|
||||
walletName,
|
||||
@@ -60,7 +71,7 @@ export const ConnectHardwareWalletPanel = ({
|
||||
}
|
||||
|
||||
if (hardwareWalletCode === 'openLedgerApp') {
|
||||
let network = (coinType === BraveWallet.CoinType.SOL) ? 'Solana' : 'Ethereum'
|
||||
let network = getAppName(coinType)
|
||||
return getLocale('braveWalletConnectHardwarePanelOpenApp')
|
||||
.replace('$1', network)
|
||||
.replace('$2', walletName)
|
||||
|
||||
Reference in New Issue
Block a user