diff --git a/src/scripts/export/handlers/bank.ts b/src/scripts/export/handlers/bank.ts index 9aeef9f5..0955834d 100644 --- a/src/scripts/export/handlers/bank.ts +++ b/src/scripts/export/handlers/bank.ts @@ -114,9 +114,13 @@ export const bank: HandlerMaker = async ({ // Ignore decoding errors. } - // Try to decode as legacy Coin protobuf. + // Try to decode as legacy Coin protobuf, and ensure amount can be parsed + // as a bigint. Otherwise, ignore. The protobuf will decode (and not + // error) if the value is another protobuf, but `amount` will likely + // contain other data instead of a number. There's no way to ensure it's + // actually a coin protobuf, so this is the best we can do. try { - balance = Coin.decode(valueData).amount + balance = BigInt(Coin.decode(valueData).amount).toString() } catch { // Ignore decoding errors. }