Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
dapp-client
Advanced tools
Using Yarn:
yarn add dapp-client
or using NPM:
npm install --save dapp-client
CommonJS
const { DappClient } = require("dapp-client")
const fetch = require("isomorphic-fetch")
const endpoint = "https://dsp.eosn.io"
const client = new DappClient(endpoint, { fetch })
TypeScript
import { DappClient } from "dapp-client"
import fetch from "isomorphic-fetch"
const endpoint = "https://dsp.eosn.io"
const client = new DappClient(endpoint, { fetch })
# Chain
/v1/chain/get_currency_stats
/v1/chain/get_info
/v1/chain/get_table_by_scope
/v1/chain/get_table_rows
DAPP
import { names } from "dapp-client"
names.DAPP // => "......2ke1.o4"
DAPP Client
const endpoint = "https://dsp.eosn.io"
const client = new DappClient(endpoint, { fetch })
Get TABLE package
options
object optional params (optional, default {}
)
options.lower_bound
string? Filters results to return the first element that is not less than provided value in setoptions.upper_bound
string? Filters results to return the first element that is greater than provided value in setoptions.limit
number Limit the result amount (optional, default 10
)options.show_payer
boolean Show Payer (optional, default false
)const response = await client.get_table_package({limit: 500});
for (const row of response.rows) {
console.log(row);
// {
// id: 9,
// api_endpoint: 'https://dsp.eosn.io',
// package_json_uri: 'https://eosnation.io/package1.dsp-package.json',
// package_id: 'package1',
// service: 'ipfsservice1',
// provider: 'eosnationdsp',
// quota: '500.0000 QUOTA',
// package_period: 86400,
// min_stake_quantity: '10000.0000 DAPP',
// min_unstake_period: 3600,
// enabled: 1
// }
}
Get TABLE accountext
options
object optional params (optional, default {}
)
options.lower_bound
string? Filters results to return the first element that is not less than provided value in setoptions.upper_bound
string? Filters results to return the first element that is greater than provided value in setoptions.limit
number Limit the result amount (optional, default 10
)options.show_payer
boolean Show Payer (optional, default false
)const response = await client.get_table_accountext({limit: 500});
for (const row of response.rows) {
console.log(row);
// {
// id: 29,
// account: 'eosnationdsp',
// service: 'ipfsservice1',
// provider: 'eosnationdsp',
// quota: '0.0001 QUOTA',
// balance: '255101.1461 DAPP',
// last_usage: '1555466031000',
// last_reward: '1555466031000',
// package: 'package2',
// pending_package: 'package2',
// package_started: '1555466031000',
// package_end: '1555469631000'
// }
}
Returns an object containing rows from the specified table.
code
string The name of the smart contract that controls the provided tablescope
string The account to which this data belongstable
string The name of the table to queryoptions
object optional params (optional, default {}
)
options.lower_bound
string? Filters results to return the first element that is not less than provided value in setoptions.upper_bound
string? Filters results to return the first element that is greater than provided value in setoptions.limit
number Limit the result amount (optional, default 10
)options.show_payer
boolean Show Payer (optional, default false
)options.json
boolean JSON response (optional, default true
)options.index_position
number Position of the index used (optional, default 1
)options.key_type
string? Type of key specified by index_position (for example - uint64_t or name)options.table_key
string? Table Keyoptions.encode_type
string? Encode typeconst response = await rpc.get_table_rows("<code>", "<scope>", "<table>");
console.log(response);
Returns Promise<GetTableRows> table rows
GET /v1/chain/get_table_by_scope
Returns an object containing rows from the specified table.
code
string name of the contract to return table data foroptions
object optional params (optional, default {}
)
options.table
string? Filter results by tableoptions.lower_bound
string? Filters results to return the first element that is not less than provided value in setoptions.upper_bound
string? Filters results to return the first element that is greater than provided value in setoptions.limit
number? Limit number of results returned.options.reverse
boolean Reverse the order of returned results (optional, default false
)const response = await rpc.get_table_by_scope();
console.log(response);
Returns Promise<GetTableByScope> table rows
GET /v1/chain/get_currency_balance
Retrieve the stats of for a given currency
code
string The contract that operates the currencyaccount
string The account to query balances forsymbol
string The symbol for the currency if the contract operates multiple currenciesconst response = await rpc.get_currency_balance("eosio.token", "eosio.null", "EOS");
console.log(response);
Returns Promise<GetCurrencyBalance> table rows
GET /v1/chain/get_currency_stats
Retrieve the stats of for a given currency
code
string The contract that operates the currencysymbol
string The symbol for the currency if the contract operates multiple currenciesconst response = await rpc.get_currency_stats("eosio.token", "EOS");
console.log(response);
Returns Promise<GetCurrencyStats> table rows
Returns an object containing various details about the blockchain.
const response = await rpc.get_info();
console.log(response);
Returns Promise<GetInfo> table rows
ACTION
dappservices::claimrewards
provider
string nameclaimrewards("<DSP Provider>");
ACTION
dappservices::closeprv
closeprv("<Account>", "ipfsservice1", "<DSP Provider>")
ACTION
dappservices::modifypkg
provider
string namepackage_id
string nameservice
string nameapi_endpoint
string std::stringpackage_json_uri
string std::stringACTION
dappservices::refund
refund("<Account>", "<DSP Provider>", "ipfsserver1", "DAPP")
ACTION
dappservices::regpkg
newpackage
string packageACTION
dappservices::selectpkg
ACTION
dappservices::stake
ACTION
dappservices::transfer
ACTION
dappservices::unstake
FAQs
DAPP JavaScript/TypeScript Client Library
The npm package dapp-client receives a total of 11 weekly downloads. As such, dapp-client popularity was classified as not popular.
We found that dapp-client 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
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.