const { fromRandom } = require('@ocap/wallet');
const Client = require('../lib/node');

const client = new Client('http://127.0.0.1:56611');

client.subscribe('tx.create', (tx) => {
  console.log('tx.create', tx);
});

console.log('socketEndpoint', client.config.socketEndpoint());
client._socketClient.on('error', console.error);

const user = fromRandom();
client.declare({ moniker: 'user', wallet: user }).then((hash) => console.log('declared', hash));
