truffle-privatekey-provider
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/truffle-privatekey-provider package

1.5.0 • Public • Published

NPM

truffle-privatekey-provider

Private Key provider for Web3. Used to sign transactions by provider private key

Install

$ npm install truffle-privatekey-provider

Usage

Provider can be used either with Web3 only or in Truffle infrastructure

Web3 Usage

var PrivateKeyProvider = require("truffle-privatekey-provider");
var privateKey = "62537136911bca3a7e2b....";
var provider = new PrivateKeyProvider(privateKey, "http://localhost:8545");
 

Parameters:

  • privateKey: string. private key for account that would be used to sign transactions.
  • providerUri: string. URI of Ethereum client to send Web3 requests.

Truffle Usage

truffle.js

var PrivateKeyProvider = require("truffle-privatekey-provider");
 
var privateKey = "62537136911bca3a7e2b....";
 
module.exports = {
  networks: {
    rinkeby: {
      provider: () => new PrivateKeyProvider(privateKey, "https://rinkeby.infura.io/"),
      network_id: 4
    },
    ....
  }
};

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.5.0215latest

Version History

VersionDownloads (Last 7 Days)Published
1.5.0215
1.4.00
1.3.053
1.2.00
1.1.09
1.0.02
0.1.08
0.0.670
0.0.542
0.0.44
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i truffle-privatekey-provider

Weekly Downloads

403

Version

1.5.0

License

MIT

Unpacked Size

3.35 kB

Total Files

3

Last publish

Collaborators

  • nosuchip