diff --git a/packages/devices/package.json b/packages/devices/package.json index 47c638f6d..341f655e7 100644 --- a/packages/devices/package.json +++ b/packages/devices/package.json @@ -26,6 +26,7 @@ "dependencies": { "@ledgerhq/errors": "^6.10.0", "@ledgerhq/logs": "^6.10.0", + "buffer": "^6.0.3", "rxjs": "6", "semver": "^7.3.5" }, diff --git a/packages/devices/src/ble/receiveAPDU.ts b/packages/devices/src/ble/receiveAPDU.ts index 4e23699cc..a298932af 100644 --- a/packages/devices/src/ble/receiveAPDU.ts +++ b/packages/devices/src/ble/receiveAPDU.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { TransportError, DisconnectedDevice } from "@ledgerhq/errors"; import { Observable } from "rxjs"; import { log } from "@ledgerhq/logs"; diff --git a/packages/devices/src/ble/sendAPDU.ts b/packages/devices/src/ble/sendAPDU.ts index 59b1ac288..7649e2bad 100644 --- a/packages/devices/src/ble/sendAPDU.ts +++ b/packages/devices/src/ble/sendAPDU.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { Observable } from "rxjs"; import { log } from "@ledgerhq/logs"; const TagId = 0x05; diff --git a/packages/devices/src/hid-framing.ts b/packages/devices/src/hid-framing.ts index 707d5ca70..4da03091c 100644 --- a/packages/devices/src/hid-framing.ts +++ b/packages/devices/src/hid-framing.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { TransportError } from "@ledgerhq/errors"; export type ResponseAcc = | { diff --git a/packages/devices/src/scrambling.ts b/packages/devices/src/scrambling.ts index 1db5e2178..f0cd07e69 100644 --- a/packages/devices/src/scrambling.ts +++ b/packages/devices/src/scrambling.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; export function wrapApdu(apdu: Buffer, key: Buffer) { if (apdu.length === 0) return apdu; const result = Buffer.alloc(apdu.length); diff --git a/packages/hw-app-algorand/package.json b/packages/hw-app-algorand/package.json index ea9a67828..c572c124e 100644 --- a/packages/hw-app-algorand/package.json +++ b/packages/hw-app-algorand/package.json @@ -30,6 +30,7 @@ "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", "bip32-path": "^0.4.2", + "buffer": "^6.0.3", "hi-base32": "^0.5.1", "js-sha512": "^0.8.0", "tweetnacl": "^1.0.3" diff --git a/packages/hw-app-algorand/src/Algorand.ts b/packages/hw-app-algorand/src/Algorand.ts index c3fda8256..bbf1afb4d 100644 --- a/packages/hw-app-algorand/src/Algorand.ts +++ b/packages/hw-app-algorand/src/Algorand.ts @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ********************************************************************************/ +import { Buffer } from "buffer/"; import type Transport from "@ledgerhq/hw-transport"; import BIPPath from "bip32-path"; import { UserRefusedOnDevice } from "@ledgerhq/errors"; diff --git a/packages/hw-app-btc/package.json b/packages/hw-app-btc/package.json index 6bf2e2922..09d6bd0a9 100644 --- a/packages/hw-app-btc/package.json +++ b/packages/hw-app-btc/package.json @@ -32,6 +32,7 @@ "bip32-path": "^0.4.2", "bitcoinjs-lib": "^5.2.0", "bs58": "^4.0.1", + "buffer": "^6.0.3", "invariant": "^2.2.4", "ripemd160": "2", "semver": "^7.3.5", diff --git a/packages/hw-app-btc/src/Btc.ts b/packages/hw-app-btc/src/Btc.ts index 559ef3f5b..7843cdab9 100644 --- a/packages/hw-app-btc/src/Btc.ts +++ b/packages/hw-app-btc/src/Btc.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import type Transport from "@ledgerhq/hw-transport"; import { pathStringToArray } from "./bip32"; import BtcNew, { canSupportApp } from "./BtcNew"; @@ -129,11 +130,11 @@ export default class Btc { !isPathNormal(path) ) { console.warn(`WARNING: Using deprecated device protocol to get the public key because - + * a non-standard path is requested, and * verify flag is false - - The new protocol only allows export of non-standard paths if the + + The new protocol only allows export of non-standard paths if the verify flag is true. Standard paths are (currently): M/44'/(1|0)'/X' @@ -142,9 +143,9 @@ export default class Btc { M/86'/(1|0)'/X' M/48'/(1|0)'/X'/Y' - followed by "", "(0|1)", or "(0|1)/b", where a and b are + followed by "", "(0|1)", or "(0|1)/b", where a and b are non-hardened. For example, the following paths are standard - + M/48'/1'/99'/7' M/86'/1'/99'/0 M/48'/0'/99'/7'/1/17 diff --git a/packages/hw-app-btc/src/BtcNew.ts b/packages/hw-app-btc/src/BtcNew.ts index 3b7354364..03ff20155 100644 --- a/packages/hw-app-btc/src/BtcNew.ts +++ b/packages/hw-app-btc/src/BtcNew.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { crypto } from "bitcoinjs-lib"; import semver from "semver"; import { pointCompress } from "tiny-secp256k1"; diff --git a/packages/hw-app-btc/src/BtcOld.ts b/packages/hw-app-btc/src/BtcOld.ts index b3c09358e..3642bdbec 100644 --- a/packages/hw-app-btc/src/BtcOld.ts +++ b/packages/hw-app-btc/src/BtcOld.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import bs58 from "bs58"; import RIPEMD160 from "ripemd160"; import sha from "sha.js"; diff --git a/packages/hw-app-btc/src/bip32.ts b/packages/hw-app-btc/src/bip32.ts index da582acc3..722a47ffc 100644 --- a/packages/hw-app-btc/src/bip32.ts +++ b/packages/hw-app-btc/src/bip32.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import bippath from "bip32-path"; import bs58check from "bs58check"; diff --git a/packages/hw-app-btc/src/buffertools.ts b/packages/hw-app-btc/src/buffertools.ts index d837db852..a8b6e29a3 100644 --- a/packages/hw-app-btc/src/buffertools.ts +++ b/packages/hw-app-btc/src/buffertools.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import varuint from "varuint-bitcoin"; export function unsafeTo64bitLE(n: number): Buffer { diff --git a/packages/hw-app-btc/src/compressPublicKey.ts b/packages/hw-app-btc/src/compressPublicKey.ts index 9a42f12b6..636a22311 100644 --- a/packages/hw-app-btc/src/compressPublicKey.ts +++ b/packages/hw-app-btc/src/compressPublicKey.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; export function compressPublicKey(publicKey: Buffer): Buffer { const prefix = (publicKey[64] & 1) !== 0 ? 0x03 : 0x02; const prefixBuffer = Buffer.alloc(1); diff --git a/packages/hw-app-btc/src/createTransaction.ts b/packages/hw-app-btc/src/createTransaction.ts index 8a30a16e0..d64e02884 100644 --- a/packages/hw-app-btc/src/createTransaction.ts +++ b/packages/hw-app-btc/src/createTransaction.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { log } from "@ledgerhq/logs"; import type Transport from "@ledgerhq/hw-transport"; import { hashPublicKey } from "./hashPublicKey"; diff --git a/packages/hw-app-btc/src/getTrustedInput.ts b/packages/hw-app-btc/src/getTrustedInput.ts index feb23a6fa..b362dd07c 100644 --- a/packages/hw-app-btc/src/getTrustedInput.ts +++ b/packages/hw-app-btc/src/getTrustedInput.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import invariant from "invariant"; import type Transport from "@ledgerhq/hw-transport"; import type { Transaction } from "./types"; diff --git a/packages/hw-app-btc/src/getTrustedInputBIP143.ts b/packages/hw-app-btc/src/getTrustedInputBIP143.ts index 85472bfb7..e59211379 100644 --- a/packages/hw-app-btc/src/getTrustedInputBIP143.ts +++ b/packages/hw-app-btc/src/getTrustedInputBIP143.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import Transport from "@ledgerhq/hw-transport"; import shajs from "sha.js"; import type { Transaction } from "./types"; diff --git a/packages/hw-app-btc/src/newops/accounttype.ts b/packages/hw-app-btc/src/newops/accounttype.ts index 1b62b9c2b..0c982c92c 100644 --- a/packages/hw-app-btc/src/newops/accounttype.ts +++ b/packages/hw-app-btc/src/newops/accounttype.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { crypto } from "bitcoinjs-lib"; import { pointAddScalar } from "tiny-secp256k1"; import { BufferWriter } from "../buffertools"; diff --git a/packages/hw-app-btc/src/newops/appClient.ts b/packages/hw-app-btc/src/newops/appClient.ts index 78f21bb20..ade293e25 100644 --- a/packages/hw-app-btc/src/newops/appClient.ts +++ b/packages/hw-app-btc/src/newops/appClient.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import Transport from "@ledgerhq/hw-transport"; import { pathElementsToBuffer } from "../bip32"; import { PsbtV2 } from "./psbtv2"; diff --git a/packages/hw-app-btc/src/newops/clientCommands.ts b/packages/hw-app-btc/src/newops/clientCommands.ts index 7e9688c70..419b40ca7 100644 --- a/packages/hw-app-btc/src/newops/clientCommands.ts +++ b/packages/hw-app-btc/src/newops/clientCommands.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { crypto } from "bitcoinjs-lib"; import { BufferReader } from "../buffertools"; import { createVarint } from "../varint"; diff --git a/packages/hw-app-btc/src/newops/merkelizedPsbt.ts b/packages/hw-app-btc/src/newops/merkelizedPsbt.ts index 0dd8ea464..e899a31e9 100644 --- a/packages/hw-app-btc/src/newops/merkelizedPsbt.ts +++ b/packages/hw-app-btc/src/newops/merkelizedPsbt.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { MerkleMap } from "./merkleMap"; import { PsbtV2 } from "./psbtv2"; diff --git a/packages/hw-app-btc/src/newops/merkle.ts b/packages/hw-app-btc/src/newops/merkle.ts index 6440978bc..661507de5 100644 --- a/packages/hw-app-btc/src/newops/merkle.ts +++ b/packages/hw-app-btc/src/newops/merkle.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { crypto } from "bitcoinjs-lib"; /** diff --git a/packages/hw-app-btc/src/newops/merkleMap.ts b/packages/hw-app-btc/src/newops/merkleMap.ts index b2803522c..985ac9640 100644 --- a/packages/hw-app-btc/src/newops/merkleMap.ts +++ b/packages/hw-app-btc/src/newops/merkleMap.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { createVarint } from "../varint"; import { hashLeaf, Merkle } from "./merkle"; diff --git a/packages/hw-app-btc/src/newops/policy.ts b/packages/hw-app-btc/src/newops/policy.ts index 15a63966d..56ccd766c 100644 --- a/packages/hw-app-btc/src/newops/policy.ts +++ b/packages/hw-app-btc/src/newops/policy.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { crypto } from "bitcoinjs-lib"; import { pathArrayToString } from "../bip32"; import { BufferWriter } from "../buffertools"; diff --git a/packages/hw-app-btc/src/newops/psbtExtractor.ts b/packages/hw-app-btc/src/newops/psbtExtractor.ts index fccc11709..36bb89584 100644 --- a/packages/hw-app-btc/src/newops/psbtExtractor.ts +++ b/packages/hw-app-btc/src/newops/psbtExtractor.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { BufferWriter } from "../buffertools"; import { PsbtV2 } from "./psbtv2"; diff --git a/packages/hw-app-btc/src/newops/psbtFinalizer.ts b/packages/hw-app-btc/src/newops/psbtFinalizer.ts index 649f0b6a0..175fc5661 100644 --- a/packages/hw-app-btc/src/newops/psbtFinalizer.ts +++ b/packages/hw-app-btc/src/newops/psbtFinalizer.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { BufferWriter } from "../buffertools"; import { psbtIn, PsbtV2 } from "./psbtv2"; diff --git a/packages/hw-app-btc/src/newops/psbtv2.ts b/packages/hw-app-btc/src/newops/psbtv2.ts index 6e25ef433..a1eb9e740 100644 --- a/packages/hw-app-btc/src/newops/psbtv2.ts +++ b/packages/hw-app-btc/src/newops/psbtv2.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { diff --git a/packages/hw-app-btc/src/serializeTransaction.ts b/packages/hw-app-btc/src/serializeTransaction.ts index 2a168e550..d717cacb7 100644 --- a/packages/hw-app-btc/src/serializeTransaction.ts +++ b/packages/hw-app-btc/src/serializeTransaction.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import type { Transaction } from "./types"; import { createVarint } from "./varint"; diff --git a/packages/hw-app-btc/src/signMessage.ts b/packages/hw-app-btc/src/signMessage.ts index ee3008e8f..9b9fb0ce0 100644 --- a/packages/hw-app-btc/src/signMessage.ts +++ b/packages/hw-app-btc/src/signMessage.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import type Transport from "@ledgerhq/hw-transport"; import bippath from "bip32-path"; import { MAX_SCRIPT_BLOCK } from "./constants"; diff --git a/packages/hw-app-btc/src/signP2SHTransaction.ts b/packages/hw-app-btc/src/signP2SHTransaction.ts index 078d2b08e..b0be26e0e 100644 --- a/packages/hw-app-btc/src/signP2SHTransaction.ts +++ b/packages/hw-app-btc/src/signP2SHTransaction.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import type Transport from "@ledgerhq/hw-transport"; import { getTrustedInput } from "./getTrustedInput"; import { startUntrustedHashTransactionInput } from "./startUntrustedHashTransactionInput"; diff --git a/packages/hw-app-btc/src/signTransaction.ts b/packages/hw-app-btc/src/signTransaction.ts index a20b7c999..a6e0e687a 100644 --- a/packages/hw-app-btc/src/signTransaction.ts +++ b/packages/hw-app-btc/src/signTransaction.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import type Transport from "@ledgerhq/hw-transport"; import { bip32asBuffer } from "./bip32"; export function signTransaction( diff --git a/packages/hw-app-btc/src/splitTransaction.ts b/packages/hw-app-btc/src/splitTransaction.ts index 54336b9f7..e65bd8ff7 100644 --- a/packages/hw-app-btc/src/splitTransaction.ts +++ b/packages/hw-app-btc/src/splitTransaction.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { log } from "@ledgerhq/logs"; import type { Transaction, TransactionInput, TransactionOutput } from "./types"; import { getVarint } from "./varint"; diff --git a/packages/hw-app-btc/src/startUntrustedHashTransactionInput.ts b/packages/hw-app-btc/src/startUntrustedHashTransactionInput.ts index 6dd78e140..7846ca3c1 100644 --- a/packages/hw-app-btc/src/startUntrustedHashTransactionInput.ts +++ b/packages/hw-app-btc/src/startUntrustedHashTransactionInput.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import type Transport from "@ledgerhq/hw-transport"; import type { Transaction } from "./types"; import { createVarint } from "./varint"; diff --git a/packages/hw-app-btc/src/varint.ts b/packages/hw-app-btc/src/varint.ts index 6d8188a08..2852505b2 100644 --- a/packages/hw-app-btc/src/varint.ts +++ b/packages/hw-app-btc/src/varint.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; export function getVarint(data: Buffer, offset: number): [number, number] { if (data[offset] < 0xfd) { return [data[offset], 1]; diff --git a/packages/hw-app-cosmos/package.json b/packages/hw-app-cosmos/package.json index 743d09c54..49b202ef2 100644 --- a/packages/hw-app-cosmos/package.json +++ b/packages/hw-app-cosmos/package.json @@ -29,7 +29,8 @@ "dependencies": { "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", - "bip32-path": "^0.4.2" + "bip32-path": "^0.4.2", + "buffer": "^6.0.3" }, "scripts": { "clean": "bash ../../script/clean.sh", diff --git a/packages/hw-app-cosmos/src/Cosmos.ts b/packages/hw-app-cosmos/src/Cosmos.ts index b8f7f3df2..7de3bef31 100644 --- a/packages/hw-app-cosmos/src/Cosmos.ts +++ b/packages/hw-app-cosmos/src/Cosmos.ts @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ********************************************************************************/ +import { Buffer } from "buffer/"; import type Transport from "@ledgerhq/hw-transport"; import BIPPath from "bip32-path"; import { UserRefusedOnDevice } from "@ledgerhq/errors"; diff --git a/packages/hw-app-elrond/package.json b/packages/hw-app-elrond/package.json index 63feee249..130ec0ac7 100644 --- a/packages/hw-app-elrond/package.json +++ b/packages/hw-app-elrond/package.json @@ -29,7 +29,8 @@ "dependencies": { "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", - "bip32-path": "^0.4.2" + "bip32-path": "^0.4.2", + "buffer": "^6.0.3" }, "scripts": { "clean": "bash ../../script/clean.sh", diff --git a/packages/hw-app-elrond/src/Elrond.ts b/packages/hw-app-elrond/src/Elrond.ts index dc9cec267..47fec631f 100644 --- a/packages/hw-app-elrond/src/Elrond.ts +++ b/packages/hw-app-elrond/src/Elrond.ts @@ -1,5 +1,6 @@ //@flow +import { Buffer } from "buffer/"; import type Transport from "@ledgerhq/hw-transport"; import BIPPath from "bip32-path"; diff --git a/packages/hw-app-eth/package.json b/packages/hw-app-eth/package.json index 51da4db08..0ae627db0 100644 --- a/packages/hw-app-eth/package.json +++ b/packages/hw-app-eth/package.json @@ -33,6 +33,7 @@ "@ledgerhq/logs": "^6.10.0", "axios": "^0.24.0", "bignumber.js": "^9.0.1", + "buffer": "^6.0.3", "ethers": "^5.5.1" }, "scripts": { diff --git a/packages/hw-app-eth/src/Eth.ts b/packages/hw-app-eth/src/Eth.ts index 40d19f8f8..6e6f4d48b 100644 --- a/packages/hw-app-eth/src/Eth.ts +++ b/packages/hw-app-eth/src/Eth.ts @@ -16,6 +16,7 @@ ********************************************************************************/ // FIXME drop: import { splitPath, foreach } from "./utils"; +import { Buffer } from "buffer/"; import { log } from "@ledgerhq/logs"; import { EthAppPleaseEnableContractData } from "@ledgerhq/errors"; import type Transport from "@ledgerhq/hw-transport"; diff --git a/packages/hw-app-eth/src/erc20.ts b/packages/hw-app-eth/src/erc20.ts index bc3f48b35..9eafb1c01 100644 --- a/packages/hw-app-eth/src/erc20.ts +++ b/packages/hw-app-eth/src/erc20.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import blob from "@ledgerhq/cryptoassets/data/erc20-signatures"; /** diff --git a/packages/hw-app-eth/src/nfts.ts b/packages/hw-app-eth/src/nfts.ts index 90ee9c3e0..39c6c9707 100644 --- a/packages/hw-app-eth/src/nfts.ts +++ b/packages/hw-app-eth/src/nfts.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import axios from "axios"; import { getLoadConfig } from "./loadConfig"; import type { LoadConfig } from "./loadConfig"; diff --git a/packages/hw-app-polkadot/package.json b/packages/hw-app-polkadot/package.json index 9ae4d3b73..d194b2e9f 100644 --- a/packages/hw-app-polkadot/package.json +++ b/packages/hw-app-polkadot/package.json @@ -29,7 +29,8 @@ "dependencies": { "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", - "bip32-path": "^0.4.2" + "bip32-path": "^0.4.2", + "buffer": "^6.0.3" }, "scripts": { "clean": "bash ../../script/clean.sh", diff --git a/packages/hw-app-polkadot/src/Polkadot.ts b/packages/hw-app-polkadot/src/Polkadot.ts index 80d2d9cf5..dd4090c15 100644 --- a/packages/hw-app-polkadot/src/Polkadot.ts +++ b/packages/hw-app-polkadot/src/Polkadot.ts @@ -15,6 +15,7 @@ * limitations under the License. ********************************************************************************/ import type Transport from "@ledgerhq/hw-transport"; +import { Buffer } from "buffer/"; import BIPPath from "bip32-path"; import { UserRefusedOnDevice, diff --git a/packages/hw-app-str/package.json b/packages/hw-app-str/package.json index 4916a475f..1ac1ce5fd 100644 --- a/packages/hw-app-str/package.json +++ b/packages/hw-app-str/package.json @@ -29,6 +29,7 @@ "dependencies": { "@ledgerhq/hw-transport": "^6.11.2", "base32.js": "^0.1.0", + "buffer": "^6.0.3", "sha.js": "^2.3.6", "tweetnacl": "^1.0.3" }, diff --git a/packages/hw-app-str/src/Str.ts b/packages/hw-app-str/src/Str.ts index bcd7a454f..18da3d07c 100644 --- a/packages/hw-app-str/src/Str.ts +++ b/packages/hw-app-str/src/Str.ts @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ********************************************************************************/ +import { Buffer } from "buffer/"; import type Transport from "@ledgerhq/hw-transport"; import { splitPath, diff --git a/packages/hw-app-str/src/utils.ts b/packages/hw-app-str/src/utils.ts index c6f57f77a..817dbfe11 100644 --- a/packages/hw-app-str/src/utils.ts +++ b/packages/hw-app-str/src/utils.ts @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ********************************************************************************/ +import { Buffer } from "buffer/"; import base32 from "base32.js"; import nacl from "tweetnacl"; import { sha256 } from "sha.js"; diff --git a/packages/hw-app-tezos/package.json b/packages/hw-app-tezos/package.json index ce38248d3..2e916ca3b 100644 --- a/packages/hw-app-tezos/package.json +++ b/packages/hw-app-tezos/package.json @@ -30,6 +30,7 @@ "@ledgerhq/hw-transport": "^6.11.2", "blake2b": "^2.1.3", "bs58check": "^2.1.2", + "buffer": "^6.0.3", "invariant": "^2.2.4" }, "scripts": { diff --git a/packages/hw-app-tezos/src/Tezos.ts b/packages/hw-app-tezos/src/Tezos.ts index 333c8a0af..28a439cde 100644 --- a/packages/hw-app-tezos/src/Tezos.ts +++ b/packages/hw-app-tezos/src/Tezos.ts @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ********************************************************************************/ +import { Buffer } from "buffer/"; import invariant from "invariant"; import bs58check from "bs58check"; import blake2b from "blake2b"; diff --git a/packages/hw-app-trx/package.json b/packages/hw-app-trx/package.json index d895b36b7..f35d36671 100644 --- a/packages/hw-app-trx/package.json +++ b/packages/hw-app-trx/package.json @@ -28,7 +28,8 @@ "license": "Apache-2.0", "dependencies": { "@ledgerhq/errors": "^6.10.0", - "@ledgerhq/hw-transport": "^6.11.2" + "@ledgerhq/hw-transport": "^6.11.2", + "buffer": "^6.0.3" }, "scripts": { "clean": "bash ../../script/clean.sh", diff --git a/packages/hw-app-trx/src/Trx.ts b/packages/hw-app-trx/src/Trx.ts index a994e00e4..71b41cadd 100644 --- a/packages/hw-app-trx/src/Trx.ts +++ b/packages/hw-app-trx/src/Trx.ts @@ -18,6 +18,7 @@ import { splitPath, foreach, decodeVarint } from "./utils"; //import { StatusCodes, TransportStatusError } from "@ledgerhq/errors"; import type Transport from "@ledgerhq/hw-transport"; +import { Buffer } from "buffer/"; const remapTransactionRelatedErrors = (e) => { if (e && e.statusCode === 0x6a80) { diff --git a/packages/hw-app-xrp/package.json b/packages/hw-app-xrp/package.json index 68cbecbc4..95f042193 100644 --- a/packages/hw-app-xrp/package.json +++ b/packages/hw-app-xrp/package.json @@ -28,7 +28,8 @@ "license": "Apache-2.0", "dependencies": { "@ledgerhq/hw-transport": "^6.11.2", - "bip32-path": "0.4.2" + "bip32-path": "0.4.2", + "buffer": "^6.0.3" }, "scripts": { "clean": "bash ../../script/clean.sh", diff --git a/packages/hw-app-xrp/src/Xrp.ts b/packages/hw-app-xrp/src/Xrp.ts index ecb171733..4414150c5 100644 --- a/packages/hw-app-xrp/src/Xrp.ts +++ b/packages/hw-app-xrp/src/Xrp.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import type Transport from "@ledgerhq/hw-transport"; import BIPPath from "bip32-path"; /** diff --git a/packages/hw-transport-http/package.json b/packages/hw-transport-http/package.json index c21bb0312..9e49cc05a 100644 --- a/packages/hw-transport-http/package.json +++ b/packages/hw-transport-http/package.json @@ -31,6 +31,7 @@ "@ledgerhq/hw-transport": "^6.11.2", "@ledgerhq/logs": "^6.10.0", "axios": "^0.24.0", + "buffer": "^6.0.3", "ws": "7" }, "scripts": { diff --git a/packages/hw-transport-http/src/HttpTransport.ts b/packages/hw-transport-http/src/HttpTransport.ts index 5d57b2862..1c6685c8f 100644 --- a/packages/hw-transport-http/src/HttpTransport.ts +++ b/packages/hw-transport-http/src/HttpTransport.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import Transport from "@ledgerhq/hw-transport"; import { TransportError } from "@ledgerhq/errors"; import axios from "axios"; diff --git a/packages/hw-transport-http/src/WebSocketTransport.ts b/packages/hw-transport-http/src/WebSocketTransport.ts index 843567d56..3e2278bed 100644 --- a/packages/hw-transport-http/src/WebSocketTransport.ts +++ b/packages/hw-transport-http/src/WebSocketTransport.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import Transport from "@ledgerhq/hw-transport"; import { TransportError } from "@ledgerhq/errors"; import { log } from "@ledgerhq/logs"; diff --git a/packages/hw-transport-mocker/package.json b/packages/hw-transport-mocker/package.json index 0c8164df1..f08c41c8b 100644 --- a/packages/hw-transport-mocker/package.json +++ b/packages/hw-transport-mocker/package.json @@ -26,7 +26,8 @@ "license": "Apache-2.0", "dependencies": { "@ledgerhq/hw-transport": "^6.11.2", - "@ledgerhq/logs": "^6.10.0" + "@ledgerhq/logs": "^6.10.0", + "buffer": "^6.0.3" }, "scripts": { "clean": "bash ../../script/clean.sh", diff --git a/packages/hw-transport-mocker/src/RecordStore.ts b/packages/hw-transport-mocker/src/RecordStore.ts index 38a09828a..4c44f723b 100644 --- a/packages/hw-transport-mocker/src/RecordStore.ts +++ b/packages/hw-transport-mocker/src/RecordStore.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; /** * thrown by the RecordStore.fromString parser. */ diff --git a/packages/hw-transport-node-ble/package.json b/packages/hw-transport-node-ble/package.json index 22784745e..e0018532e 100644 --- a/packages/hw-transport-node-ble/package.json +++ b/packages/hw-transport-node-ble/package.json @@ -33,6 +33,7 @@ "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", "@ledgerhq/logs": "^6.10.0", + "buffer": "^6.0.3", "invariant": "^2.2.4", "rxjs": "6" }, diff --git a/packages/hw-transport-node-ble/src/TransportNodeBle.ts b/packages/hw-transport-node-ble/src/TransportNodeBle.ts index 853bfd8c7..69db595a2 100644 --- a/packages/hw-transport-node-ble/src/TransportNodeBle.ts +++ b/packages/hw-transport-node-ble/src/TransportNodeBle.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import Transport from "@ledgerhq/hw-transport"; import type { DeviceModel } from "@ledgerhq/devices"; import { sendAPDU } from "@ledgerhq/devices/lib/ble/sendAPDU"; diff --git a/packages/hw-transport-node-ble/src/platform.ts b/packages/hw-transport-node-ble/src/platform.ts index bfc44fa75..80102512c 100644 --- a/packages/hw-transport-node-ble/src/platform.ts +++ b/packages/hw-transport-node-ble/src/platform.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import noble, { Characteristic, Service } from "@abandonware/noble"; import { Observable } from "rxjs"; import { log } from "@ledgerhq/logs"; diff --git a/packages/hw-transport-node-hid-noevents/package.json b/packages/hw-transport-node-hid-noevents/package.json index eaef25489..6136d3af1 100644 --- a/packages/hw-transport-node-hid-noevents/package.json +++ b/packages/hw-transport-node-hid-noevents/package.json @@ -31,6 +31,7 @@ "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", "@ledgerhq/logs": "^6.10.0", + "buffer": "^6.0.3", "node-hid": "2.1.1" }, "devDependencies": { diff --git a/packages/hw-transport-node-hid-noevents/src/TransportNodeHid.ts b/packages/hw-transport-node-hid-noevents/src/TransportNodeHid.ts index 539dfcfc8..bbdb557b1 100644 --- a/packages/hw-transport-node-hid-noevents/src/TransportNodeHid.ts +++ b/packages/hw-transport-node-hid-noevents/src/TransportNodeHid.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import HID, { Device } from "node-hid"; import { log } from "@ledgerhq/logs"; import Transport, { diff --git a/packages/hw-transport-node-speculos/package.json b/packages/hw-transport-node-speculos/package.json index bc5a03661..a399ed35b 100644 --- a/packages/hw-transport-node-speculos/package.json +++ b/packages/hw-transport-node-speculos/package.json @@ -31,6 +31,7 @@ "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", "@ledgerhq/logs": "^6.10.0", + "buffer": "^6.0.3", "rxjs": "6" }, "scripts": { diff --git a/packages/hw-transport-node-speculos/src/SpeculosTransport.ts b/packages/hw-transport-node-speculos/src/SpeculosTransport.ts index 56118684a..f7bae5a57 100644 --- a/packages/hw-transport-node-speculos/src/SpeculosTransport.ts +++ b/packages/hw-transport-node-speculos/src/SpeculosTransport.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { Subject } from "rxjs"; import net from "net"; import Transport from "@ledgerhq/hw-transport"; diff --git a/packages/hw-transport-web-ble/package.json b/packages/hw-transport-web-ble/package.json index 24c1cdd59..c8da24082 100644 --- a/packages/hw-transport-web-ble/package.json +++ b/packages/hw-transport-web-ble/package.json @@ -31,6 +31,7 @@ "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", "@ledgerhq/logs": "^6.10.0", + "buffer": "^6.0.3", "rxjs": "6" }, "devDependencies": { diff --git a/packages/hw-transport-web-ble/src/TransportWebBLE.ts b/packages/hw-transport-web-ble/src/TransportWebBLE.ts index dd592687b..5935fe0d3 100644 --- a/packages/hw-transport-web-ble/src/TransportWebBLE.ts +++ b/packages/hw-transport-web-ble/src/TransportWebBLE.ts @@ -1,4 +1,5 @@ /* eslint-disable prefer-template */ +import { Buffer } from "buffer/"; import Transport from "@ledgerhq/hw-transport"; import { DisconnectedDevice, diff --git a/packages/hw-transport-web-ble/src/monitorCharacteristic.ts b/packages/hw-transport-web-ble/src/monitorCharacteristic.ts index cd34a8bf7..9ea4a4098 100644 --- a/packages/hw-transport-web-ble/src/monitorCharacteristic.ts +++ b/packages/hw-transport-web-ble/src/monitorCharacteristic.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { Observable } from "rxjs"; import type { Characteristic } from "./types"; import { log } from "@ledgerhq/logs"; diff --git a/packages/hw-transport-webhid/package.json b/packages/hw-transport-webhid/package.json index da51870fe..9bd3ab82a 100644 --- a/packages/hw-transport-webhid/package.json +++ b/packages/hw-transport-webhid/package.json @@ -29,7 +29,8 @@ "@ledgerhq/devices": "^6.11.2", "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", - "@ledgerhq/logs": "^6.10.0" + "@ledgerhq/logs": "^6.10.0", + "buffer": "^6.0.3" }, "devDependencies": { "@types/w3c-web-hid": "^1.0.2" diff --git a/packages/hw-transport-webhid/src/TransportWebHID.ts b/packages/hw-transport-webhid/src/TransportWebHID.ts index a19723412..47966079a 100644 --- a/packages/hw-transport-webhid/src/TransportWebHID.ts +++ b/packages/hw-transport-webhid/src/TransportWebHID.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import Transport from "@ledgerhq/hw-transport"; import type { Observer, diff --git a/packages/hw-transport-webusb/package.json b/packages/hw-transport-webusb/package.json index 844bf11b9..2b15f3115 100644 --- a/packages/hw-transport-webusb/package.json +++ b/packages/hw-transport-webusb/package.json @@ -29,7 +29,8 @@ "@ledgerhq/devices": "^6.11.2", "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", - "@ledgerhq/logs": "^6.10.0" + "@ledgerhq/logs": "^6.10.0", + "buffer": "^6.0.3" }, "devDependencies": { "@types/w3c-web-usb": "^1.0.5" diff --git a/packages/hw-transport-webusb/src/TransportWebUSB.ts b/packages/hw-transport-webusb/src/TransportWebUSB.ts index 075d2b6fe..86d5b0d6d 100644 --- a/packages/hw-transport-webusb/src/TransportWebUSB.ts +++ b/packages/hw-transport-webusb/src/TransportWebUSB.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import Transport from "@ledgerhq/hw-transport"; import type { Observer, diff --git a/packages/hw-transport/package.json b/packages/hw-transport/package.json index d396ea742..d401ea14b 100644 --- a/packages/hw-transport/package.json +++ b/packages/hw-transport/package.json @@ -27,6 +27,7 @@ "dependencies": { "@ledgerhq/devices": "^6.11.2", "@ledgerhq/errors": "^6.10.0", + "buffer": "^6.0.3", "events": "^3.3.0" }, "scripts": { diff --git a/packages/hw-transport/src/Transport.ts b/packages/hw-transport/src/Transport.ts index d1dd3d396..03917c5ac 100644 --- a/packages/hw-transport/src/Transport.ts +++ b/packages/hw-transport/src/Transport.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import EventEmitter from "events"; import type { DeviceModel } from "@ledgerhq/devices"; import { diff --git a/packages/react-native-hid/package.json b/packages/react-native-hid/package.json index 126016956..66e5317c7 100755 --- a/packages/react-native-hid/package.json +++ b/packages/react-native-hid/package.json @@ -33,6 +33,7 @@ "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", "@ledgerhq/logs": "^6.10.0", + "buffer": "^6.0.3", "rxjs": "6" }, "devDependencies": { diff --git a/packages/react-native-hid/src/index.ts b/packages/react-native-hid/src/index.ts index 3e345d8ea..bee4b5d2a 100644 --- a/packages/react-native-hid/src/index.ts +++ b/packages/react-native-hid/src/index.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { NativeModules, DeviceEventEmitter } from "react-native"; import { ledgerUSBVendorId, identifyUSBProductId } from "@ledgerhq/devices"; import type { DeviceModel } from "@ledgerhq/devices"; diff --git a/packages/react-native-hw-transport-ble/package.json b/packages/react-native-hw-transport-ble/package.json index 7bf3df4c7..e7637d191 100644 --- a/packages/react-native-hw-transport-ble/package.json +++ b/packages/react-native-hw-transport-ble/package.json @@ -29,6 +29,7 @@ "@ledgerhq/errors": "^6.10.0", "@ledgerhq/hw-transport": "^6.11.2", "@ledgerhq/logs": "^6.10.0", + "buffer": "^6.0.3", "invariant": "^2.2.4", "react-native-ble-plx": "2.0.3", "rxjs": "6", diff --git a/packages/react-native-hw-transport-ble/src/BleTransport.ts b/packages/react-native-hw-transport-ble/src/BleTransport.ts index b1e2362e8..b46917167 100644 --- a/packages/react-native-hw-transport-ble/src/BleTransport.ts +++ b/packages/react-native-hw-transport-ble/src/BleTransport.ts @@ -1,4 +1,5 @@ /* eslint-disable prefer-template */ +import { Buffer } from "buffer/"; import Transport from "@ledgerhq/hw-transport"; import { BleManager, diff --git a/packages/react-native-hw-transport-ble/src/monitorCharacteristic.ts b/packages/react-native-hw-transport-ble/src/monitorCharacteristic.ts index f7a56d4d4..7b9ed23b7 100644 --- a/packages/react-native-hw-transport-ble/src/monitorCharacteristic.ts +++ b/packages/react-native-hw-transport-ble/src/monitorCharacteristic.ts @@ -1,3 +1,4 @@ +import { Buffer } from "buffer/"; import { Observable } from "rxjs"; import { TransportError } from "@ledgerhq/errors"; import type { Characteristic } from "./types"; diff --git a/yarn.lock b/yarn.lock index 62371ffa7..29847fd00 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2671,7 +2671,7 @@ base32.js@^0.1.0: resolved "https://registry.yarnpkg.com/base32.js/-/base32.js-0.1.0.tgz#b582dec693c2f11e893cf064ee6ac5b6131a2202" integrity sha1-tYLexpPC8R6JPPBk7mrFthMaIgI= -base64-js@^1.0.2: +base64-js@^1.0.2, base64-js@^1.3.1: version "1.5.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== @@ -3067,6 +3067,14 @@ buffer-xor@^1.0.3: resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" integrity sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk= +buffer@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-6.0.3.tgz#2ace578459cc8fbe2a70aaa8f52ee63b6a74c6c6" + integrity sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.2.1" + buffer@~5.2.1: version "5.2.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.2.1.tgz#dd57fa0f109ac59c602479044dca7b8b3d0b71d6" @@ -5707,6 +5715,11 @@ ieee754@^1.1.4: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84" integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg== +ieee754@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + iferr@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/iferr/-/iferr-0.1.5.tgz#c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501"