From 84e26e26ad134f359234fa110e7db8a4f435a513 Mon Sep 17 00:00:00 2001 From: liangping <18786721@qq.com> Date: Tue, 26 Dec 2023 09:18:04 +0800 Subject: [PATCH] improve incompatible events display --- src/modules/[chain]/account/[address].vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/[chain]/account/[address].vue b/src/modules/[chain]/account/[address].vue index 6f94f33a..efb7e027 100644 --- a/src/modules/[chain]/account/[address].vue +++ b/src/modules/[chain]/account/[address].vue @@ -122,6 +122,13 @@ function loadAccount(address: string) { function updateEvent() { loadAccount(props.address); } + +function mapAmount(events:{type: string, attributes: {key: string, value: string}[]}[]) { + if(!events) return [] + return events.find(x => x.type==='coin_received')?.attributes + .filter(x => x.key === 'YW1vdW50'|| x.key === `amount`) + .map(x => x.key==='amount'? x.value : String.fromCharCode(...fromBase64(x.value))) +}