New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@coolwallets/eth

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coolwallets/eth

Ethereum API of CoolWalletS.

  • 0.2.0-beta.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25
decreased by-3.85%
Maintainers
3
Weekly downloads
 
Created
Source

CoolWalletS Ethereum App

Ethereum API of CoolWalletS.

Install

npm install @coolwallets/eth

Usage

import cwsETH from '@coolwallets/eth'
const ETH = new cwsETH(transport, appPrivateKey, appId)

getAddress

Get address by address index.

const address = await ETH.getAddress(0)

The address generated is compatible to BIP44 with account and change set to 0, which means calling getAddress(i) will get the address of folllowing BIP44 path:

m/44'/60'/0'/0/{i}

In the design of current hardware, we only support path m/44'/60'/0'/0/{i} for speed optimization. This might change in the future and we will then open a more general interface to deal with custom path.

signTransaction

Sign Ethereum Transaction. If the transaction has non-empty data field, the card will display SMART instead of transfering amount.

const tx = {
    nonce: "0x21d",
    gasPrice: "0x59682f00",
    gasLimit: "0x5208",
    to: "0x81bb32e4A7e4d0500d11A52F3a5F60c9A6Ef126C",
    value: "0x5af3107a4000",
    data: "0x00",
    chainId: 1
}
// sign with address index 0
const signedTx = await ETH.signTransaction(tx, 0)

signMessage

Perform ethereum personal_sign.

const message = 'custom message';
const signature = await ETH.signMessage(message, 0)

FAQs

Package last updated on 20 Mar 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc