@bn-onboard/ledger
Advanced tools
Comparing version 2.0.0-alpha.12 to 2.0.0-alpha.13
@@ -0,1 +1,4 @@ | ||
// these cannot be dynamically imported | ||
import { TypedDataUtils } from '@metamask/eth-sig-util'; | ||
import { Buffer } from 'buffer'; | ||
const LEDGER_LIVE_PATH = `m/44'/60'`; | ||
@@ -31,3 +34,2 @@ const LEDGER_DEFAULT_PATH = `m/44'/60'/0'`; | ||
const { default: HDKey } = await import('hdkey'); | ||
const { Buffer } = await import('buffer'); | ||
const { publicToAddress, toChecksumAddress } = await import('ethereumjs-util'); | ||
@@ -81,3 +83,3 @@ const hdk = new HDKey(); | ||
const ethUtil = await import('ethereumjs-util'); | ||
const { TypedDataUtils: { hashStruct }, SignTypedDataVersion } = await import('@metamask/eth-sig-util'); | ||
const { SignTypedDataVersion } = await import('@metamask/eth-sig-util'); | ||
const { JsonRpcProvider } = await import('@ethersproject/providers'); | ||
@@ -180,3 +182,3 @@ const { accountSelect, createEIP1193Provider, ProviderRpcError } = await import('@bn-onboard/common'); | ||
// @ts-ignore | ||
const CommonConstructor = Common.default; | ||
const CommonConstructor = Common.default || Common; | ||
const common = new CommonConstructor({ | ||
@@ -232,4 +234,4 @@ chain: customNetwork || currentChain.hasOwnProperty('id') | ||
accounts[0]; | ||
const domainHash = hashStruct('EIP712Domain', typedData.domain, typedData.types, SignTypedDataVersion.V3).toString('hex'); | ||
const messageHash = hashStruct(typedData.primaryType, typedData.message, typedData.types, SignTypedDataVersion.V3).toString('hex'); | ||
const domainHash = TypedDataUtils.hashStruct('EIP712Domain', typedData.domain, typedData.types, SignTypedDataVersion.V3).toString('hex'); | ||
const messageHash = TypedDataUtils.hashStruct(typedData.primaryType, typedData.message, typedData.types, SignTypedDataVersion.V3).toString('hex'); | ||
return eth | ||
@@ -236,0 +238,0 @@ .signEIP712HashedMessage(account.derivationPath, domainHash, messageHash) |
{ | ||
"name": "@bn-onboard/ledger", | ||
"version": "2.0.0-alpha.12", | ||
"version": "2.0.0-alpha.13", | ||
"description": "Ledger module for Onboard.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21831
293