diff --git a/quickstart/example/html/MonitorExample.html b/quickstart/example/html/MonitorExample.html index 14705ca..79ee4f4 100644 --- a/quickstart/example/html/MonitorExample.html +++ b/quickstart/example/html/MonitorExample.html @@ -15,6 +15,11 @@

1. monitor block

+

+

+
+
+

diff --git a/quickstart/example/js/MonitorExample.ts b/quickstart/example/js/MonitorExample.ts index 22834c9..8a1596e 100644 --- a/quickstart/example/js/MonitorExample.ts +++ b/quickstart/example/js/MonitorExample.ts @@ -37,10 +37,15 @@ class MonitorExample { } async startMonitorBlock() { + const url = getInputValue('M01-url'); + const addr = getInputValue('M01-addr'); + const event = getInputValue('M01-event'); + const provider: HttpProvider = new HttpProvider(url); + this.iconService = new IconService(provider); const block = await this.iconService.getLastBlock().execute(); const height = block.height; - const spec = new BlockMonitorSpec(Converter.toBigNumber(height + 1), - [new EventFilter("ICXIssued(int,int,int,int)", "cx0000000000000000000000000000000000000000")], true); + const eventFilter = new EventFilter(event, addr); + const spec = new BlockMonitorSpec(Converter.toBigNumber(height + 1), [eventFilter], true); const onevent = (data: BlockNotification) => { document.getElementById("M01-3").innerHTML = JSON.stringify(data); }