2019-09-25 12:41:21 +00:00
|
|
|
const Web3Eth = require('web3-eth');
|
2019-09-27 20:04:01 +00:00
|
|
|
const Subspace = require('../dist/node.js');
|
2019-09-25 12:41:21 +00:00
|
|
|
|
2019-09-27 20:04:01 +00:00
|
|
|
let eth = new Web3Eth("wss://mainnet.infura.io/ws/v3/_____________");
|
2019-09-25 12:41:21 +00:00
|
|
|
|
2019-09-27 20:04:01 +00:00
|
|
|
async function run() {
|
|
|
|
const subspace = new Subspace(eth.currentProvider);
|
|
|
|
await subspace.init()
|
2019-09-25 12:41:21 +00:00
|
|
|
|
|
|
|
// Testing single block with a event
|
2019-09-27 20:04:01 +00:00
|
|
|
subspace.trackLogs({address: "0x744d70fdbe2ba4cf95131626614a1763df805b9e", topics: ["0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925", "0x00000000000000000000000068f47e166e1aa7d6529e021feff86eada87aaee3", null]}).subscribe((v) => {
|
2019-09-25 12:41:21 +00:00
|
|
|
console.log(v);
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
run()
|