Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onMessage(data) {
try {
if (!this.abi) {
this.abi = JSON.parse(data);
this.types = Serialize.getTypesFromAbi(Serialize.createInitialTypes(), this.abi);
for (const table of this.abi.tables)
this.tables.set(table.name, table.type);
if (this.receivedAbi)
this.receivedAbi();
} else {
const [type, response] = this.deserialize('result', data);
this[type](response);
}
} catch (e) {
console.log(e);
process.exit(1);
}
}
constructor() {
const rpc = new JsonRpc(null)
const signatureProvider = new JsSignatureProvider([])
this.api = new EosApi({
rpc,
signatureProvider,
chainId: null,
})
this.api.transactionTypes = Serialize.getTypesFromAbi(Serialize.createInitialTypes(), assertAbi)
}