Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@acuris/eventstore-api
Advanced tools
Based on
Reading a stream:
async function listTransactionHistory(transactionId: string, eventSource: EventSource): Promise<{timestamp: Date, data: Transaction}> {
return lastValueFrom(
eventSource.streamReader.readStreamForwards({category: "transaction", id: transactionId})
.pipe(toArray(), map(re => ({timestamp: re.event.timestamp, data: re.event.data as Transaction})))
)
}
Reading entire store:
return new Promise(((resolve, reject) => {
let lastPosition = position
eventSource.storeReader.readAll(position).subscribe(
re => {
ingestTransaction(re.event.data as Transaction)
lastPosition = re.position
},
err => reject("Failed to read all transactions since " + lastPosition + ": " + err),
() => resolve(lastPosition)
)
}))
Recommend you use prettier
for formatting so that we have a consistent code style.
If you are using IntelliJ then install the Prettier plugin. You can config it to run when you normally run format (see
Languages & Frameworks > Javascript > Prettier
and check "Run on 'Reformat Code' action")
FAQs
API for accessing event stores
We found that @acuris/eventstore-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.