npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@eosio-toppings/api-rpc

v1.1.0

Published

RESTful API service making use of the nodeos RPC API wrapper `eosjs` to obtain data from nodeos

Downloads

29

Readme

api-rpc

RESTful API service making use of the nodeos RPC API wrapper eosjs to obtain data from nodeos.

Manual Usage

Install TypeScript and tsc (TypeScript Compiler) globally with

yarn global add typescript

Compile and Watch

Compile the source into js and watch for changes into ./dist with the following command:

rm -rf dist && tsc -w

Currently Available API Functions

The following API functions all accept a single parameter, a query which is basically an object containing several keys composed of the necessary values to make the RPC API call.

buy_ram

Given a connected endpoint with private_key, actor, permission, quantity details, buys ram for the account actor.

  • endpoint - string
  • private_key - string
  • actor - string
  • permission - string
  • quantity - number

create_account

Given a connected endpoint with private_key, actor, permission credentials, make an account consisting of new_account_name with the public new_account_owner_key and public new_account_active_key. If you want to stake cpu, stake net and buy ram, pass the required parameters.

  • endpoint - string
  • private_key - string
  • actor - string
  • permission - string
  • new_account_name - string
  • new_account_owner_key - string
  • new_account_active_key - string
  • delagate - boolean (If the delagate is true then buy ram, stake cpu, and stake net actions are executed)
  • ram_bytes_buy_quantity - number (default to 8192)
  • stake_net_quantity - string (default to '1.0000 SYS')
  • stake_cpu_quantity - string (default to '1.0000 SYS')

deploy_contract

Given a connected endpoint with private_key, account_name, permission, payload details, deploys contract to the account_name

  • endpoint - string
  • private_key - string
  • account_name - string
  • permission - string
  • payload - { abi: '<abi_file_content>', wasm: '<wasm_file_content>' }

get_abi

Given a connected endpoint, try to get the abi details of account_name directly from the RPC API

  • endpoint - string
  • account_name - string

get_account_details

Given a connected endpoint, try to get the account details of account_name directly with the RPC API

  • endpoint - string
  • account_name - string

get_block

Given a connected endpoint, try to get the block details of id_or_num directly from the RPC API

  • endpoint - string
  • id_or_num - string (it can accept either block ID or block number)

get_info

Given a connected endpoint, try to get basic information about the blockchain at endpoint

  • endpoint - string

get_producer_schedule

Given a connected endpoint, try to get producer schedule in the blockchain at endpoint

  • endpoint - string

get_producers

Given a connected endpoint, try to get producers details in the blockchain at endpoint

  • endpoint - string

get_table_rows

Given a connected endpoint, try to get the rows of multi-index table table_name of contract_name, if present

  • endpoint - string
  • contract_name - string
  • table_name - string

push_action

Given a connected endpoint with private_key, actor, permission credentials, push an action of action_name of the account_name smart contract with parameters contained in payload

  • endpoint - string
  • account_name - string
  • private_key - string
  • actor - string
  • permission - string
  • action_name - string
  • payload - object

sell_ram

Given a connected endpoint with private_key, actor, permission, quantity details, sell ram from the account actor.

  • endpoint - string
  • private_key - string
  • actor - string
  • permission - string
  • quantity - number

stake_cpu

Given a connected endpoint with private_key, actor, permission, quantity details, stake cpu for the account actor.

  • endpoint - string
  • private_key - string
  • actor - string
  • permission - string
  • quantity - number

stake_net

Given a connected endpoint with private_key, actor, permission, quantity details, stake net for the account actor.

  • endpoint - string
  • private_key - string
  • actor - string
  • permission - string
  • quantity - number

unstake_cpu

Given a connected endpoint with private_key, actor, permission, quantity details, unstake cpu for the account actor.

  • endpoint - string
  • private_key - string
  • actor - string
  • permission - string
  • quantity - number

unstake_net

Given a connected endpoint with private_key, actor, permission, quantity details, unstake net for the account actor.

  • endpoint - string
  • private_key - string
  • actor - string
  • permission - string
  • quantity - number

update_auth

Given a connected endpoint with private_key, account_name credentials, push one or two updateauth actions in a single transaction in order to update the public key(s) of account_name The new_active_key and new_owner_key denote public keys, and can either be passed at the same time or passed one at a time.

  • endpoint - string
  • account_name - string
  • private_key - string
  • new_active_key - string
  • new_owner_key - string