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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@emit-technology/emit-account-node-sdk

v1.2.3

Published

EMIT Account SDK

Downloads

10

Readme

emit-account-node-sdk

emit-account-node-sdkis a web3 provider for dapps ,that's develop base on emit-core .

1. Install SDK and Web3

npm i @emit-technology/emit-account-node-sdk
npm i web3@npm:@emit-technology/web3
npm i web3-core-helpers@npm:@emit-technology/web3-core-helpers
npm i web3-utils@npm:@emit-technology/web3-utils

2. Import and initialize a web3 instance

import {AccountModel,ChainType} from '@emit-technology/emit-lib';
import EmitBox from '@emit-technology/emit-account-node-sdk';
import Web3 from 'web3';

const dapp = {
     name: "DEMO",
     url: "http://localhost:3000",
     category: "web3",
     contractAddress: ""
 }
const network_emit = {nodeUrl: "https://node-emit-dev.bangs.network", chainId: "667", chainType: ChainType.EMIT}
const network_bsc = {nodeUrl: "https://node-bsc.bangs.network", chainId: "1", chainType: ChainType.BSC}
const network_eth = {nodeUrl: "https://node-bsc.bangs.network", chainId: "1", chainType: ChainType.ETH}

const emitBox = new EmitBox(dapp, network_emit);
const ethProvider = emitBox.newProvider({
    dapp: dapp,
    network: network_eth,
    version: "1.0"
});
const bscProvider = emitBox.newProvider({
    dapp: dapp,
    network: network_bsc,
    version: "1.0"
})


//if you single use ethereum network
const web3 = new Web3(ethProvider);
 
//if you are using multi-chain , and use web3[ChainType.ETH] instead of web3, eg: web3[ChainType.ETH].eth.getAccounts 
/** 
const web3 = {
    [ChainType.ETH]: new Web3(ethProvider),
    [ChainType.BSC]: new Web3(bscProvider)
}
*/

3.Verify everything works by calling a web3 method such as getAccounts:

web3.eth.getAccounts((err,accounts)=>{
    console.log(err,accounts[0])
})

or

web3.eth.getAccounts().then(accounts=>{
    console.log("accounts:",accounts[0]);
}).catch(e=>{
    console.error("error",e)
})

or

emitBox.requestAccount().then((account:AccountModel)=>{
    console.log("account:",account);
}).catch(e=>{
    console.error("error",e)
})

4 sign Method

web3.eth.personal.sign("TEST DATA",account,"").then(value => {
   console.log(value); 
})

web3.eth.personal.ecRecover("TEST DATA",signature).then(value => {
    console.log(value); 
})

or

//Batch sign
emitBox.batchSignMsg([{
    chain: ChainType.EMIT,
    msg:  {data:"0x64c2d1dab59dee2c7741acee3826dad50cdb7f6adb28a159b1bc6aa5374a2b24"}
}]).then((data:any)=>console.log(data))

5 Send transaction

web3 chain


    getNonce = async (): Promise<any> => {
        const from = ""//account address
        return new Promise((resolve, reject) => {
            web3.eth.getTransactionCount(from, "pending", (error, nonce) => {
                if (error) {
                    reject(error)
                } else {
                    resolve(nonce)
                }
            })
        })
    }

    getGasPrice = async (): Promise<string> => {
        const gasPrice = await web3.eth.getGasPrice()
        return gasPrice;
    }

    estimateGas = async (txParams: any): Promise<any> => {
        return new Promise((resolve, reject) => {
            web3.eth.estimateGas(txParams, (err, ret) => {
                if (err) {
                    reject(err)
                } else {
                    resolve(ret);
                }
            })
        })
    }

async function send {
    const txConfig = {
        from: from,
        to: receive,
        value: data ? "0x0" : utils.toHex(utils.toValue(amount, decimal)),
        nonce: await this.getNonce(),
        data: data,
        // common: config.chains[chain].common
/**
for dev env
{
            baseChain: "mainnet",
            customer: {
                name: "mainnet",
                networkId: 15,
                chainId: 1337,
            },
            hardfork: "petersburg"
        },
**/

    }
    txConfig["gas"] = await this.estimateGas(txConfig);
    const result = await web3.eth.sendTransaction(txConfig)
}




emit core

async function send {

const prepareBlock = await emitBoxSdk.emitBox.emitDataNode.genPrepareBlock(
    from,
    data,
    {
        settles: [],
        outs: [
            {
                target: receive,
                factor: {
                    category: utils.token2Category(token),
                    value: utils.toValueHex(amount),
                },
            },
        ],
    },
    undefined
);
await emitBoxSdk.emitBox.emitDataNode.prepareBlock(prepareBlock);

}