@ledgerhq/live-common 34.34.0-nightly.3 → 34.34.0-nightly.5
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/lib/apps/logic.d.ts.map +1 -1
- package/lib/apps/logic.js +2 -1
- package/lib/apps/logic.js.map +1 -1
- package/lib/e2e/index.d.ts +2 -0
- package/lib/e2e/index.d.ts.map +1 -1
- package/lib/errors.d.ts +0 -3
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -2
- package/lib/errors.js.map +1 -1
- package/lib/families/solana/setup.d.ts.map +1 -1
- package/lib/families/solana/setup.js +2 -66
- package/lib/families/solana/setup.js.map +1 -1
- package/lib/families/solana/setup.test.js +12 -10
- package/lib/families/solana/setup.test.js.map +1 -1
- package/lib/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib/featureFlags/defaultFeatures.js +1 -0
- package/lib/featureFlags/defaultFeatures.js.map +1 -1
- package/lib/featureFlags/useFeature.d.ts +1 -1
- package/lib/featureFlags/useFeature.d.ts.map +1 -1
- package/lib/hw/connectApp.d.ts +3 -6
- package/lib/hw/connectApp.d.ts.map +1 -1
- package/lib/hw/connectApp.js +9 -4
- package/lib/hw/connectApp.js.map +1 -1
- package/lib-es/apps/logic.d.ts.map +1 -1
- package/lib-es/apps/logic.js +2 -1
- package/lib-es/apps/logic.js.map +1 -1
- package/lib-es/e2e/index.d.ts +2 -0
- package/lib-es/e2e/index.d.ts.map +1 -1
- package/lib-es/errors.d.ts +0 -3
- package/lib-es/errors.d.ts.map +1 -1
- package/lib-es/errors.js +0 -1
- package/lib-es/errors.js.map +1 -1
- package/lib-es/families/solana/setup.d.ts.map +1 -1
- package/lib-es/families/solana/setup.js +2 -66
- package/lib-es/families/solana/setup.js.map +1 -1
- package/lib-es/families/solana/setup.test.js +12 -10
- package/lib-es/families/solana/setup.test.js.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.d.ts.map +1 -1
- package/lib-es/featureFlags/defaultFeatures.js +1 -0
- package/lib-es/featureFlags/defaultFeatures.js.map +1 -1
- package/lib-es/featureFlags/useFeature.d.ts +1 -1
- package/lib-es/featureFlags/useFeature.d.ts.map +1 -1
- package/lib-es/hw/connectApp.d.ts +3 -6
- package/lib-es/hw/connectApp.d.ts.map +1 -1
- package/lib-es/hw/connectApp.js +7 -3
- package/lib-es/hw/connectApp.js.map +1 -1
- package/package.json +61 -63
- package/src/apps/logic.ts +2 -1
- package/src/errors.ts +0 -4
- package/src/families/solana/setup.test.ts +12 -10
- package/src/families/solana/setup.ts +3 -85
- package/src/featureFlags/defaultFeatures.ts +1 -0
- package/src/hw/connectApp.ts +13 -2
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ledgerhq/live-common",
|
3
3
|
"description": "Common ground for the Ledger Live apps",
|
4
|
-
"version": "34.34.0-nightly.
|
4
|
+
"version": "34.34.0-nightly.5",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
7
7
|
"url": "https://github.com/LedgerHQ/ledger-live.git"
|
@@ -162,74 +162,72 @@
|
|
162
162
|
"xstate": "4.38.3",
|
163
163
|
"yargs": "^17.0.0",
|
164
164
|
"zod": "^3.22.4",
|
165
|
-
"@ledgerhq/coin-
|
166
|
-
"@ledgerhq/coin-
|
167
|
-
"@ledgerhq/coin-
|
168
|
-
"@ledgerhq/coin-
|
169
|
-
"@ledgerhq/coin-
|
170
|
-
"@ledgerhq/coin-celo": "^1.1.4-nightly.
|
171
|
-
"@ledgerhq/coin-cosmos": "^0.14.2-nightly.
|
172
|
-
"@ledgerhq/coin-evm": "^2.21.1-nightly.
|
173
|
-
"@ledgerhq/coin-filecoin": "^1.9.6-nightly.
|
174
|
-
"@ledgerhq/coin-framework": "^5.1.0-nightly.
|
175
|
-
"@ledgerhq/coin-
|
176
|
-
"@ledgerhq/coin-
|
177
|
-
"@ledgerhq/coin-
|
178
|
-
"@ledgerhq/coin-mina": "^1.1.5-nightly.
|
179
|
-
"@ledgerhq/coin-multiversx": "^0.4.6-nightly.
|
180
|
-
"@ledgerhq/coin-near": "^0.11.6-nightly.
|
181
|
-
"@ledgerhq/coin-polkadot": "^6.0.2-nightly.
|
182
|
-
"@ledgerhq/coin-solana": "^0.23.0-nightly.
|
183
|
-
"@ledgerhq/coin-stacks": "^0.8.6-nightly.
|
184
|
-
"@ledgerhq/coin-stellar": "^5.1.0-nightly.
|
185
|
-
"@ledgerhq/coin-
|
186
|
-
"@ledgerhq/coin-
|
187
|
-
"@ledgerhq/coin-ton": "^0.10.1-nightly.
|
188
|
-
"@ledgerhq/coin-tron": "^4.0.1-nightly.
|
189
|
-
"@ledgerhq/coin-vechain": "^2.7.6-nightly.
|
190
|
-
"@ledgerhq/coin-xrp": "^6.1.1-nightly.
|
165
|
+
"@ledgerhq/coin-aptos": "^2.0.0-nightly.4",
|
166
|
+
"@ledgerhq/coin-bitcoin": "^0.15.6-nightly.2",
|
167
|
+
"@ledgerhq/coin-cardano": "^0.8.6-nightly.2",
|
168
|
+
"@ledgerhq/coin-casper": "^1.7.1-nightly.2",
|
169
|
+
"@ledgerhq/coin-algorand": "^0.9.6-nightly.2",
|
170
|
+
"@ledgerhq/coin-celo": "^1.1.4-nightly.2",
|
171
|
+
"@ledgerhq/coin-cosmos": "^0.14.2-nightly.2",
|
172
|
+
"@ledgerhq/coin-evm": "^2.21.1-nightly.2",
|
173
|
+
"@ledgerhq/coin-filecoin": "^1.9.6-nightly.2",
|
174
|
+
"@ledgerhq/coin-framework": "^5.1.0-nightly.2",
|
175
|
+
"@ledgerhq/coin-hedera": "^1.6.6-nightly.2",
|
176
|
+
"@ledgerhq/coin-internet_computer": "^1.7.6-nightly.2",
|
177
|
+
"@ledgerhq/coin-icon": "^0.10.6-nightly.2",
|
178
|
+
"@ledgerhq/coin-mina": "^1.1.5-nightly.2",
|
179
|
+
"@ledgerhq/coin-multiversx": "^0.4.6-nightly.2",
|
180
|
+
"@ledgerhq/coin-near": "^0.11.6-nightly.2",
|
181
|
+
"@ledgerhq/coin-polkadot": "^6.0.2-nightly.2",
|
182
|
+
"@ledgerhq/coin-solana": "^0.23.0-nightly.2",
|
183
|
+
"@ledgerhq/coin-stacks": "^0.8.6-nightly.2",
|
184
|
+
"@ledgerhq/coin-stellar": "^5.1.0-nightly.2",
|
185
|
+
"@ledgerhq/coin-sui": "^0.3.3-nightly.2",
|
186
|
+
"@ledgerhq/coin-tezos": "^5.0.2-nightly.2",
|
187
|
+
"@ledgerhq/coin-ton": "^0.10.1-nightly.2",
|
188
|
+
"@ledgerhq/coin-tron": "^4.0.1-nightly.2",
|
189
|
+
"@ledgerhq/coin-vechain": "^2.7.6-nightly.2",
|
190
|
+
"@ledgerhq/coin-xrp": "^6.1.1-nightly.2",
|
191
191
|
"@ledgerhq/crypto-icons-ui": "^1.14.0-nightly.0",
|
192
192
|
"@ledgerhq/cryptoassets": "^13.17.0-nightly.1",
|
193
|
-
"@ledgerhq/device-core": "^0.4.25-nightly.
|
194
|
-
"@ledgerhq/errors": "^6.
|
195
|
-
"@ledgerhq/
|
196
|
-
"@ledgerhq/hw-app-
|
197
|
-
"@ledgerhq/hw-app-
|
198
|
-
"@ledgerhq/hw-app-
|
199
|
-
"@ledgerhq/
|
200
|
-
"@ledgerhq/hw-app-
|
201
|
-
"@ledgerhq/hw-app-
|
202
|
-
"@ledgerhq/hw-app-
|
203
|
-
"@ledgerhq/hw-app-
|
204
|
-
"@ledgerhq/hw-app-
|
205
|
-
"@ledgerhq/hw-app-
|
206
|
-
"@ledgerhq/hw-app-
|
207
|
-
"@ledgerhq/hw-app-polkadot": "^6.34.1-nightly.
|
208
|
-
"@ledgerhq/hw-app-
|
209
|
-
"@ledgerhq/hw-app-str": "^7.2.1-nightly.0",
|
193
|
+
"@ledgerhq/device-core": "^0.4.25-nightly.2",
|
194
|
+
"@ledgerhq/errors": "^6.21.0-nightly.0",
|
195
|
+
"@ledgerhq/hw-app-algorand": "^6.31.1-nightly.1",
|
196
|
+
"@ledgerhq/hw-app-aptos": "^6.34.1-nightly.1",
|
197
|
+
"@ledgerhq/hw-app-btc": "^10.9.1-nightly.1",
|
198
|
+
"@ledgerhq/hw-app-celo": "^6.33.3-nightly.2",
|
199
|
+
"@ledgerhq/devices": "8.4.5-nightly.2",
|
200
|
+
"@ledgerhq/hw-app-cosmos": "^6.32.1-nightly.1",
|
201
|
+
"@ledgerhq/hw-app-eth": "^6.45.5-nightly.2",
|
202
|
+
"@ledgerhq/hw-app-exchange": "^0.10.1-nightly.1",
|
203
|
+
"@ledgerhq/hw-app-hedera": "^1.2.1-nightly.1",
|
204
|
+
"@ledgerhq/hw-app-icon": "^1.3.1-nightly.1",
|
205
|
+
"@ledgerhq/hw-app-multiversx": "^6.24.1-nightly.1",
|
206
|
+
"@ledgerhq/hw-app-near": "^6.31.1-nightly.1",
|
207
|
+
"@ledgerhq/hw-app-polkadot": "^6.34.1-nightly.1",
|
208
|
+
"@ledgerhq/hw-app-str": "^7.2.1-nightly.1",
|
210
209
|
"@ledgerhq/hw-app-sui": "^1.1.0",
|
211
|
-
"@ledgerhq/hw-app-tezos": "^6.31.1-nightly.
|
212
|
-
"@ledgerhq/hw-app-
|
213
|
-
"@ledgerhq/hw-app-
|
214
|
-
"@ledgerhq/hw-app-xrp": "^6.31.1-nightly.
|
215
|
-
"@ledgerhq/hw-
|
216
|
-
"@ledgerhq/hw-transport": "^6.
|
217
|
-
"@ledgerhq/ledger-cal-service": "^0.4.3-nightly.
|
210
|
+
"@ledgerhq/hw-app-tezos": "^6.31.1-nightly.1",
|
211
|
+
"@ledgerhq/hw-app-vet": "^0.5.3-nightly.2",
|
212
|
+
"@ledgerhq/hw-app-trx": "^6.31.1-nightly.1",
|
213
|
+
"@ledgerhq/hw-app-xrp": "^6.31.1-nightly.1",
|
214
|
+
"@ledgerhq/hw-transport": "^6.31.5-nightly.2",
|
215
|
+
"@ledgerhq/hw-transport-mocker": "^6.29.5-nightly.2",
|
216
|
+
"@ledgerhq/ledger-cal-service": "^0.4.3-nightly.1",
|
218
217
|
"@ledgerhq/live-config": "^3.1.0",
|
219
|
-
"@ledgerhq/live-countervalues": "^0.5.6-nightly.
|
220
|
-
"@ledgerhq/
|
221
|
-
"@ledgerhq/live-countervalues-react": "^0.2.35-nightly.0",
|
222
|
-
"@ledgerhq/hw-transport-mocker": "^6.29.5-nightly.1",
|
218
|
+
"@ledgerhq/live-countervalues": "^0.5.6-nightly.2",
|
219
|
+
"@ledgerhq/live-countervalues-react": "^0.2.35-nightly.2",
|
223
220
|
"@ledgerhq/live-env": "^2.9.0-nightly.0",
|
224
221
|
"@ledgerhq/live-hooks": "0.1.0",
|
225
|
-
"@ledgerhq/live-network": "^2.0.8-nightly.
|
226
|
-
"@ledgerhq/live-nft": "^0.8.6-nightly.
|
222
|
+
"@ledgerhq/live-network": "^2.0.8-nightly.1",
|
223
|
+
"@ledgerhq/live-nft": "^0.8.6-nightly.2",
|
227
224
|
"@ledgerhq/live-promise": "^0.1.0",
|
228
|
-
"@ledgerhq/live-signer-
|
229
|
-
"@ledgerhq/live-
|
225
|
+
"@ledgerhq/live-signer-solana": "^0.1.1-nightly.1",
|
226
|
+
"@ledgerhq/live-signer-evm": "^0.4.1-nightly.2",
|
227
|
+
"@ledgerhq/live-wallet": "^0.10.9-nightly.2",
|
230
228
|
"@ledgerhq/logs": "^6.12.0",
|
229
|
+
"@ledgerhq/speculos-transport": "^0.2.1-nightly.1",
|
231
230
|
"@ledgerhq/wallet-api-acre-module": "^0.5.0",
|
232
|
-
"@ledgerhq/speculos-transport": "^0.2.1-nightly.0",
|
233
231
|
"@ledgerhq/wallet-api-exchange-module": "^0.13.0"
|
234
232
|
},
|
235
233
|
"devDependencies": {
|
@@ -278,10 +276,10 @@
|
|
278
276
|
"undici": "6.19.2",
|
279
277
|
"uuid": "^8.3.2",
|
280
278
|
"ws": "7",
|
281
|
-
"@ledgerhq/device-react": "^0.2.31-nightly.
|
282
|
-
"@ledgerhq/types-cryptoassets": "^7.23.0",
|
279
|
+
"@ledgerhq/device-react": "^0.2.31-nightly.2",
|
283
280
|
"@ledgerhq/types-devices": "^6.25.3",
|
284
|
-
"@ledgerhq/types-live": "^6.71.0-nightly.
|
281
|
+
"@ledgerhq/types-live": "^6.71.0-nightly.1",
|
282
|
+
"@ledgerhq/types-cryptoassets": "^7.23.0"
|
285
283
|
},
|
286
284
|
"scripts": {
|
287
285
|
"build": "zx ./scripts/build-ts.mjs",
|
package/src/apps/logic.ts
CHANGED
@@ -5,9 +5,10 @@ import semver from "semver";
|
|
5
5
|
import { getDeviceModel } from "@ledgerhq/devices";
|
6
6
|
import { AppOp, State, Action, ListAppsResult, AppsDistribution, SkipReason } from "./types";
|
7
7
|
import { findCryptoCurrency, findCryptoCurrencyById, isCurrencySupported } from "../currencies";
|
8
|
-
import {
|
8
|
+
import { NoSuchAppOnProvider } from "../errors";
|
9
9
|
import { App } from "@ledgerhq/types-live";
|
10
10
|
import { getEnv } from "@ledgerhq/live-env";
|
11
|
+
import { LatestFirmwareVersionRequired } from "@ledgerhq/errors";
|
11
12
|
|
12
13
|
export const initState = (
|
13
14
|
{ deviceModelId, appsListNames, installed, appByName, ...listAppsResult }: ListAppsResult,
|
package/src/errors.ts
CHANGED
@@ -7,10 +7,6 @@ export const GetAppAndVersionUnsupportedFormat = createCustomErrorClass(
|
|
7
7
|
"GetAppAndVersionUnsupportedFormat",
|
8
8
|
);
|
9
9
|
|
10
|
-
export const LatestFirmwareVersionRequired = createCustomErrorClass(
|
11
|
-
"LatestFirmwareVersionRequired",
|
12
|
-
);
|
13
|
-
|
14
10
|
export const FeeEstimationFailed = createCustomErrorClass("FeeEstimationFailed");
|
15
11
|
export const TransactionRefusedOnDevice = createCustomErrorClass("TransactionRefusedOnDevice");
|
16
12
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
1
|
+
import { LegacySignerSolana } from "@ledgerhq/live-signer-solana";
|
2
2
|
import Transport from "@ledgerhq/hw-transport";
|
3
3
|
import { Account, AnyMessage } from "@ledgerhq/types-live";
|
4
4
|
import { PubKeyDisplayMode } from "@ledgerhq/coin-solana/signer";
|
@@ -29,20 +29,22 @@ const signOffchainMessageMock = jest.fn(() =>
|
|
29
29
|
}),
|
30
30
|
);
|
31
31
|
|
32
|
-
jest.mock("@ledgerhq/
|
33
|
-
return
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
32
|
+
jest.mock("@ledgerhq/live-signer-solana", () => {
|
33
|
+
return {
|
34
|
+
LegacySignerSolana: jest.fn().mockImplementation(() => {
|
35
|
+
return {
|
36
|
+
signMessage: signOffchainMessageMock,
|
37
|
+
getAppConfiguration: getAppConfigurationMock,
|
38
|
+
};
|
39
|
+
}),
|
40
|
+
};
|
39
41
|
});
|
40
42
|
|
41
43
|
LiveConfig.setConfig(solanaConfig);
|
42
44
|
|
43
45
|
describe("Testing setup on Solana", () => {
|
44
46
|
describe("Testing message signer", () => {
|
45
|
-
it("should call
|
47
|
+
it("should call the underlying signer for off-chain message signature", async () => {
|
46
48
|
const freshAddressPath = "44'/60'/0'/0/0";
|
47
49
|
const freshAddress = "8DpKDisipx6f76cEmuGvCX9TrA3SjeR76HaTRePxHBDe";
|
48
50
|
const message = "4c6f6e67204f66662d436861696e2054657374204d6573736167652e";
|
@@ -52,7 +54,7 @@ describe("Testing setup on Solana", () => {
|
|
52
54
|
{ message: message } as AnyMessage,
|
53
55
|
);
|
54
56
|
|
55
|
-
expect(
|
57
|
+
expect(LegacySignerSolana).toHaveBeenCalledTimes(1);
|
56
58
|
expect(signOffchainMessageMock).toHaveBeenCalledTimes(1);
|
57
59
|
|
58
60
|
const args = signOffchainMessageMock.mock.calls[0] as unknown[];
|
@@ -1,7 +1,5 @@
|
|
1
1
|
// Goal of this file is to inject all necessary device/signer dependency to coin-modules
|
2
2
|
|
3
|
-
import semver from "semver";
|
4
|
-
import Solana from "@ledgerhq/hw-app-solana";
|
5
3
|
import Transport from "@ledgerhq/hw-transport";
|
6
4
|
import type { Bridge } from "@ledgerhq/types-live";
|
7
5
|
import { SolanaSigner } from "@ledgerhq/coin-solana/signer";
|
@@ -9,101 +7,21 @@ import { createBridges } from "@ledgerhq/coin-solana/bridge/js";
|
|
9
7
|
import makeCliTools from "@ledgerhq/coin-solana/cli-transaction";
|
10
8
|
import solanaResolver from "@ledgerhq/coin-solana/hw-getAddress";
|
11
9
|
import { SolanaAccount, Transaction, TransactionStatus } from "@ledgerhq/coin-solana/types";
|
12
|
-
import { DeviceModelId } from "@ledgerhq/devices";
|
13
|
-
import { loadPKI } from "@ledgerhq/hw-bolos";
|
14
|
-
import calService from "@ledgerhq/ledger-cal-service";
|
15
|
-
import trustService from "@ledgerhq/ledger-trust-service";
|
16
|
-
import { TransportStatusError, UpdateYourApp } from "@ledgerhq/errors";
|
17
10
|
import {
|
18
11
|
CreateSigner,
|
19
12
|
createMessageSigner,
|
20
13
|
createResolver,
|
21
14
|
executeWithSigner,
|
22
15
|
} from "../../bridge/setup";
|
23
|
-
import { LatestFirmwareVersionRequired } from "../../errors";
|
24
16
|
import type { Resolver } from "../../hw/getAddress/types";
|
25
17
|
import { getCurrencyConfiguration } from "../../config";
|
26
18
|
import { SolanaCoinConfig } from "@ledgerhq/coin-solana/config";
|
27
19
|
import { getCryptoCurrencyById } from "../../currencies";
|
28
20
|
import { signMessage } from "@ledgerhq/coin-solana/hw-signMessage";
|
21
|
+
import { LegacySignerSolana } from "@ledgerhq/live-signer-solana";
|
29
22
|
|
30
|
-
const
|
31
|
-
|
32
|
-
|
33
|
-
async function checkVersion(app: Solana) {
|
34
|
-
const { version } = await app.getAppConfiguration();
|
35
|
-
if (semver.lt(version, TRUSTED_NAME_MIN_VERSION)) {
|
36
|
-
throw new UpdateYourApp(undefined, {
|
37
|
-
managerAppName: MANAGER_APP_NAME,
|
38
|
-
});
|
39
|
-
}
|
40
|
-
}
|
41
|
-
|
42
|
-
function isPKIUnsupportedError(err: unknown): err is TransportStatusError {
|
43
|
-
return err instanceof TransportStatusError && err.message.includes("0x6a81");
|
44
|
-
}
|
45
|
-
|
46
|
-
const createSigner: CreateSigner<SolanaSigner> = (transport: Transport) => {
|
47
|
-
const app = new Solana(transport);
|
48
|
-
return {
|
49
|
-
getAppConfiguration: app.getAppConfiguration,
|
50
|
-
getAddress: app.getAddress,
|
51
|
-
signTransaction: async (path, tx, resolution) => {
|
52
|
-
if (resolution) {
|
53
|
-
if (!resolution.deviceModelId) {
|
54
|
-
throw new Error("Resolution provided without a deviceModelId");
|
55
|
-
}
|
56
|
-
|
57
|
-
if (resolution.deviceModelId !== DeviceModelId.nanoS) {
|
58
|
-
const { descriptor, signature } = await calService.getCertificate(
|
59
|
-
resolution.deviceModelId,
|
60
|
-
);
|
61
|
-
|
62
|
-
try {
|
63
|
-
await loadPKI(transport, "TRUSTED_NAME", descriptor, signature);
|
64
|
-
} catch (err) {
|
65
|
-
if (isPKIUnsupportedError(err)) {
|
66
|
-
throw new LatestFirmwareVersionRequired("LatestFirmwareVersionRequired");
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
if (resolution.tokenAddress) {
|
71
|
-
await checkVersion(app);
|
72
|
-
|
73
|
-
const challenge = await app.getChallenge();
|
74
|
-
const { signedDescriptor } = await trustService.getOwnerAddress(
|
75
|
-
resolution.tokenAddress,
|
76
|
-
challenge,
|
77
|
-
);
|
78
|
-
|
79
|
-
if (signedDescriptor) {
|
80
|
-
await app.provideTrustedName(signedDescriptor);
|
81
|
-
}
|
82
|
-
}
|
83
|
-
if (resolution.createATA) {
|
84
|
-
await checkVersion(app);
|
85
|
-
|
86
|
-
const challenge = await app.getChallenge();
|
87
|
-
const { signedDescriptor } = await trustService.computedTokenAddress(
|
88
|
-
resolution.createATA.address,
|
89
|
-
resolution.createATA.mintAddress,
|
90
|
-
challenge,
|
91
|
-
);
|
92
|
-
|
93
|
-
if (signedDescriptor) {
|
94
|
-
await app.provideTrustedName(signedDescriptor);
|
95
|
-
}
|
96
|
-
}
|
97
|
-
}
|
98
|
-
}
|
99
|
-
|
100
|
-
return app.signTransaction(path, tx);
|
101
|
-
},
|
102
|
-
signMessage: (path: string, messageHex: string) => {
|
103
|
-
return app.signOffchainMessage(path, Buffer.from(messageHex, "hex"));
|
104
|
-
},
|
105
|
-
};
|
106
|
-
};
|
23
|
+
const createSigner: CreateSigner<SolanaSigner> = (transport: Transport) =>
|
24
|
+
new LegacySignerSolana(transport);
|
107
25
|
|
108
26
|
const getCurrencyConfig = () => {
|
109
27
|
return getCurrencyConfiguration<SolanaCoinConfig>(getCryptoCurrencyById("solana"));
|
package/src/hw/connectApp.ts
CHANGED
@@ -11,6 +11,7 @@ import {
|
|
11
11
|
DisconnectedDevice,
|
12
12
|
StatusCodes,
|
13
13
|
LockedDeviceError,
|
14
|
+
LatestFirmwareVersionRequired,
|
14
15
|
} from "@ledgerhq/errors";
|
15
16
|
import type Transport from "@ledgerhq/hw-transport";
|
16
17
|
import { type DerivationMode, DeviceInfo, FirmwareUpdateContext } from "@ledgerhq/types-live";
|
@@ -25,7 +26,6 @@ import getDeviceInfo from "./getDeviceInfo";
|
|
25
26
|
import getAddress from "./getAddress";
|
26
27
|
import openApp from "./openApp";
|
27
28
|
import quitApp from "./quitApp";
|
28
|
-
import { LatestFirmwareVersionRequired } from "../errors";
|
29
29
|
import { mustUpgrade } from "../apps";
|
30
30
|
import isUpdateAvailable from "./isUpdateAvailable";
|
31
31
|
import { LockedDeviceEvent } from "./actions/types";
|
@@ -479,4 +479,15 @@ const cmd = ({ deviceId, request }: Input): Observable<ConnectAppEvent> => {
|
|
479
479
|
);
|
480
480
|
};
|
481
481
|
|
482
|
-
export default
|
482
|
+
export default function connectAppFactory(
|
483
|
+
{
|
484
|
+
isLdmkConnectAppEnabled,
|
485
|
+
}: {
|
486
|
+
isLdmkConnectAppEnabled: boolean;
|
487
|
+
} = { isLdmkConnectAppEnabled: false },
|
488
|
+
) {
|
489
|
+
if (!isLdmkConnectAppEnabled) {
|
490
|
+
return cmd;
|
491
|
+
}
|
492
|
+
throw new Error("LdkmConnectApp is not supported yet");
|
493
|
+
}
|