Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@horizon-protocol/data
Advanced tools
This is a collection of utilities to query Horizon data from BSC. This data has been indexed by The Graph via the various subgraphs the Horizon team maintains ([the subgraph code repo](https://github.com/Horizon-Protocol/horizon-subgraph)).
This is a collection of utilities to query Horizon data from BSC. This data has been indexed by The Graph via the various subgraphs the Horizon team maintains (the subgraph code repo).
The below all return a Promise that resolves with the requested results.
depot.userActions({ user })
Get all depot deposit (zUSD
) actions for the given user - deposit
, withdrawl
, unaccepted
, removed
.depot.clearedDeposits({ fromAddress, toAddress })
Get all cleared zasset deposits (payments of ETH
for zUSD
) either from a given fromAddress
or (and as well as) to a given toAddress
depot.exchanges({ from })
Get all depot exchanges (buying zUSD with ETH) for a given from
address.exchanges.total()
Get the total exchange volume, total fees and total number of unique exchange addresses.exchanges.rebates({ minTimestamp = 1 day ago })
Get the last N
exchange rebates since the given minTimestamp
in seconds. Ordered in reverse chronological order.exchanges.reclaims({ minTimestamp = 1 day ago })
Get the last N
exchange reclaims since the given minTimestamp
in seconds. Ordered in reverse chronological order.exchanges.since({ minTimestamp = 1 day ago })
Get the last N
exchanges since the given minTimestamp
(in seconds, so one hour ago is 3600
). These are ordered in reverse chronological order.rate.updates
Get all rate updates for zassets in reverse chronological orderzassets.issuers
Get all wallets that have invoked Issue
on zUSD
(other zassets to come)zassets.transfers
Get zasset transfers in reverse chronological orderzassets.holders
Get all potential zasset holdershzn.holders
Get the list of wallets that have ever sent or received HZN
.hzn.rewards
Get the list of reward escrow holders and their latest balance at vesting entry add or vest.hzn.total
Get the total count of unique issuers
and hznHolders
hzn.transfers
Get HZN transfers in reverse chronological orderhzn.issued
Get the Issued
events in reverse chronological order.hzn.burned
Get the Burned
events in reverse chronological order.hzn.feesClaimed
Get the FeesClaimed
events in reverse chronological order, showing fees in zUSD and rewards in hzn.hzn.debtSnapshot
Get the historical debt balance for any wallet address.binaryOptions.markets
Get all the binary options markets created.binaryOptions.optionTransactions
Get all the Bid and Refund transactions made to the binary options markets.binaryOptions.historicalOptionPrice
Get historical records of every option price for every market.etherCollateral.loans
Get the list of all EtherCollateral loans opened.exchanger.exchangeEntriesSettled({ max, from })
Get the list of all settled exchanges.exchanges.aggregate({ max, timeSeries })
Get the total amount of exchanges aggregated across various time series.rate.hznAggregate({ max, timeSeries })
Get the price of hzn aggregated across various time series.hzn.aggregateActiveStakers({ max, timeSeries })
Get the number of active stakers across various time series.hzn.totalActiveStakers()
Get the current number of active stakers.rate.dailyRateChange({ zassets })
get the rate change over the past 24 hours for any zasset. Can pass in a list to retrieve multiple zassets.liquidations.accountsRemovedFromLiquidation({ maxTime, minTime, account, max })
finds all the accounts that have fixed their c-ratio to avoid being at risk of liquidation after being flagged.liquidations.accountsFlaggedForLiquidation({ minTime, maxTime, account, max })
finds all the accounts that have been flagged for liquidation.liquidations.accountsLiquidated({ maxTime, minTime, account, max })
finds all the accounts that have been liquidated after being flagged for liquidation.liquidations.getActiveLiquidations({ max, account, minTime, maxTime })
finds all the accounts that have been flagged and are still pending liquidation or in a waiting state. Can also just check for a specific account if desired.The below all return an Observable that when subscribed to with an object.
exchanges.observe()
Get an observable to subscribe
to that will next
the latest exchanges in real time (replays the most recent exchange immediately).rate.observe()
Get an observable to subscribe
to that will next
the latest rates in real time (replays the most recent exchange immediately).const hznData = require('horizon-data'); // common js
// or
import hznData from 'horizon-data'; // es modules
// query and log resolved results
hznData.exchanges
.since({
minTimestamp: Math.floor(Date.now() / 1e3) - 3600 * 24, // one day ago
})
.then(exchanges => console.log(exchanges));
// subscribe and log streaming results
hznData.exchanges.observe().subscribe({
next(val) {
console.log(val);
},
error: console.error,
complete() {
console.log('done');
},
});
<script src="//cdn.jsdelivr.net/npm/horizon-data/browser.js"></script>
<script>
window.hznData.exchanges
.since({
minTimestamp: Math.floor(Date.now() / 1e3) - 3600 * 24, // one day ago
})
.then(console.log);
window.hznData.exchanges.observe().subscribe({ next: console.log });
</script>
# get last 24 hours of exchange activity, ordered from latest to earliest
npx horizon-data exchanges.since
# get exchanges on horizon as they occur in real time (replays the last exchange first)
npx horizon-data exchanges.subscribe
FAQs
This is a collection of utilities to query Horizon data from BSC. This data has been indexed by The Graph via the various subgraphs the Horizon team maintains ([the subgraph code repo](https://github.com/Horizon-Protocol/horizon-subgraph)).
The npm package @horizon-protocol/data receives a total of 0 weekly downloads. As such, @horizon-protocol/data popularity was classified as not popular.
We found that @horizon-protocol/data demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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 found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.