Skip to content

consensusnetworks/accumulate-js

Repository files navigation

accumulate-js

tests

Accumulate client for Node.js and browser

Usage

npm install @hawyar/accumulate-js@0.1.0

Query

const rpc = accumulateClient("testnet");

const tx = await rpc.getTransaction(
  "5e63152594a0627a1ecc5a168d3322888c0f23ef1c60cebd11a79244a5af4d08",
);

console.log(tx.data.from); // acc://7117c50f04f1254d56b704dc05298912deeb25dbc1d26ef6/ACME
console.log(tx.type); // sendToken

const txHistory = await rpc.getTransactionHistory({
    url: "acc://7117c50f04f1254d56b704dc05298912deeb25dbc1d26ef6/ACME",
    start: 0,
    count: 10,
 })

console.log(txHistroy.items); // 10 transactions

Contributing

Doc

npm run generate:docs

and to preview docs locally

npm run serve:docs

Generate types from JSDoc

npm run generate:types

Testing

npm run test

Build

npm run build