rns-js
RNS JavaScript library.
npm i web3 @rsksmart/rns
Or just use it directly in your webpage:
<script src="https://unpkg.com/web3@1.2.6/dist/web3.min.js"></script>
<script src="https://unpkg.com/@rsksmart/rns@1.7.0/lib/rns.min.js"></script>
Don't forget to specify the desired version of the package!
Basic usage
Instance de library:
const web3 = 'https://public-node.rsk.co'const rns = web3
Get an address:
rns
Get Bitcoin address:
rns
Check if testing.rsk
domain is available:
rns
Check if example.testing.rsk
subdomain is available:
rnssubdomains
Reverse lookup: get name of a given address:
rns
Check out more operations details in the RSK Developers Portal.
Advanced usage
Use Web3 Contract
directly
{ const web3 = 'https://public-node.rsk.co' const rns = web3 await rns const owner = await rnscontractsregistrymethods return owner;}
Run for development
Install dependencies:
git clone git@github.com:rnsdomains/rns-js.git
cd rns-js
npm i
Run tests:
npm test
Try out your development, create a testing project:
# in rns-js folder
npm run build
npm link
cd ..
mkdir rns-js-test
cd rns-js-test
npm init
npm i web3
npm link @rsksmart/rns
Versioning
master
branch point to latest release.develop
branch contains changes that will apply next release. The first commit after release bumps to next version.- Other branches (feature branches) point to
develop
.
Find releases scopes in milestones