Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
dfuse-eoshttp-js
Advanced tools
Using Yarn:
yarn add dfuse-eoshttp-js
or using NPM:
npm install --save dfuse-eoshttp-js
CommonJS
const { JsonRpc } = require("dfuse-eoshttp-js")
const fetch = require("isomorphic-fetch")
const endpoint = "https://mainnet.eos.dfuse.io"
const token = "<Paste your API token here>"
const rpc = new JsonRpc(endpoint, { fetch, token })
TypeScript
import { JsonRpc } from "dfuse-eoshttp-js"
import fetch from "isomorphic-fetch"
const endpoint = "https://mainnet.eos.dfuse.io"
const token = "<Paste your API token here>"
const rpc = new JsonRpc(endpoint, { fetch, token })
DFUSE_ENDPOINT=<Enter Dfuse Endpoint> # "https://mainnet.eos.dfuse.io"
DFUSE_API_KEY=<Paste your API token here> # Get key at dfuse.io
DFUSE_SERVER_API_KEY=<Paste your Server API token here> # Get key at dfuse.io
Search an EOSIO blockchain for transactions based on free-form criterias, using the simple dfuse Search query language.
const searchQuery = 'receiver:eosio.token action:transfer data.to:eoscafeblock'
rpc.search_transactions(searchQuery, { limit: 1 }).then(response => {
console.log(response)
})
Fetches the ABI for a given contract account, at any block height.
rpc.state_abi('eosio', { block_num: 128, json: true }).then(response => {
console.log(response)
})
Fetches the ABI for a given contract account, at any block height.
rpc.state_abi_bin_to_json('eosio.token', 'accounts', { block_num: 2500000, "hex_rows":["aa2c0b010000000004454f5300000000"] }).then(response => {
console.log(response)
})
Fetches snapshots of any account's linked authorizations on the blockchain, at any block height.
rpc.state_permission_links('eoscanadacom', { block_num: 10000000 }).then(response => {
console.log(response)
})
Fetches the state of any table, at any block height.
rpc.state_table("eosio.token", "b1", "accounts", {json: true}).then(response => {
for (const row of response.rows) {
console.log(row.json.balance)
//=> 12.2873 EOS
}
})
Fetches a table for a given contract account for a group of scopes, at any block height.
rpc.state_tables_accounts<{balance: string}>(["eosio.token", "eosadddddddd", "tokenbyeocat"], "b1", "accounts", {block_num: 25000000, json: true}).then(response => {
console.dir(response, { depth: null })
})
Fetches a table for a given contract account for a group of scopes, at any block height.
rpc.state_tables_scopes("eosio.token", ["b1", "eosio.null"], "accounts", {json: true}).then(response => {
for (const table of response.tables) {
for (const row of table.rows) {
console.log(row.json.balance)
//=> 12.2873 EOS
//=> 0.0084 EOS
}
}
})
Issues Dfuse API Key using a Server Token
rpc.auth_issue(server_token).then(response => {
console.log(response)
})
FAQs
dfuse.io HTTP API Javascript library
The npm package dfuse-eoshttp-js receives a total of 8 weekly downloads. As such, dfuse-eoshttp-js popularity was classified as not popular.
We found that dfuse-eoshttp-js 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.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.