0.2.0-beta.1 • Published 4 years ago

@coolwallets/eth v0.2.0-beta.1

Weekly downloads
171
License
Apache-2.0
Repository
github
Last release
4 years ago

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)
0.2.0-beta.1

4 years ago

0.2.0-beta.0

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.11

4 years ago

0.1.10

4 years ago

0.1.9-beta

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2-beta

5 years ago

0.1.1-beta2

5 years ago

0.1.1-beta

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago