Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@appchain/plugin
Advanced tools
Promise based [CITA RPC](https://docs.nervos.org/cita/#/rpc_guide/rpc) toolkit.
Promise based CITA RPC toolkit.
$ yarn add @appchain/plugin
import appchainPlugin from '@appchain/plugin'
const SERVER = 'localhost:1337'
const { appchain } = appchainPlugin({ server: SERVER })
/**
* @function metadata
* @description request metadata of specified chain
* @param {{blockNumber}}
* @return {Metadata}
*/
appchain.metadata({ blockNumer: '0x0' }).then(metadata => console.log(metadata))
/**
* @function netPeerCount
* @description request net peer count
* @param null
* @returns {string} peerCount
*/
appchain.netPeerCount().then(count => console.log(count))
/**
* @function getBlockByNumber
* @description request block by block number
* @param {string} quantity - quantity is the current block height of CITA
* @param {boolean} detialed - return transaction list if true, otherwise return hash of transaction
* @returns {object} block
*/
appchain
.getBlockByNumber({
quantity: blockNumber,
detailed: true,
})
.then(block => console.log(block))
/**
* @function getBlockByHash
* @description request block by block hash
* @param {string} hash - block hash
* @param {boolean} detailed - return transaction list if true, otherwise return hash of transaction
* @returns {object} block
*/
appchain
.getBlockByHash({
hash: blockHash,
detailed: true,
})
.then(block => console.log(block))
/**
* @function getBlockHistory
* @description retrieve blocks of height from (by - count + 1) to by
* @param {by: string, count: number} - by: the startpoint of history, count: the count of records to retrieve
* @return {array} list of block
*/
appchain
.getBlockHistory({
by: '0x4bb99',
count: 5,
})
.then(blocks => console.log(blocks))
/**
* @function getTransaction
* @description request transaction detail
* @param {string} transactionHash
* @return {object} Transaction
*/
appchain.getTransaction('0x...').then(transaction => console.log(transaction))
/**
* @function getLogs
* @description requestion log on specified block
* @param {{topics: Topic[]}}
* @return {object} Logs
*/
appchain.getLogs({ topics: [] }).then(logs => console.log(logs))
/**
* @function getBalance
* @description get balance of specified address
* @param {{addr}} - addr: specified address
* @return {Balance}
*/
appchain.getBalance({ addr: '0x...' }).then(balance => console.log(balance))
/**
* @function getTransactionCount
* @description get transaction count of specified addr
* @param {{addr, blockNumber}}
* @return {TransactionCount}
*/
appchain.getTransactionCount({ addr: '0x..', blockNumber: 'latest' }).then(count => console.log(count))
/**
* @function getTransactionProof
* @description get transaction proof of specified transaction hash
* @param {string} trasnactionHash
* @return {string} transaction proof
*/
appchain.getTransactionProof('0x...').then(proof => console.log(proof))
/**
* @function newFilter
* @desc create new filter
* @param {Array<topic>} topics
* @return {string} filterId
*/
appchain.newFilter([])
/**
* @function newBlockFilter
* @desc create new block filter
* @param None
* @return {string} filterId
*/
appchain.newBlockFilter()
/**
* @function uninstallFilter
* @desc uninstall filter
* @param {string} filterId
* @return {boolean} success
*/
appchain.uninstallFilter(id)
/**
* @function getFilterChanges
* @desc get filter changes
* @param {string} filterId
* @return {Array<Result>} logArray
*/
appchain.getFilterChanges(id)
/**
* @function sendSignedTransaction
* @desc send signed transaction
* @param {string} signedTransaction
* @return {object}
*/
appchain.sendSignedTransaction(signedTransaction)
/**
* @function setServer
* @description set server
* @param {string} server
* @return undefined
*/
appchain.setServer('http://localhost:1301')
FAQs
Promise based [CITA RPC](https://docs.nervos.org/cita/#/rpc_guide/rpc) toolkit.
We found that @appchain/plugin 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
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.