@shapeshiftoss/hdwallet-ledger 1.62.30 → 1.62.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tron.d.ts.map +1 -1
- package/dist/tron.js +32 -0
- package/dist/tron.js.map +1 -1
- package/package.json +3 -3
package/dist/tron.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tron.d.ts","sourceRoot":"","sources":["../src/tron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,wBAAsB,cAAc,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAO1G;
|
|
1
|
+
{"version":3,"file":"tron.d.ts","sourceRoot":"","sources":["../src/tron.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,wBAAsB,cAAc,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAO1G;AAwBD,wBAAsB,UAAU,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,EAAE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CA4B7G;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAO9F;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,GAAG,SAAS,CAa/F"}
|
package/dist/tron.js
CHANGED
|
@@ -46,9 +46,41 @@ function tronGetAddress(transport, msg) {
|
|
|
46
46
|
return res.payload.address;
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* Detects if a TRON transaction contains a memo in the raw_data.data field
|
|
51
|
+
* by checking for protobuf field 10 (wire type 2 for bytes) = 0x52
|
|
52
|
+
*/
|
|
53
|
+
function transactionHasMemo(rawDataHex) {
|
|
54
|
+
try {
|
|
55
|
+
const buffer = Buffer.from(rawDataHex, "hex");
|
|
56
|
+
// Search for field 10 with wire type 2 (bytes)
|
|
57
|
+
// Field number 10, wire type 2 (length-delimited) = (10 << 3) | 2 = 0x52
|
|
58
|
+
for (let i = 0; i < buffer.length - 1; i++) {
|
|
59
|
+
if (buffer[i] === 0x52) {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
49
69
|
function tronSignTx(transport, msg) {
|
|
50
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
71
|
const bip32path = core.addressNListToBIP32(msg.addressNList);
|
|
72
|
+
// Check if transaction has memo and validate Ledger app configuration
|
|
73
|
+
const hasMemo = transactionHasMemo(msg.rawDataHex);
|
|
74
|
+
if (hasMemo) {
|
|
75
|
+
const configRes = yield transport.call("Tron", "getAppConfiguration");
|
|
76
|
+
(0, utils_1.handleError)(configRes, transport, "Unable to get Tron app configuration from device.");
|
|
77
|
+
const { allowData } = configRes.payload;
|
|
78
|
+
if (!allowData) {
|
|
79
|
+
const error = new Error("Please enable Transactions Data in your Ledger TRON app settings and try again.");
|
|
80
|
+
error.name = "LedgerTronAllowDataDisabled";
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
52
84
|
const res = yield transport.call("Tron", "signTransaction", bip32path, msg.rawDataHex, []);
|
|
53
85
|
(0, utils_1.handleError)(res, transport, "Unable to sign Tron transaction.");
|
|
54
86
|
const signature = res.payload;
|
package/dist/tron.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tron.js","sourceRoot":"","sources":["../src/tron.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wCAOC;
|
|
1
|
+
{"version":3,"file":"tron.js","sourceRoot":"","sources":["../src/tron.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wCAOC;AAwBD,gCA4BC;AAED,kDAOC;AAED,kDAaC;AAxFD,mEAAqD;AAGrD,mCAAsC;AAEtC,SAAsB,cAAc,CAAC,SAA0B,EAAE,GAAwB;;QACvF,MAAM,SAAS,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAE7D,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACrF,IAAA,mBAAW,EAAC,GAAG,EAAE,SAAS,EAAE,4CAA4C,CAAC,CAAC;QAE1E,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;IAC7B,CAAC;CAAA;AAED;;;GAGG;AACH,SAAS,kBAAkB,CAAC,UAAkB;IAC5C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAE9C,+CAA+C;QAC/C,yEAAyE;QACzE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;gBACvB,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OA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E,UAAU,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;SACxF;KACF,CAAC;AACJ,CAAC;AAED,SAAgB,mBAAmB,CAAC,GAAyB;IAC3D,MAAM,YAAY,GAAG,GAAG,CAAC,YAAY,CAAC;IACtC,IACE,YAAY,CAAC,CAAC,CAAC,KAAK,UAAU,GAAG,EAAE;QACnC,YAAY,CAAC,CAAC,CAAC,KAAK,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;QAC1D,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC;QACrB,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,EACrB,CAAC;QACD,OAAO;YACL,YAAY,EAAE,CAAC,UAAU,GAAG,EAAE,EAAE,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;SACnG,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshiftoss/hdwallet-ledger",
|
|
3
|
-
"version": "1.62.
|
|
3
|
+
"version": "1.62.31",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@ledgerhq/logs": "6.13.0",
|
|
29
29
|
"@mysten/ledgerjs-hw-app-sui": "^0.7.0",
|
|
30
30
|
"@shapeshiftoss/bitcoinjs-lib": "7.0.0-shapeshift.2",
|
|
31
|
-
"@shapeshiftoss/hdwallet-core": "1.62.
|
|
31
|
+
"@shapeshiftoss/hdwallet-core": "1.62.31",
|
|
32
32
|
"@solana/web3.js": "1.95.8",
|
|
33
33
|
"base64-js": "^1.5.1",
|
|
34
34
|
"bchaddrjs": "^0.4.4",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@types/ripemd160": "^2.0.2",
|
|
47
47
|
"typedoc": "^0.20.36"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "a462b5641275a93b04353bc9688380015f237699"
|
|
50
50
|
}
|