fix: the ETH line reads unknown at an address no refresh has read (closes #736)
An address's ETH balance is now null until a refresh has read it. That covers a new address, a new wallet, addresses a wallet scan finds, and every address after a network switch. Its line reads `quantity unknown`, Home's balance `unknown (ETH)`, and Send `Current balance: unknown (ETH)`. Max says the balance is unknown. Send is no longer refused as zero. The address has no total, and DeleteAddress warns that it may hold a balance. A refresh also deletes `balanceNotFetched` only when it read every address in the stored record. Model: opus-5-5
This commit was merged in pull request #741.
This commit is contained in:
@@ -190,7 +190,7 @@ async function importMnemonic(ctx) {
|
||||
{
|
||||
address: firstAddress,
|
||||
index: 0,
|
||||
balance: "0.0000",
|
||||
balance: null,
|
||||
tokenBalances: [],
|
||||
},
|
||||
],
|
||||
@@ -218,7 +218,7 @@ async function importMnemonic(ctx) {
|
||||
wallet.addresses = scan.addresses.map((a) => ({
|
||||
address: a.address,
|
||||
index: a.index,
|
||||
balance: "0.0000",
|
||||
balance: null,
|
||||
tokenBalances: [],
|
||||
}));
|
||||
wallet.nextIndex = scan.nextIndex;
|
||||
@@ -267,7 +267,7 @@ async function importPrivateKey(ctx) {
|
||||
type: "key",
|
||||
name: "Wallet " + walletNum,
|
||||
encryptedSecret: encrypted,
|
||||
addresses: [{ address: addr, balance: "0.0000", tokenBalances: [] }],
|
||||
addresses: [{ address: addr, balance: null, tokenBalances: [] }],
|
||||
});
|
||||
markTrackedTokensNotFetched();
|
||||
state.hasWallet = true;
|
||||
@@ -328,7 +328,7 @@ async function importXprvKey(ctx) {
|
||||
{
|
||||
address: firstAddress,
|
||||
index: 0,
|
||||
balance: "0.0000",
|
||||
balance: null,
|
||||
tokenBalances: [],
|
||||
},
|
||||
],
|
||||
@@ -356,7 +356,7 @@ async function importXprvKey(ctx) {
|
||||
wallet.addresses = scan.addresses.map((a) => ({
|
||||
address: a.address,
|
||||
index: a.index,
|
||||
balance: "0.0000",
|
||||
balance: null,
|
||||
tokenBalances: [],
|
||||
}));
|
||||
wallet.nextIndex = scan.nextIndex;
|
||||
|
||||
Reference in New Issue
Block a user