Socket
Socket
Sign inDemoInstall

eth-dcent-keyring

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eth-dcent-keyring - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

38

index.js

@@ -79,2 +79,17 @@ const { EventEmitter } = require('events')

const getTypedTxOption = (type, transactionJson) => {
if (type === 1 || type === 2) {
const optParams = {}
optParams.accessList = transactionJson.accessList
if (type === 2) {
optParams.maxPriorityFeePerGas = transactionJson.maxPriorityFeePerGas
optParams.maxFeePerGas = transactionJson.maxFeePerGas
}
return optParams
}
return {}
}
function isOldStyleEthereumjsTx (tx) {

@@ -99,2 +114,6 @@ return typeof tx.getChainId === 'function'

getModel () {
return 'DCENT Biometric Wallet'
}
serialize () {

@@ -251,2 +270,3 @@ return Promise.resolve({

let transaction
let txType = 0
if (isOldStyleEthereumjsTx(tx)) {

@@ -265,2 +285,6 @@ // legacy transaction from ethereumjs-tx package has no .toJSON() function,

} else {
if (tx._type === 1 || tx._type === 2) {
txType = tx._type
}
transaction = {

@@ -274,3 +298,3 @@ ...tx.toJSON(),

transaction.value = (transaction.value === '0x') ? '0x0' : transaction.value
const typedOpstions = getTypedTxOption(txType, transaction)
return new Promise((resolve, reject) => {

@@ -288,3 +312,5 @@ this.unlock()

this.path, // key path
transaction.chainId
transaction.chainId,
txType,
typedOpstions
).then((response) => {

@@ -388,3 +414,3 @@ LOG('response - ', response)

signTypedData (withAccount, typedData) {
signTypedData (withAccount, typedData, opts) {
// Waiting on dcent to enable this

@@ -397,5 +423,5 @@ LOG('signPersonalMessage - withAccount', withAccount)

.then((_) => {
DcentConnector.getEthereumSignedTypedData(
typedData,
this.path
DcentConnector.getSignedData(
this.path,
{ payload: typedData, version: opts.version }
).then((response) => {

@@ -402,0 +428,0 @@ if (response.header.status === DcentResult.SUCCESS) {

4

package.json
{
"name": "eth-dcent-keyring",
"version": "0.2.0",
"version": "0.2.1",
"description": "A MetaMask compatible keyring, for D'CENT hardware wallets",

@@ -37,3 +37,3 @@ "main": "index.js",

"ethereumjs-util": "7.0.9",
"dcent-web-connector": "^0.10.5"
"dcent-web-connector": "^0.11.2"
},

@@ -40,0 +40,0 @@ "devDependencies": {

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