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

@dominantlab/clt-blockchain-sdk

v2.0.18

Published

SDK for IO-Blockchain(IOB)

Downloads

27

Readme

EITRI.js

npm

usage

$ npm install --save @dominantlab/clt-blockchain-sdk
  • node.js
const {EITRI} = require('@dominantlab/clt-blockchain-sdk')

const eitri = new EITRI({
  ip: "127.0.0.1",
  port: 8545,
  user: '',
  password: ''
});

(async () => {
  const createdAccount = await eitri.accounts.create()
  console.log(createdAccount)
})()
{ 
  "prvKey": "4aca257c4e1f71689569183b532754080c683d42e5e769509d444c1dd77ae58df69750cf915757745fa8789ac68240f62bf9ec29a7c9b6f06483c562c767c06d",
  "pubKey": "f69750cf915757745fa8789ac68240f62bf9ec29a7c9b6f06483c562c767c06d",
  "address": "ce10901367d2612278313dadd1dc308d8364d53a4039b47d97ee78ccd6fd7ef3",
  "encrypt": [Function: encrypt] 
}
  • react
import {EITRI}  from '@dominantlab/clt-blockchain-sdk'

function App() {
  useEffect(() => {
    (async() => {
      let eitri = new EITRI({})
      // console.log(eitri)
      const password = 'password'
      const createdAccount = await eitri.accounts.create()
      const { encrypted } = eitri.accounts.encrypt(createdAccount.prvKey, password)
      const decryptPrvKey = eitri.accounts.decrypt(encrypted, password)
      const recoveryAddress = eitri.accounts.privateKeyToAccount(decryptPrvKey)
      
      console.log(createdAccount)
      console.log(encrypted)
      console.log(recoveryAddress)
    })()
  }, [])
  return (
    <div className="App">
     
    </div>
  );
}

export default App;
{ 
  "prvKey": "4aca257c4e1f71689569183b532754080c683d42e5e769509d444c1dd77ae58df69750cf915757745fa8789ac68240f62bf9ec29a7c9b6f06483c562c767c06d",
  "pubKey": "f69750cf915757745fa8789ac68240f62bf9ec29a7c9b6f06483c562c767c06d",
  "address": "ce10901367d2612278313dadd1dc308d8364d53a4039b47d97ee78ccd6fd7ef3",
  "encrypt": [Function: encrypt] 
}
  • html
<!DOCTYPE html>
<html>
  <script src="./node_modules/@dominantlab/clt-blockchain-sdk/build"></script>

  <body>
    <script>
      (async () => {
        let eitri = new EITRI.EITRI({})
        const password = 'password'
        const createdAccount = await eitri.accounts.create()
        const { encrypted } = eitri.accounts.encrypt(createdAccount.prvKey, password)
        const decryptPrvKey = eitri.accounts.decrypt(encrypted, password)
        const recoveryAddress = eitri.accounts.privateKeyToAccount(decryptPrvKey)
        
        console.log(createdAccount)
        console.log(encrypted)
        console.log(recoveryAddress)
      })()
     
    </script>
  </body>
</html>

development

  • test

test 코드는 ./test/ 아래에 있다.

commonjs/: reuqire() 형태 구동 테스트

es6: es6 형태 구동 테스트

web: web에서 구동 테스트

$ npm run test:commonjs
$ npm run test:es6

./src/index.jsrequire() 형태와 import '' from '' 로 테스트 한다

web 은 아래의 명령어를 수행후 테스트한다.

  • html 배포파일 만들기
$ npm build

webpack을 이용하여 html에서 사용할 수 있는 SDK를 build/index.js에 생성한다.

  • deploy
$ npm run publish

npm 배포

Similar libraries in other languages