Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
rooot-browser-lib
Advanced tools
This library holds the common modules used by the Rooot™ system in TypeScript. It's specially suited for websites interacting with the blockchain.
npm i rooot-browser-lib
NB: The library is still under development, so ask us for installation guidelines.
import {
AccountsRestClient, GatewayRestClient, MetadataRestClient, TermsRestClient, TransactionRestClient,
buildOblivionTransaction, createOblivionTransaction, Vectors
} from 'rooot-browser-lib'
// Get all account information
const accountsRestClient = AccountsRestClient('http://localhost:3014')
accountsRestClient.getAccount(yourCredentials).then(account => {
// Use its info, eg. list its vectors
console.log(Vectors(account.vectors).list())
})
// Ask for the metadata
const metadataRestClient = MetadataRestClient('http://localhost:3013')
metadataRestClient.getMetadata().then(metadata => {
// Use them
console.log(metadata.lastBlockId, metadata.timestamp)
})
// Get a transaction from a depositary's gateway
const gatewayRestClient = GatewayRestClient('http://localhost:3030')
gatewayRestClient.getTransaction('1234567890abcdef[...]')
.then(transaction => {
// Do sth with it
console.log(transaction)
})
.catch(err => {
// Handle it
console.error(err)
})
// Know the latest terms of a smart contract
const termsRestClient = TermsRestClient('http://localhost:3004')
termsRestClient.getTerms(publicKey)
.then(terms => {
// Read them
console.log(terms.status, terms.channel, terms.end, terms.maxUse)
})
// Post an oblivion transaction
const transactionRestClient = TransactionRestClient('http://localhost:3003')
const oblivionTx = await transactionRestClient.getMetadata()
.then(([metadata, beneficiary]) => buildBaseOblivion(optinTx, optoutTx.transactionId, metadata, emitter, beneficiary)
.then(createOblivionTransaction)
)
transactionRestClient.sendOblivion(oblivionTx)
// Get the IDs of the 10 last blocks
const gatewayRestClient = GatewayRestClient('http://localhost:3030')
gatewayRestClient.last10Blocks()
.then(blockIds => {
// Do sth with them
console.log(blockIds.includes(transaction.lastBlockId))
})
To run the tests, you would need to install live-server
:
npm i -g live-server
The use of the Rooot™ libraries and executables are subject to fees for commercial purpose and to the respect of the BSD-2-Clause-Patent license. Please contact us to get further information.
FAQs
Browser library for the rooot project
We found that rooot-browser-lib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.