@ledgerhq/live-cli 24.18.2-nightly.3 → 24.18.2-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/cli.js +633 -622
- package/package.json +2 -2
package/lib/cli.js
CHANGED
|
@@ -187,7 +187,7 @@ function getAltStatusMessage(code) {
|
|
|
187
187
|
return "Internal error, please report";
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
-
var AccountNameRequiredError, AccountNotSupported, AccountAwaitingSendPendingOperations, AmountRequired, BluetoothRequired, BtcUnmatchedApp, CantOpenDevice, CashAddrNotSupported, ClaimRewardsFeesWarning, CurrencyNotSupported, DeviceAppVerifyNotSupported, DeviceGenuineSocketEarlyClose, DeviceNotGenuineError, DeviceOnDashboardExpected, DeviceOnDashboardUnexpected, DeviceInOSUExpected, DeviceHalted, DeviceNameInvalid, DeviceSocketFail, DeviceSocketNoBulkStatus, DeviceNeedsRestart, UnresponsiveDeviceError, DisconnectedDevice, DisconnectedDeviceDuringOperation, DeviceExtractOnboardingStateError, DeviceOnboardingStatePollingError, EnpointConfigError, EthAppPleaseEnableContractData, FeeEstimationFailed, FirmwareNotRecognized, HardResetFail, InvalidXRPTag, InvalidAddress, InvalidNonce, InvalidAddressBecauseDestinationIsAlsoSource, LatestMCUInstalledError, UnknownMCU, LedgerAPIError, LedgerAPIErrorWithMessage, LedgerAPINotAvailable, ManagerAppAlreadyInstalledError, ManagerAppRelyOnBTCError, ManagerAppDepInstallRequired, ManagerAppDepUninstallRequired, ManagerDeviceLockedError, ManagerFirmwareNotEnoughSpaceError, ManagerNotEnoughSpaceError, ManagerUninstallBTCDep, NetworkDown, NetworkError, NoAddressesFound, NotEnoughBalance, NotEnoughBalanceFees, NotEnoughBalanceSwap, NotEnoughBalanceToDelegate, NotEnoughBalanceInParentAccount, NotEnoughSpendableBalance, NotEnoughBalanceBecauseDestinationNotCreated, NoAccessToCamera, NotEnoughGas, NotEnoughGasSwap, TronEmptyAccount, MaybeKeepTronAccountAlive, NotSupportedLegacyAddress, GasLessThanEstimate, PriorityFeeTooLow, PriorityFeeTooHigh, PriorityFeeHigherThanMaxFee, MaxFeeTooLow, PasswordsDontMatchError, PasswordIncorrectError, RecommendSubAccountsToEmpty, RecommendUndelegation, TimeoutTagged, UnexpectedBootloader, MCUNotGenuineToDashboard, RecipientRequired, UnavailableTezosOriginatedAccountReceive, UnavailableTezosOriginatedAccountSend, UpdateFetchFileFail, UpdateIncorrectHash, UpdateIncorrectSig, UpdateYourApp, UserRefusedDeviceNameChange, UserRefusedAddress, UserRefusedFirmwareUpdate, UserRefusedAllowManager, UserRefusedOnDevice, PinNotSet, ExpertModeRequired, TransportOpenUserCancelled, TransportInterfaceNotAvailable, TransportRaceCondition, TransportWebUSBGestureRequired, TransactionHasBeenValidatedError, TransportExchangeTimeoutError, DeviceShouldStayInApp, WebsocketConnectionError, WebsocketConnectionFailed, WrongDeviceForAccount, WrongDeviceForAccountPayout, WrongDeviceForAccountRefund, WrongAppForCurrency, ETHAddressNonEIP, CantScanQRCode, FeeNotLoaded, FeeNotLoadedSwap, FeeRequired, FeeTooHigh, PendingOperation, SyncError, PairingFailed, PeerRemovedPairing, GenuineCheckFailed, LedgerAPI4xx, LedgerAPI5xx, FirmwareOrAppUpdateRequired, ReplacementTransactionUnderpriced, OpReturnDataSizeLimit, DustLimit, LanguageNotFound, NoDBPathGiven, DBWrongPassword, DBNotReset, SequenceNumberError, DisabledTransactionBroadcastError, HwTransportErrorType, TransportError, StatusCodes, TransportStatusError, LockedDeviceError;
|
|
190
|
+
var AccountNameRequiredError, AccountNotSupported, AccountAwaitingSendPendingOperations, AmountRequired, BluetoothRequired, BtcUnmatchedApp, CantOpenDevice, CashAddrNotSupported, ClaimRewardsFeesWarning, CurrencyNotSupported, DeviceAppVerifyNotSupported, DeviceGenuineSocketEarlyClose, DeviceNotGenuineError, DeviceOnDashboardExpected, DeviceOnDashboardUnexpected, DeviceInOSUExpected, DeviceHalted, DeviceNameInvalid, DeviceSocketFail, DeviceSocketNoBulkStatus, DeviceNeedsRestart, UnresponsiveDeviceError, DisconnectedDevice, DisconnectedDeviceDuringOperation, DeviceExtractOnboardingStateError, DeviceOnboardingStatePollingError, EnpointConfigError, EthAppPleaseEnableContractData, FeeEstimationFailed, FirmwareNotRecognized, HardResetFail, InvalidXRPTag, InvalidAddress, InvalidNonce, InvalidAddressBecauseDestinationIsAlsoSource, LatestMCUInstalledError, LatestFirmwareVersionRequired, UnknownMCU, LedgerAPIError, LedgerAPIErrorWithMessage, LedgerAPINotAvailable, ManagerAppAlreadyInstalledError, ManagerAppRelyOnBTCError, ManagerAppDepInstallRequired, ManagerAppDepUninstallRequired, ManagerDeviceLockedError, ManagerFirmwareNotEnoughSpaceError, ManagerNotEnoughSpaceError, ManagerUninstallBTCDep, NetworkDown, NetworkError, NoAddressesFound, NotEnoughBalance, NotEnoughBalanceFees, NotEnoughBalanceSwap, NotEnoughBalanceToDelegate, NotEnoughBalanceInParentAccount, NotEnoughSpendableBalance, NotEnoughBalanceBecauseDestinationNotCreated, NoAccessToCamera, NotEnoughGas, NotEnoughGasSwap, TronEmptyAccount, MaybeKeepTronAccountAlive, NotSupportedLegacyAddress, GasLessThanEstimate, PriorityFeeTooLow, PriorityFeeTooHigh, PriorityFeeHigherThanMaxFee, MaxFeeTooLow, PasswordsDontMatchError, PasswordIncorrectError, RecommendSubAccountsToEmpty, RecommendUndelegation, TimeoutTagged, UnexpectedBootloader, MCUNotGenuineToDashboard, RecipientRequired, UnavailableTezosOriginatedAccountReceive, UnavailableTezosOriginatedAccountSend, UpdateFetchFileFail, UpdateIncorrectHash, UpdateIncorrectSig, UpdateYourApp, UserRefusedDeviceNameChange, UserRefusedAddress, UserRefusedFirmwareUpdate, UserRefusedAllowManager, UserRefusedOnDevice, PinNotSet, ExpertModeRequired, TransportOpenUserCancelled, TransportInterfaceNotAvailable, TransportRaceCondition, TransportWebUSBGestureRequired, TransactionHasBeenValidatedError, TransportExchangeTimeoutError, DeviceShouldStayInApp, WebsocketConnectionError, WebsocketConnectionFailed, WrongDeviceForAccount, WrongDeviceForAccountPayout, WrongDeviceForAccountRefund, WrongAppForCurrency, ETHAddressNonEIP, CantScanQRCode, FeeNotLoaded, FeeNotLoadedSwap, FeeRequired, FeeTooHigh, PendingOperation, SyncError, PairingFailed, PeerRemovedPairing, GenuineCheckFailed, LedgerAPI4xx, LedgerAPI5xx, FirmwareOrAppUpdateRequired, ReplacementTransactionUnderpriced, OpReturnDataSizeLimit, DustLimit, LanguageNotFound, NoDBPathGiven, DBWrongPassword, DBNotReset, SequenceNumberError, DisabledTransactionBroadcastError, HwTransportErrorType, TransportError, StatusCodes, TransportStatusError, LockedDeviceError;
|
|
191
191
|
var init_lib_es = __esm({
|
|
192
192
|
"../../libs/ledgerjs/packages/errors/lib-es/index.js"() {
|
|
193
193
|
"use strict";
|
|
@@ -228,6 +228,7 @@ var init_lib_es = __esm({
|
|
|
228
228
|
InvalidNonce = createCustomErrorClass("InvalidNonce");
|
|
229
229
|
InvalidAddressBecauseDestinationIsAlsoSource = createCustomErrorClass("InvalidAddressBecauseDestinationIsAlsoSource");
|
|
230
230
|
LatestMCUInstalledError = createCustomErrorClass("LatestMCUInstalledError");
|
|
231
|
+
LatestFirmwareVersionRequired = createCustomErrorClass("LatestFirmwareVersionRequired");
|
|
231
232
|
UnknownMCU = createCustomErrorClass("UnknownMCU");
|
|
232
233
|
LedgerAPIError = createCustomErrorClass("LedgerAPIError");
|
|
233
234
|
LedgerAPIErrorWithMessage = createCustomErrorClass("LedgerAPIErrorWithMessage");
|
|
@@ -416627,11 +416628,11 @@ var require_object_hash = __commonJS({
|
|
|
416627
416628
|
});
|
|
416628
416629
|
|
|
416629
416630
|
// ../../libs/ledgerjs/packages/devices/lib-es/index.js
|
|
416630
|
-
var
|
|
416631
|
+
var import_semver12, DeviceModelId, devices, productMap, devicesList, ledgerUSBVendorId, getDeviceModel, identifyTargetId, identifyUSBProductId, identifyProductName, bluetoothServices, serviceUuidToInfos;
|
|
416631
416632
|
var init_lib_es5 = __esm({
|
|
416632
416633
|
"../../libs/ledgerjs/packages/devices/lib-es/index.js"() {
|
|
416633
416634
|
"use strict";
|
|
416634
|
-
|
|
416635
|
+
import_semver12 = __toESM(require_semver2());
|
|
416635
416636
|
(function(DeviceModelId3) {
|
|
416636
416637
|
DeviceModelId3["blue"] = "blue";
|
|
416637
416638
|
DeviceModelId3["nanoS"] = "nanoS";
|
|
@@ -416659,7 +416660,7 @@ var init_lib_es5 = __esm({
|
|
|
416659
416660
|
usbOnly: true,
|
|
416660
416661
|
memorySize: 320 * 1024,
|
|
416661
416662
|
masks: [823132160],
|
|
416662
|
-
getBlockSize: (firmwareVersion) =>
|
|
416663
|
+
getBlockSize: (firmwareVersion) => import_semver12.default.lt(import_semver12.default.coerce(firmwareVersion) ?? "", "2.0.0") ? 4 * 1024 : 2 * 1024
|
|
416663
416664
|
},
|
|
416664
416665
|
[DeviceModelId.nanoX]: {
|
|
416665
416666
|
id: DeviceModelId.nanoX,
|
|
@@ -416792,7 +416793,7 @@ var init_config = __esm({
|
|
|
416792
416793
|
});
|
|
416793
416794
|
|
|
416794
416795
|
// ../../node_modules/.pnpm/@stacks+common@6.16.0/node_modules/@stacks/common/dist/esm/errors.js
|
|
416795
|
-
var ERROR_CODES, BlockstackError, InvalidParameterError, MissingParameterError, RemoteServiceError, InvalidDIDError, NotEnoughFundsError, InvalidAmountError, LoginFailedError, SignatureVerificationError, FailedDecryptionError, InvalidStateError, NoSessionDataError, GaiaHubError, DoesNotExist, ConflictError, NotEnoughProofError, BadPathError,
|
|
416796
|
+
var ERROR_CODES, BlockstackError, InvalidParameterError, MissingParameterError, RemoteServiceError, InvalidDIDError, NotEnoughFundsError, InvalidAmountError, LoginFailedError, SignatureVerificationError, FailedDecryptionError, InvalidStateError, NoSessionDataError, GaiaHubError, DoesNotExist, ConflictError, NotEnoughProofError, BadPathError, ValidationError, PayloadTooLargeError, PreconditionFailedError;
|
|
416796
416797
|
var init_errors3 = __esm({
|
|
416797
416798
|
"../../node_modules/.pnpm/@stacks+common@6.16.0/node_modules/@stacks/common/dist/esm/errors.js"() {
|
|
416798
416799
|
"use strict";
|
|
@@ -416967,7 +416968,7 @@ ${bugDetails}`;
|
|
|
416967
416968
|
this.name = "BadPathError";
|
|
416968
416969
|
}
|
|
416969
416970
|
};
|
|
416970
|
-
|
|
416971
|
+
ValidationError = class extends GaiaHubError {
|
|
416971
416972
|
constructor(message2, response) {
|
|
416972
416973
|
super({ message: message2, code: ERROR_CODES.VALIDATION_ERROR }, response);
|
|
416973
416974
|
this.name = "ValidationError";
|
|
@@ -417541,7 +417542,7 @@ __export(esm_exports4, {
|
|
|
417541
417542
|
RemoteServiceError: () => RemoteServiceError,
|
|
417542
417543
|
SignatureVerificationError: () => SignatureVerificationError,
|
|
417543
417544
|
TransactionVersion: () => TransactionVersion,
|
|
417544
|
-
ValidationError: () =>
|
|
417545
|
+
ValidationError: () => ValidationError,
|
|
417545
417546
|
alloc: () => alloc2,
|
|
417546
417547
|
asciiToBytes: () => asciiToBytes,
|
|
417547
417548
|
bigIntToBytes: () => bigIntToBytes2,
|
|
@@ -530283,7 +530284,7 @@ var require_package8 = __commonJS({
|
|
|
530283
530284
|
module2.exports = {
|
|
530284
530285
|
name: "@ledgerhq/live-common",
|
|
530285
530286
|
description: "Common ground for the Ledger Live apps",
|
|
530286
|
-
version: "34.34.0-nightly.
|
|
530287
|
+
version: "34.34.0-nightly.5",
|
|
530287
530288
|
repository: {
|
|
530288
530289
|
type: "git",
|
|
530289
530290
|
url: "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -530452,18 +530453,15 @@ var require_package8 = __commonJS({
|
|
|
530452
530453
|
"@ledgerhq/hw-app-multiversx": "workspace:^",
|
|
530453
530454
|
"@ledgerhq/hw-app-near": "workspace:^",
|
|
530454
530455
|
"@ledgerhq/hw-app-polkadot": "workspace:^",
|
|
530455
|
-
"@ledgerhq/hw-app-solana": "workspace:^",
|
|
530456
530456
|
"@ledgerhq/hw-app-str": "workspace:^",
|
|
530457
530457
|
"@ledgerhq/hw-app-sui": "workspace:^",
|
|
530458
530458
|
"@ledgerhq/hw-app-tezos": "workspace:^",
|
|
530459
530459
|
"@ledgerhq/hw-app-trx": "workspace:^",
|
|
530460
530460
|
"@ledgerhq/hw-app-vet": "workspace:^",
|
|
530461
530461
|
"@ledgerhq/hw-app-xrp": "workspace:^",
|
|
530462
|
-
"@ledgerhq/hw-bolos": "workspace:*",
|
|
530463
530462
|
"@ledgerhq/hw-transport": "workspace:^",
|
|
530464
530463
|
"@ledgerhq/hw-transport-mocker": "workspace:^",
|
|
530465
530464
|
"@ledgerhq/ledger-cal-service": "workspace:^",
|
|
530466
|
-
"@ledgerhq/ledger-trust-service": "workspace:*",
|
|
530467
530465
|
"@ledgerhq/live-app-sdk": "^0.8.1",
|
|
530468
530466
|
"@ledgerhq/live-config": "workspace:^",
|
|
530469
530467
|
"@ledgerhq/live-countervalues": "workspace:^",
|
|
@@ -530474,6 +530472,7 @@ var require_package8 = __commonJS({
|
|
|
530474
530472
|
"@ledgerhq/live-nft": "workspace:^",
|
|
530475
530473
|
"@ledgerhq/live-promise": "workspace:^",
|
|
530476
530474
|
"@ledgerhq/live-signer-evm": "workspace:^",
|
|
530475
|
+
"@ledgerhq/live-signer-solana": "workspace:^",
|
|
530477
530476
|
"@ledgerhq/live-wallet": "workspace:^",
|
|
530478
530477
|
"@ledgerhq/logs": "workspace:^",
|
|
530479
530478
|
"@ledgerhq/speculos-transport": "workspace:^",
|
|
@@ -537084,7 +537083,7 @@ var require_package9 = __commonJS({
|
|
|
537084
537083
|
"package.json"(exports2, module2) {
|
|
537085
537084
|
module2.exports = {
|
|
537086
537085
|
name: "@ledgerhq/live-cli",
|
|
537087
|
-
version: "24.18.2-nightly.
|
|
537086
|
+
version: "24.18.2-nightly.5",
|
|
537088
537087
|
description: "ledger-live CLI version",
|
|
537089
537088
|
repository: {
|
|
537090
537089
|
type: "git",
|
|
@@ -760266,195 +760265,6 @@ var bridge16 = createBridges15(executeWithSigner(createSigner15), getCurrencyCon
|
|
|
760266
760265
|
var resolver29 = createResolver(createSigner15, signer_default6);
|
|
760267
760266
|
var cliTools15 = makeCliTools15();
|
|
760268
760267
|
|
|
760269
|
-
// ../../libs/ledger-live-common/lib-es/families/solana/setup.js
|
|
760270
|
-
var import_semver13 = __toESM(require_semver2());
|
|
760271
|
-
|
|
760272
|
-
// ../../libs/ledgerjs/packages/hw-app-solana/lib-es/Solana.js
|
|
760273
|
-
init_lib_es();
|
|
760274
|
-
var import_bip32_path10 = __toESM(require_bip32_path());
|
|
760275
|
-
var P1_NON_CONFIRM2 = 0;
|
|
760276
|
-
var P1_CONFIRM2 = 1;
|
|
760277
|
-
var P2_INIT = 0;
|
|
760278
|
-
var P2_EXTEND = 1;
|
|
760279
|
-
var P2_MORE3 = 2;
|
|
760280
|
-
var MAX_PAYLOAD = 255;
|
|
760281
|
-
var LEDGER_CLA2 = 224;
|
|
760282
|
-
var INS6 = {
|
|
760283
|
-
GET_VERSION: 4,
|
|
760284
|
-
GET_ADDR: 5,
|
|
760285
|
-
SIGN: 6,
|
|
760286
|
-
SIGN_OFFCHAIN: 7,
|
|
760287
|
-
GET_CHALLENGE: 32,
|
|
760288
|
-
PROVIDE_TRUSTED_NAME: 33
|
|
760289
|
-
};
|
|
760290
|
-
var EXTRA_STATUS_CODES;
|
|
760291
|
-
(function(EXTRA_STATUS_CODES2) {
|
|
760292
|
-
EXTRA_STATUS_CODES2[EXTRA_STATUS_CODES2["BLIND_SIGNATURE_REQUIRED"] = 26632] = "BLIND_SIGNATURE_REQUIRED";
|
|
760293
|
-
})(EXTRA_STATUS_CODES || (EXTRA_STATUS_CODES = {}));
|
|
760294
|
-
var Solana = class {
|
|
760295
|
-
transport;
|
|
760296
|
-
constructor(transport, scrambleKey = "solana_default_scramble_key") {
|
|
760297
|
-
this.transport = transport;
|
|
760298
|
-
this.transport.decorateAppAPIMethods(this, [
|
|
760299
|
-
"getAddress",
|
|
760300
|
-
"signTransaction",
|
|
760301
|
-
"getAppConfiguration",
|
|
760302
|
-
"getChallenge",
|
|
760303
|
-
"provideTrustedName"
|
|
760304
|
-
], scrambleKey);
|
|
760305
|
-
}
|
|
760306
|
-
/**
|
|
760307
|
-
* Get Solana address (public key) for a BIP32 path.
|
|
760308
|
-
*
|
|
760309
|
-
* Because Solana uses Ed25519 keypairs, as per SLIP-0010
|
|
760310
|
-
* all derivation-path indexes will be promoted to hardened indexes.
|
|
760311
|
-
*
|
|
760312
|
-
* @param path a BIP32 path
|
|
760313
|
-
* @param display flag to show display
|
|
760314
|
-
* @returns an object with the address field
|
|
760315
|
-
*
|
|
760316
|
-
* @example
|
|
760317
|
-
* solana.getAddress("44'/501'/0'").then(r => r.address)
|
|
760318
|
-
*/
|
|
760319
|
-
async getAddress(path4, display = false) {
|
|
760320
|
-
const pathBuffer = this.pathToBuffer(path4);
|
|
760321
|
-
const addressBuffer = await this.sendToDevice(INS6.GET_ADDR, display ? P1_CONFIRM2 : P1_NON_CONFIRM2, pathBuffer);
|
|
760322
|
-
return {
|
|
760323
|
-
address: addressBuffer
|
|
760324
|
-
};
|
|
760325
|
-
}
|
|
760326
|
-
/**
|
|
760327
|
-
* Sign a Solana transaction.
|
|
760328
|
-
*
|
|
760329
|
-
* @param path a BIP32 path
|
|
760330
|
-
* @param txBuffer serialized transaction
|
|
760331
|
-
*
|
|
760332
|
-
* @returns an object with the signature field
|
|
760333
|
-
*
|
|
760334
|
-
* @example
|
|
760335
|
-
* solana.signTransaction("44'/501'/0'", txBuffer).then(r => r.signature)
|
|
760336
|
-
*/
|
|
760337
|
-
async signTransaction(path4, txBuffer) {
|
|
760338
|
-
const pathBuffer = this.pathToBuffer(path4);
|
|
760339
|
-
const pathsCountBuffer = Buffer.alloc(1);
|
|
760340
|
-
pathsCountBuffer.writeUInt8(1, 0);
|
|
760341
|
-
const payload = Buffer.concat([pathsCountBuffer, pathBuffer, txBuffer]);
|
|
760342
|
-
const signatureBuffer = await this.sendToDevice(INS6.SIGN, P1_CONFIRM2, payload);
|
|
760343
|
-
return {
|
|
760344
|
-
signature: signatureBuffer
|
|
760345
|
-
};
|
|
760346
|
-
}
|
|
760347
|
-
/**
|
|
760348
|
-
* Sign a Solana off-chain message.
|
|
760349
|
-
*
|
|
760350
|
-
* @param path a BIP32 path
|
|
760351
|
-
* @param msgBuffer serialized off-chain message
|
|
760352
|
-
*
|
|
760353
|
-
* @returns an object with the signature field
|
|
760354
|
-
*
|
|
760355
|
-
* @example
|
|
760356
|
-
* solana.signOffchainMessage("44'/501'/0'", msgBuffer).then(r => r.signature)
|
|
760357
|
-
*/
|
|
760358
|
-
async signOffchainMessage(path4, msgBuffer) {
|
|
760359
|
-
const pathBuffer = this.pathToBuffer(path4);
|
|
760360
|
-
const pathsCountBuffer = Buffer.alloc(1);
|
|
760361
|
-
pathsCountBuffer.writeUInt8(1, 0);
|
|
760362
|
-
const payload = Buffer.concat([pathsCountBuffer, pathBuffer, msgBuffer]);
|
|
760363
|
-
const signatureBuffer = await this.sendToDevice(INS6.SIGN_OFFCHAIN, P1_CONFIRM2, payload);
|
|
760364
|
-
return {
|
|
760365
|
-
signature: signatureBuffer
|
|
760366
|
-
};
|
|
760367
|
-
}
|
|
760368
|
-
/**
|
|
760369
|
-
* Get application configuration.
|
|
760370
|
-
*
|
|
760371
|
-
* @returns application config object
|
|
760372
|
-
*
|
|
760373
|
-
* @example
|
|
760374
|
-
* solana.getAppConfiguration().then(r => r.version)
|
|
760375
|
-
*/
|
|
760376
|
-
async getAppConfiguration() {
|
|
760377
|
-
const [blindSigningEnabled, pubKeyDisplayMode, major, minor, patch] = await this.sendToDevice(INS6.GET_VERSION, P1_NON_CONFIRM2, Buffer.alloc(0));
|
|
760378
|
-
return {
|
|
760379
|
-
blindSigningEnabled: Boolean(blindSigningEnabled),
|
|
760380
|
-
pubKeyDisplayMode,
|
|
760381
|
-
version: `${major}.${minor}.${patch}`
|
|
760382
|
-
};
|
|
760383
|
-
}
|
|
760384
|
-
/**
|
|
760385
|
-
* Method returning a 4 bytes TLV challenge as an hex string
|
|
760386
|
-
*
|
|
760387
|
-
* @returns {Promise<string>}
|
|
760388
|
-
*/
|
|
760389
|
-
async getChallenge() {
|
|
760390
|
-
return this.transport.send(LEDGER_CLA2, INS6.GET_CHALLENGE, P1_NON_CONFIRM2, P2_INIT).then((res) => {
|
|
760391
|
-
const data6 = res.toString("hex");
|
|
760392
|
-
const fourBytesChallenge = data6.slice(0, -4);
|
|
760393
|
-
const statusCode = data6.slice(-4);
|
|
760394
|
-
if (statusCode !== "9000") {
|
|
760395
|
-
throw new Error(`An error happened while generating the challenge. Status code: ${statusCode}`);
|
|
760396
|
-
}
|
|
760397
|
-
return `0x${fourBytesChallenge}`;
|
|
760398
|
-
});
|
|
760399
|
-
}
|
|
760400
|
-
/**
|
|
760401
|
-
* Provides a trusted name to be displayed during transactions in place of the token address it is associated to. It shall be run just before a transaction involving the associated address that would be displayed on the device.
|
|
760402
|
-
*
|
|
760403
|
-
* @param data a stringified buffer of some TLV encoded data to represent the trusted name
|
|
760404
|
-
* @returns a boolean
|
|
760405
|
-
*/
|
|
760406
|
-
async provideTrustedName(data6) {
|
|
760407
|
-
await this.transport.send(LEDGER_CLA2, INS6.PROVIDE_TRUSTED_NAME, P1_NON_CONFIRM2, P2_INIT, Buffer.from(data6, "hex"));
|
|
760408
|
-
return true;
|
|
760409
|
-
}
|
|
760410
|
-
pathToBuffer(originalPath) {
|
|
760411
|
-
const path4 = originalPath.split("/").map((value6) => value6.endsWith("'") || value6.endsWith("h") ? value6 : value6 + "'").join("/");
|
|
760412
|
-
const pathNums = import_bip32_path10.default.fromString(path4).toPathArray();
|
|
760413
|
-
return this.serializePath(pathNums);
|
|
760414
|
-
}
|
|
760415
|
-
serializePath(path4) {
|
|
760416
|
-
const buf2 = Buffer.alloc(1 + path4.length * 4);
|
|
760417
|
-
buf2.writeUInt8(path4.length, 0);
|
|
760418
|
-
for (const [i86, num] of path4.entries()) {
|
|
760419
|
-
buf2.writeUInt32BE(num, 1 + i86 * 4);
|
|
760420
|
-
}
|
|
760421
|
-
return buf2;
|
|
760422
|
-
}
|
|
760423
|
-
// send chunked if payload size exceeds maximum for a call
|
|
760424
|
-
async sendToDevice(instruction, p1, payload) {
|
|
760425
|
-
const acceptStatusList = [StatusCodes.OK, EXTRA_STATUS_CODES.BLIND_SIGNATURE_REQUIRED];
|
|
760426
|
-
let p210 = P2_INIT;
|
|
760427
|
-
let payload_offset = 0;
|
|
760428
|
-
if (payload.length > MAX_PAYLOAD) {
|
|
760429
|
-
while (payload.length - payload_offset > MAX_PAYLOAD) {
|
|
760430
|
-
const buf3 = payload.slice(payload_offset, payload_offset + MAX_PAYLOAD);
|
|
760431
|
-
payload_offset += MAX_PAYLOAD;
|
|
760432
|
-
const reply2 = await this.transport.send(LEDGER_CLA2, instruction, p1, p210 | P2_MORE3, buf3, acceptStatusList);
|
|
760433
|
-
this.throwOnFailure(reply2);
|
|
760434
|
-
p210 |= P2_EXTEND;
|
|
760435
|
-
}
|
|
760436
|
-
}
|
|
760437
|
-
const buf2 = payload.slice(payload_offset);
|
|
760438
|
-
const reply = await this.transport.send(LEDGER_CLA2, instruction, p1, p210, buf2, acceptStatusList);
|
|
760439
|
-
this.throwOnFailure(reply);
|
|
760440
|
-
return reply.slice(0, reply.length - 2);
|
|
760441
|
-
}
|
|
760442
|
-
throwOnFailure(reply) {
|
|
760443
|
-
const status = reply.readUInt16BE(reply.length - 2);
|
|
760444
|
-
switch (status) {
|
|
760445
|
-
case EXTRA_STATUS_CODES.BLIND_SIGNATURE_REQUIRED:
|
|
760446
|
-
throw new Error("Missing a parameter. Try enabling blind signature in the app");
|
|
760447
|
-
default:
|
|
760448
|
-
return;
|
|
760449
|
-
}
|
|
760450
|
-
}
|
|
760451
|
-
};
|
|
760452
|
-
var PubKeyDisplayMode;
|
|
760453
|
-
(function(PubKeyDisplayMode3) {
|
|
760454
|
-
PubKeyDisplayMode3[PubKeyDisplayMode3["LONG"] = 0] = "LONG";
|
|
760455
|
-
PubKeyDisplayMode3[PubKeyDisplayMode3["SHORT"] = 1] = "SHORT";
|
|
760456
|
-
})(PubKeyDisplayMode || (PubKeyDisplayMode = {}));
|
|
760457
|
-
|
|
760458
760268
|
// ../../libs/coin-modules/coin-solana/lib-es/bridge/js.js
|
|
760459
760269
|
init_lib_es2();
|
|
760460
760270
|
|
|
@@ -777074,187 +776884,285 @@ function makeCliTools16() {
|
|
|
777074
776884
|
};
|
|
777075
776885
|
}
|
|
777076
776886
|
|
|
777077
|
-
// ../../libs/
|
|
777078
|
-
|
|
777079
|
-
|
|
777080
|
-
// ../../libs/ledgerjs/packages/hw-bolos/lib-es/loadPKI.js
|
|
777081
|
-
init_Transport();
|
|
776887
|
+
// ../../libs/coin-modules/coin-solana/lib-es/hw-signMessage.js
|
|
776888
|
+
var import_semver11 = __toESM(require_semver4());
|
|
777082
776889
|
|
|
777083
|
-
// ../../libs/
|
|
777084
|
-
var
|
|
777085
|
-
|
|
777086
|
-
|
|
777087
|
-
|
|
777088
|
-
|
|
777089
|
-
|
|
777090
|
-
|
|
777091
|
-
|
|
777092
|
-
|
|
777093
|
-
|
|
777094
|
-
|
|
777095
|
-
|
|
777096
|
-
|
|
777097
|
-
|
|
777098
|
-
16942: "expected_key_usage doesn't match certificate key usage",
|
|
777099
|
-
22304: "Failed to verify signature",
|
|
777100
|
-
16664: "trusted_name buffer is too small to contain the trusted name"
|
|
777101
|
-
};
|
|
777102
|
-
var errorCodeValue = Object.keys(ErrorCode2).map((v38) => parseInt(v38));
|
|
777103
|
-
function throwError4(code) {
|
|
777104
|
-
switch (code) {
|
|
777105
|
-
case 16943:
|
|
777106
|
-
throw new PKIStructError();
|
|
777107
|
-
case 16944:
|
|
777108
|
-
throw new PKICertificateVersionError();
|
|
777109
|
-
case 16945:
|
|
777110
|
-
throw new PKICertificateValidityError();
|
|
777111
|
-
case 16946:
|
|
777112
|
-
throw new PKICertificateIndexError();
|
|
777113
|
-
case 16947:
|
|
777114
|
-
throw new PKIUnknownSignerIdError();
|
|
777115
|
-
case 16948:
|
|
777116
|
-
throw new PKIUnknownSignerAlgorithmError();
|
|
777117
|
-
case 16949:
|
|
777118
|
-
throw new PKIUnknownPublicIdError();
|
|
777119
|
-
case 16950:
|
|
777120
|
-
throw new PKIUnknownPublicUsageError();
|
|
777121
|
-
case 16951:
|
|
777122
|
-
throw new PKIIncorrectCurveError();
|
|
777123
|
-
case 16952:
|
|
777124
|
-
throw new PKIIncorrectSignatureError();
|
|
777125
|
-
case 16953:
|
|
777126
|
-
throw new PKIUnknownDeviceError();
|
|
777127
|
-
case 16941:
|
|
777128
|
-
throw new PKIUnknownCertificateTagError();
|
|
777129
|
-
case 13057:
|
|
777130
|
-
throw new PKIFailedHashError();
|
|
777131
|
-
case 16942:
|
|
777132
|
-
throw new PKIMismatchKeyError();
|
|
777133
|
-
case 22304:
|
|
777134
|
-
throw new PKIFailedVerificationError();
|
|
777135
|
-
case 16664:
|
|
777136
|
-
throw new PKITrustedNameTooSmallError();
|
|
777137
|
-
default:
|
|
777138
|
-
throw new PKIError("Unknown");
|
|
777139
|
-
}
|
|
776890
|
+
// ../../libs/coin-modules/coin-solana/lib-es/offchainMessage/format.js
|
|
776891
|
+
var OFFCM_MAX_LEDGER_LEN = 15 * 1024 - 40 - 8;
|
|
776892
|
+
var LEGACY_OFFCM_MAX_LEDGER_LEN = 1280 - 40 - 8;
|
|
776893
|
+
var OFFCM_MAX_V0_LEN = 65515;
|
|
776894
|
+
var MAX_PRINTABLE_ASCII = 126;
|
|
776895
|
+
var MIN_PRINTABLE_ASCII = 32;
|
|
776896
|
+
var LINE_FEED_ASCII = 10;
|
|
776897
|
+
function isPrintableASCII(buffer2, isLegacy) {
|
|
776898
|
+
return buffer2.every((element) => {
|
|
776899
|
+
return (
|
|
776900
|
+
// The solana app was not allowing new lines as ascii
|
|
776901
|
+
// and would treat the message as UTF-8 (requiring blind signing)
|
|
776902
|
+
!isLegacy && element === LINE_FEED_ASCII || MIN_PRINTABLE_ASCII <= element && element <= MAX_PRINTABLE_ASCII
|
|
776903
|
+
);
|
|
776904
|
+
});
|
|
777140
776905
|
}
|
|
777141
|
-
|
|
777142
|
-
|
|
777143
|
-
|
|
777144
|
-
|
|
777145
|
-
}
|
|
777146
|
-
|
|
777147
|
-
constructor() {
|
|
777148
|
-
super(ErrorCode2[16943]);
|
|
777149
|
-
}
|
|
777150
|
-
};
|
|
777151
|
-
var PKICertificateVersionError = class extends PKIError {
|
|
777152
|
-
constructor() {
|
|
777153
|
-
super(ErrorCode2[16944]);
|
|
776906
|
+
function isUTF8(buffer2) {
|
|
776907
|
+
try {
|
|
776908
|
+
new TextDecoder("utf8", { fatal: true }).decode(buffer2);
|
|
776909
|
+
return true;
|
|
776910
|
+
} catch {
|
|
776911
|
+
return false;
|
|
777154
776912
|
}
|
|
777155
|
-
}
|
|
777156
|
-
|
|
777157
|
-
|
|
777158
|
-
|
|
776913
|
+
}
|
|
776914
|
+
function findMessageFormat(messageBuffer, isLegacy) {
|
|
776915
|
+
const maxLedgerLen = isLegacy ? LEGACY_OFFCM_MAX_LEDGER_LEN : OFFCM_MAX_LEDGER_LEN;
|
|
776916
|
+
if (messageBuffer.length <= maxLedgerLen) {
|
|
776917
|
+
if (isPrintableASCII(messageBuffer, isLegacy)) {
|
|
776918
|
+
return 0;
|
|
776919
|
+
} else if (isUTF8(messageBuffer)) {
|
|
776920
|
+
return 1;
|
|
776921
|
+
}
|
|
776922
|
+
} else if (messageBuffer.length <= OFFCM_MAX_V0_LEN) {
|
|
776923
|
+
if (isUTF8(messageBuffer)) {
|
|
776924
|
+
return 2;
|
|
776925
|
+
}
|
|
777159
776926
|
}
|
|
777160
|
-
|
|
777161
|
-
|
|
777162
|
-
|
|
777163
|
-
|
|
776927
|
+
return 0;
|
|
776928
|
+
}
|
|
776929
|
+
var signingDomain = Buffer.concat([Buffer.from([255]), Buffer.from("solana offchain")]);
|
|
776930
|
+
var headerVersion = Buffer.alloc(1);
|
|
776931
|
+
var applicationDomain = Buffer.alloc(32);
|
|
776932
|
+
var messageFormat = Buffer.alloc(1);
|
|
776933
|
+
var signerCount = Buffer.alloc(1);
|
|
776934
|
+
signerCount.writeUInt8(1);
|
|
776935
|
+
var messageLength = Buffer.alloc(2);
|
|
776936
|
+
function toOffChainMessage(message2, signerAddress, isLegacy) {
|
|
776937
|
+
const messageBuffer = Buffer.from(message2);
|
|
776938
|
+
messageFormat.writeUInt8(findMessageFormat(messageBuffer, isLegacy));
|
|
776939
|
+
const signers = new PublicKey4(signerAddress).toBuffer();
|
|
776940
|
+
messageLength.writeUint16LE(messageBuffer.length);
|
|
776941
|
+
return Buffer.concat(isLegacy ? [signingDomain, headerVersion, messageFormat, messageLength, messageBuffer] : [
|
|
776942
|
+
signingDomain,
|
|
776943
|
+
headerVersion,
|
|
776944
|
+
applicationDomain,
|
|
776945
|
+
messageFormat,
|
|
776946
|
+
signerCount,
|
|
776947
|
+
signers,
|
|
776948
|
+
messageLength,
|
|
776949
|
+
messageBuffer
|
|
776950
|
+
]);
|
|
776951
|
+
}
|
|
776952
|
+
|
|
776953
|
+
// ../../libs/coin-modules/coin-solana/lib-es/hw-signMessage.js
|
|
776954
|
+
var import_bs587 = __toESM(require_bs58());
|
|
776955
|
+
var import_invariant41 = __toESM(require("invariant"));
|
|
776956
|
+
var signMessage7 = (signerContext3) => async (deviceId, account3, messageOptions) => {
|
|
776957
|
+
const message2 = messageOptions.message;
|
|
776958
|
+
if (!message2 || typeof message2 !== "string") {
|
|
776959
|
+
throw new Error("Sign off-chain message on Solana must be only used with DefaultMessage type");
|
|
777164
776960
|
}
|
|
776961
|
+
let signedMessage;
|
|
776962
|
+
const result2 = await signerContext3(deviceId, async (signer) => {
|
|
776963
|
+
const { version: version33 } = await signer.getAppConfiguration();
|
|
776964
|
+
const isLegacy = import_semver11.default.lt(version33, config_default5.getCoinConfig().legacyOCMSMaxVersion);
|
|
776965
|
+
signedMessage = toOffChainMessage(message2, account3.freshAddress, isLegacy);
|
|
776966
|
+
return signer.signMessage(account3.freshAddressPath, signedMessage.toString("hex"));
|
|
776967
|
+
});
|
|
776968
|
+
(0, import_invariant41.default)(signedMessage, "signedMessage should exist");
|
|
776969
|
+
const signatureCount = Buffer.from([1]);
|
|
776970
|
+
const envelope = Buffer.concat([signatureCount, result2.signature, signedMessage]);
|
|
776971
|
+
return { signature: import_bs587.default.encode(envelope) };
|
|
777165
776972
|
};
|
|
777166
|
-
|
|
777167
|
-
|
|
777168
|
-
|
|
777169
|
-
|
|
776973
|
+
|
|
776974
|
+
// ../../libs/live-signer-solana/lib-es/LegacySignerSolana.js
|
|
776975
|
+
var import_semver13 = __toESM(require_semver4());
|
|
776976
|
+
|
|
776977
|
+
// ../../libs/ledgerjs/packages/hw-app-solana/lib-es/Solana.js
|
|
776978
|
+
init_lib_es();
|
|
776979
|
+
var import_bip32_path10 = __toESM(require_bip32_path());
|
|
776980
|
+
var P1_NON_CONFIRM2 = 0;
|
|
776981
|
+
var P1_CONFIRM2 = 1;
|
|
776982
|
+
var P2_INIT = 0;
|
|
776983
|
+
var P2_EXTEND = 1;
|
|
776984
|
+
var P2_MORE3 = 2;
|
|
776985
|
+
var MAX_PAYLOAD = 255;
|
|
776986
|
+
var LEDGER_CLA2 = 224;
|
|
776987
|
+
var INS6 = {
|
|
776988
|
+
GET_VERSION: 4,
|
|
776989
|
+
GET_ADDR: 5,
|
|
776990
|
+
SIGN: 6,
|
|
776991
|
+
SIGN_OFFCHAIN: 7,
|
|
776992
|
+
GET_CHALLENGE: 32,
|
|
776993
|
+
PROVIDE_TRUSTED_NAME: 33
|
|
777170
776994
|
};
|
|
777171
|
-
var
|
|
777172
|
-
|
|
777173
|
-
|
|
776995
|
+
var EXTRA_STATUS_CODES;
|
|
776996
|
+
(function(EXTRA_STATUS_CODES2) {
|
|
776997
|
+
EXTRA_STATUS_CODES2[EXTRA_STATUS_CODES2["BLIND_SIGNATURE_REQUIRED"] = 26632] = "BLIND_SIGNATURE_REQUIRED";
|
|
776998
|
+
})(EXTRA_STATUS_CODES || (EXTRA_STATUS_CODES = {}));
|
|
776999
|
+
var Solana = class {
|
|
777000
|
+
transport;
|
|
777001
|
+
constructor(transport, scrambleKey = "solana_default_scramble_key") {
|
|
777002
|
+
this.transport = transport;
|
|
777003
|
+
this.transport.decorateAppAPIMethods(this, [
|
|
777004
|
+
"getAddress",
|
|
777005
|
+
"signTransaction",
|
|
777006
|
+
"getAppConfiguration",
|
|
777007
|
+
"getChallenge",
|
|
777008
|
+
"provideTrustedName"
|
|
777009
|
+
], scrambleKey);
|
|
777174
777010
|
}
|
|
777175
|
-
|
|
777176
|
-
|
|
777177
|
-
|
|
777178
|
-
|
|
777011
|
+
/**
|
|
777012
|
+
* Get Solana address (public key) for a BIP32 path.
|
|
777013
|
+
*
|
|
777014
|
+
* Because Solana uses Ed25519 keypairs, as per SLIP-0010
|
|
777015
|
+
* all derivation-path indexes will be promoted to hardened indexes.
|
|
777016
|
+
*
|
|
777017
|
+
* @param path a BIP32 path
|
|
777018
|
+
* @param display flag to show display
|
|
777019
|
+
* @returns an object with the address field
|
|
777020
|
+
*
|
|
777021
|
+
* @example
|
|
777022
|
+
* solana.getAddress("44'/501'/0'").then(r => r.address)
|
|
777023
|
+
*/
|
|
777024
|
+
async getAddress(path4, display = false) {
|
|
777025
|
+
const pathBuffer = this.pathToBuffer(path4);
|
|
777026
|
+
const addressBuffer = await this.sendToDevice(INS6.GET_ADDR, display ? P1_CONFIRM2 : P1_NON_CONFIRM2, pathBuffer);
|
|
777027
|
+
return {
|
|
777028
|
+
address: addressBuffer
|
|
777029
|
+
};
|
|
777179
777030
|
}
|
|
777180
|
-
|
|
777181
|
-
|
|
777182
|
-
|
|
777183
|
-
|
|
777031
|
+
/**
|
|
777032
|
+
* Sign a Solana transaction.
|
|
777033
|
+
*
|
|
777034
|
+
* @param path a BIP32 path
|
|
777035
|
+
* @param txBuffer serialized transaction
|
|
777036
|
+
*
|
|
777037
|
+
* @returns an object with the signature field
|
|
777038
|
+
*
|
|
777039
|
+
* @example
|
|
777040
|
+
* solana.signTransaction("44'/501'/0'", txBuffer).then(r => r.signature)
|
|
777041
|
+
*/
|
|
777042
|
+
async signTransaction(path4, txBuffer) {
|
|
777043
|
+
const pathBuffer = this.pathToBuffer(path4);
|
|
777044
|
+
const pathsCountBuffer = Buffer.alloc(1);
|
|
777045
|
+
pathsCountBuffer.writeUInt8(1, 0);
|
|
777046
|
+
const payload = Buffer.concat([pathsCountBuffer, pathBuffer, txBuffer]);
|
|
777047
|
+
const signatureBuffer = await this.sendToDevice(INS6.SIGN, P1_CONFIRM2, payload);
|
|
777048
|
+
return {
|
|
777049
|
+
signature: signatureBuffer
|
|
777050
|
+
};
|
|
777184
777051
|
}
|
|
777185
|
-
|
|
777186
|
-
|
|
777187
|
-
|
|
777188
|
-
|
|
777052
|
+
/**
|
|
777053
|
+
* Sign a Solana off-chain message.
|
|
777054
|
+
*
|
|
777055
|
+
* @param path a BIP32 path
|
|
777056
|
+
* @param msgBuffer serialized off-chain message
|
|
777057
|
+
*
|
|
777058
|
+
* @returns an object with the signature field
|
|
777059
|
+
*
|
|
777060
|
+
* @example
|
|
777061
|
+
* solana.signOffchainMessage("44'/501'/0'", msgBuffer).then(r => r.signature)
|
|
777062
|
+
*/
|
|
777063
|
+
async signOffchainMessage(path4, msgBuffer) {
|
|
777064
|
+
const pathBuffer = this.pathToBuffer(path4);
|
|
777065
|
+
const pathsCountBuffer = Buffer.alloc(1);
|
|
777066
|
+
pathsCountBuffer.writeUInt8(1, 0);
|
|
777067
|
+
const payload = Buffer.concat([pathsCountBuffer, pathBuffer, msgBuffer]);
|
|
777068
|
+
const signatureBuffer = await this.sendToDevice(INS6.SIGN_OFFCHAIN, P1_CONFIRM2, payload);
|
|
777069
|
+
return {
|
|
777070
|
+
signature: signatureBuffer
|
|
777071
|
+
};
|
|
777189
777072
|
}
|
|
777190
|
-
|
|
777191
|
-
|
|
777192
|
-
|
|
777193
|
-
|
|
777073
|
+
/**
|
|
777074
|
+
* Get application configuration.
|
|
777075
|
+
*
|
|
777076
|
+
* @returns application config object
|
|
777077
|
+
*
|
|
777078
|
+
* @example
|
|
777079
|
+
* solana.getAppConfiguration().then(r => r.version)
|
|
777080
|
+
*/
|
|
777081
|
+
async getAppConfiguration() {
|
|
777082
|
+
const [blindSigningEnabled, pubKeyDisplayMode, major, minor, patch] = await this.sendToDevice(INS6.GET_VERSION, P1_NON_CONFIRM2, Buffer.alloc(0));
|
|
777083
|
+
return {
|
|
777084
|
+
blindSigningEnabled: Boolean(blindSigningEnabled),
|
|
777085
|
+
pubKeyDisplayMode,
|
|
777086
|
+
version: `${major}.${minor}.${patch}`
|
|
777087
|
+
};
|
|
777194
777088
|
}
|
|
777195
|
-
|
|
777196
|
-
|
|
777197
|
-
|
|
777198
|
-
|
|
777089
|
+
/**
|
|
777090
|
+
* Method returning a 4 bytes TLV challenge as an hex string
|
|
777091
|
+
*
|
|
777092
|
+
* @returns {Promise<string>}
|
|
777093
|
+
*/
|
|
777094
|
+
async getChallenge() {
|
|
777095
|
+
return this.transport.send(LEDGER_CLA2, INS6.GET_CHALLENGE, P1_NON_CONFIRM2, P2_INIT).then((res) => {
|
|
777096
|
+
const data6 = res.toString("hex");
|
|
777097
|
+
const fourBytesChallenge = data6.slice(0, -4);
|
|
777098
|
+
const statusCode = data6.slice(-4);
|
|
777099
|
+
if (statusCode !== "9000") {
|
|
777100
|
+
throw new Error(`An error happened while generating the challenge. Status code: ${statusCode}`);
|
|
777101
|
+
}
|
|
777102
|
+
return `0x${fourBytesChallenge}`;
|
|
777103
|
+
});
|
|
777199
777104
|
}
|
|
777200
|
-
|
|
777201
|
-
|
|
777202
|
-
|
|
777203
|
-
|
|
777105
|
+
/**
|
|
777106
|
+
* Provides a trusted name to be displayed during transactions in place of the token address it is associated to. It shall be run just before a transaction involving the associated address that would be displayed on the device.
|
|
777107
|
+
*
|
|
777108
|
+
* @param data a stringified buffer of some TLV encoded data to represent the trusted name
|
|
777109
|
+
* @returns a boolean
|
|
777110
|
+
*/
|
|
777111
|
+
async provideTrustedName(data6) {
|
|
777112
|
+
await this.transport.send(LEDGER_CLA2, INS6.PROVIDE_TRUSTED_NAME, P1_NON_CONFIRM2, P2_INIT, Buffer.from(data6, "hex"));
|
|
777113
|
+
return true;
|
|
777204
777114
|
}
|
|
777205
|
-
|
|
777206
|
-
|
|
777207
|
-
|
|
777208
|
-
|
|
777115
|
+
pathToBuffer(originalPath) {
|
|
777116
|
+
const path4 = originalPath.split("/").map((value6) => value6.endsWith("'") || value6.endsWith("h") ? value6 : value6 + "'").join("/");
|
|
777117
|
+
const pathNums = import_bip32_path10.default.fromString(path4).toPathArray();
|
|
777118
|
+
return this.serializePath(pathNums);
|
|
777209
777119
|
}
|
|
777210
|
-
|
|
777211
|
-
|
|
777212
|
-
|
|
777213
|
-
|
|
777120
|
+
serializePath(path4) {
|
|
777121
|
+
const buf2 = Buffer.alloc(1 + path4.length * 4);
|
|
777122
|
+
buf2.writeUInt8(path4.length, 0);
|
|
777123
|
+
for (const [i86, num] of path4.entries()) {
|
|
777124
|
+
buf2.writeUInt32BE(num, 1 + i86 * 4);
|
|
777125
|
+
}
|
|
777126
|
+
return buf2;
|
|
777214
777127
|
}
|
|
777215
|
-
|
|
777216
|
-
|
|
777217
|
-
|
|
777218
|
-
|
|
777128
|
+
// send chunked if payload size exceeds maximum for a call
|
|
777129
|
+
async sendToDevice(instruction, p1, payload) {
|
|
777130
|
+
const acceptStatusList = [StatusCodes.OK, EXTRA_STATUS_CODES.BLIND_SIGNATURE_REQUIRED];
|
|
777131
|
+
let p210 = P2_INIT;
|
|
777132
|
+
let payload_offset = 0;
|
|
777133
|
+
if (payload.length > MAX_PAYLOAD) {
|
|
777134
|
+
while (payload.length - payload_offset > MAX_PAYLOAD) {
|
|
777135
|
+
const buf3 = payload.slice(payload_offset, payload_offset + MAX_PAYLOAD);
|
|
777136
|
+
payload_offset += MAX_PAYLOAD;
|
|
777137
|
+
const reply2 = await this.transport.send(LEDGER_CLA2, instruction, p1, p210 | P2_MORE3, buf3, acceptStatusList);
|
|
777138
|
+
this.throwOnFailure(reply2);
|
|
777139
|
+
p210 |= P2_EXTEND;
|
|
777140
|
+
}
|
|
777141
|
+
}
|
|
777142
|
+
const buf2 = payload.slice(payload_offset);
|
|
777143
|
+
const reply = await this.transport.send(LEDGER_CLA2, instruction, p1, p210, buf2, acceptStatusList);
|
|
777144
|
+
this.throwOnFailure(reply);
|
|
777145
|
+
return reply.slice(0, reply.length - 2);
|
|
777219
777146
|
}
|
|
777220
|
-
|
|
777221
|
-
|
|
777222
|
-
|
|
777223
|
-
|
|
777147
|
+
throwOnFailure(reply) {
|
|
777148
|
+
const status = reply.readUInt16BE(reply.length - 2);
|
|
777149
|
+
switch (status) {
|
|
777150
|
+
case EXTRA_STATUS_CODES.BLIND_SIGNATURE_REQUIRED:
|
|
777151
|
+
throw new Error("Missing a parameter. Try enabling blind signature in the app");
|
|
777152
|
+
default:
|
|
777153
|
+
return;
|
|
777154
|
+
}
|
|
777224
777155
|
}
|
|
777225
777156
|
};
|
|
777157
|
+
var PubKeyDisplayMode;
|
|
777158
|
+
(function(PubKeyDisplayMode3) {
|
|
777159
|
+
PubKeyDisplayMode3[PubKeyDisplayMode3["LONG"] = 0] = "LONG";
|
|
777160
|
+
PubKeyDisplayMode3[PubKeyDisplayMode3["SHORT"] = 1] = "SHORT";
|
|
777161
|
+
})(PubKeyDisplayMode || (PubKeyDisplayMode = {}));
|
|
777226
777162
|
|
|
777227
|
-
// ../../libs/
|
|
777228
|
-
|
|
777229
|
-
|
|
777230
|
-
var INS7 = 6;
|
|
777231
|
-
var P22 = 0;
|
|
777232
|
-
var keyUsage = {
|
|
777233
|
-
GENUINE_CHECK: 1,
|
|
777234
|
-
EXCHANGE_PAYLOAD: 2,
|
|
777235
|
-
NFT_METADATA: 3,
|
|
777236
|
-
TRUSTED_NAME: 4,
|
|
777237
|
-
BACKUP_PROVIDER: 5,
|
|
777238
|
-
RECOVER_ORCHESTRATOR: 6,
|
|
777239
|
-
PLUGIN_METADATA: 7,
|
|
777240
|
-
COIN_META: 8,
|
|
777241
|
-
SEED_ID_AUTH: 9,
|
|
777242
|
-
UNKNOWN: 10
|
|
777243
|
-
};
|
|
777244
|
-
var loadPKI_default = async (transport, key2, descriptor, signature3) => {
|
|
777245
|
-
const descriptorBuffer = Buffer.from(descriptor, "hex");
|
|
777246
|
-
const signatureBuffer = Buffer.from(signature3, "hex");
|
|
777247
|
-
const result2 = await transport.send(CLA7, INS7, keyUsage[key2], P22, Buffer.concat([
|
|
777248
|
-
new Uint8Array(descriptorBuffer),
|
|
777249
|
-
new Uint8Array(Buffer.from("15", "hex")),
|
|
777250
|
-
new Uint8Array(Buffer.from([signatureBuffer.length])),
|
|
777251
|
-
new Uint8Array(signatureBuffer)
|
|
777252
|
-
]), handledErrorCode);
|
|
777253
|
-
const resultCode = result2.readUInt16BE(result2.length - 2);
|
|
777254
|
-
if (resultCode !== StatusCodes.OK) {
|
|
777255
|
-
throwError4(resultCode);
|
|
777256
|
-
}
|
|
777257
|
-
};
|
|
777163
|
+
// ../../libs/live-signer-solana/lib-es/LegacySignerSolana.js
|
|
777164
|
+
init_Transport();
|
|
777165
|
+
init_lib_es5();
|
|
777258
777166
|
|
|
777259
777167
|
// ../../libs/ledger-services/cal/lib-es/common.js
|
|
777260
777168
|
var DEFAULT_OPTION = {
|
|
@@ -777596,280 +777504,254 @@ var lib_es_default3 = {
|
|
|
777596
777504
|
getOwnerAddress
|
|
777597
777505
|
};
|
|
777598
777506
|
|
|
777599
|
-
// ../../libs/
|
|
777600
|
-
|
|
777601
|
-
|
|
777602
|
-
// ../../libs/ledger-live-common/lib-es/errors.js
|
|
777603
|
-
init_lib_es();
|
|
777604
|
-
init_lib_es();
|
|
777605
|
-
|
|
777606
|
-
// ../../libs/coin-modules/coin-aptos/lib-es/errors.js
|
|
777607
|
-
init_lib_es();
|
|
777608
|
-
var SequenceNumberTooOldError = createCustomErrorClass("SequenceNumberTooOld");
|
|
777609
|
-
var SequenceNumberTooNewError = createCustomErrorClass("SequenceNumberTooNew");
|
|
777610
|
-
var TransactionExpiredError = createCustomErrorClass("TransactionExpired");
|
|
777611
|
-
|
|
777612
|
-
// ../../libs/coin-modules/coin-stacks/lib-es/errors.js
|
|
777613
|
-
init_lib_es();
|
|
777614
|
-
var StacksMemoTooLong = createCustomErrorClass("StacksMemoTooLong");
|
|
777615
|
-
|
|
777616
|
-
// ../../libs/coin-modules/coin-stellar/lib-es/types/errors.js
|
|
777617
|
-
init_lib_es();
|
|
777618
|
-
var StellarBurnAddressError = createCustomErrorClass("StellarBurnAddressError");
|
|
777619
|
-
var StellarAssetRequired = createCustomErrorClass("StellarAssetRequired");
|
|
777620
|
-
var StellarMuxedAccountNotExist = createCustomErrorClass("StellarMuxedAccountNotExist");
|
|
777621
|
-
var StellarMemoRecommended = createCustomErrorClass("StellarMemoRecommended");
|
|
777622
|
-
var StellarWrongMemoFormat = createCustomErrorClass("StellarWrongMemoFormat");
|
|
777623
|
-
var StellarAssetNotAccepted = createCustomErrorClass("StellarAssetNotAccepted");
|
|
777624
|
-
var StellarAssetNotFound = createCustomErrorClass("StellarAssetNotFound");
|
|
777625
|
-
var StellarNotEnoughNativeBalance = createCustomErrorClass("StellarNotEnoughNativeBalance");
|
|
777626
|
-
var StellarFeeSmallerThanRecommended = createCustomErrorClass("StellarFeeSmallerThanRecommended");
|
|
777627
|
-
var StellarFeeSmallerThanBase = createCustomErrorClass("StellarFeeSmallerThanBase");
|
|
777628
|
-
var StellarNotEnoughNativeBalanceToAddTrustline = createCustomErrorClass("StellarNotEnoughNativeBalanceToAddTrustline");
|
|
777629
|
-
var StellarSourceHasMultiSign = createCustomErrorClass("StellarSourceHasMultiSign");
|
|
777630
|
-
|
|
777631
|
-
// ../../libs/coin-modules/coin-tezos/lib-es/types/errors.js
|
|
777632
|
-
init_lib_es();
|
|
777633
|
-
var InvalidAddressBecauseAlreadyDelegated = createCustomErrorClass("InvalidAddressBecauseAlreadyDelegated");
|
|
777634
|
-
var UnsupportedTransactionMode = createCustomErrorClass("UnsupportedTransactionMode");
|
|
777635
|
-
|
|
777636
|
-
// ../../libs/coin-modules/coin-vechain/lib-es/errors.js
|
|
777637
|
-
init_lib_es();
|
|
777638
|
-
var NotEnoughVTHO = createCustomErrorClass("NotEnoughVTHO");
|
|
777639
|
-
var MustBeVechain = createCustomErrorClass("MustBeVechain");
|
|
777640
|
-
var ImpossibleToCalculateAmountAndFees = createCustomErrorClass("ImpossibleToCalculateAmountAndFees");
|
|
777507
|
+
// ../../libs/ledgerjs/packages/hw-bolos/lib-es/loadPKI.js
|
|
777508
|
+
init_Transport();
|
|
777641
777509
|
|
|
777642
|
-
// ../../libs/
|
|
777643
|
-
var
|
|
777644
|
-
|
|
777645
|
-
|
|
777646
|
-
|
|
777647
|
-
|
|
777648
|
-
|
|
777649
|
-
|
|
777650
|
-
|
|
777651
|
-
|
|
777652
|
-
|
|
777653
|
-
|
|
777654
|
-
|
|
777655
|
-
|
|
777656
|
-
|
|
777657
|
-
|
|
777658
|
-
|
|
777659
|
-
|
|
777660
|
-
var RPCUserRequired = createCustomErrorClass("RPCUserRequired");
|
|
777661
|
-
var RPCPassRequired = createCustomErrorClass("RPCPassRequired");
|
|
777662
|
-
var CosmosBroadcastError = {
|
|
777663
|
-
"1": createCustomErrorClass("CosmosBroadcastCodeInternal"),
|
|
777664
|
-
"2": createCustomErrorClass("CosmosBroadcastCodeTxDecode"),
|
|
777665
|
-
"3": createCustomErrorClass("CosmosBroadcastCodeInvalidSequence"),
|
|
777666
|
-
"4": createCustomErrorClass("CosmosBroadcastCodeUnauthorized"),
|
|
777667
|
-
"5": createCustomErrorClass("CosmosBroadcastCodeInsufficientFunds"),
|
|
777668
|
-
"6": createCustomErrorClass("CosmosBroadcastCodeUnknownRequest"),
|
|
777669
|
-
"7": createCustomErrorClass("CosmosBroadcastCodeInvalidAddress"),
|
|
777670
|
-
"8": createCustomErrorClass("CosmosBroadcastCodeInvalidPubKey"),
|
|
777671
|
-
"9": createCustomErrorClass("CosmosBroadcastCodeUnknownAddress"),
|
|
777672
|
-
"10": createCustomErrorClass("CosmosBroadcastCodeInvalidCoins"),
|
|
777673
|
-
"11": createCustomErrorClass("CosmosBroadcastCodeOutOfGas"),
|
|
777674
|
-
"12": createCustomErrorClass("CosmosBroadcastCodeMemoTooLarge"),
|
|
777675
|
-
"13": createCustomErrorClass("CosmosBroadcastCodeInsufficientFee"),
|
|
777676
|
-
"14": createCustomErrorClass("CosmosBroadcastCodeTooManySignatures"),
|
|
777677
|
-
"15": createCustomErrorClass("CosmosBroadcastCodeNoSignatures"),
|
|
777678
|
-
"16": createCustomErrorClass("CosmosBroadcastCodeJSONMarshal"),
|
|
777679
|
-
"17": createCustomErrorClass("CosmosBroadcastCodeJSONUnmarshal"),
|
|
777680
|
-
"18": createCustomErrorClass("CosmosBroadcastCodeInvalidRequest"),
|
|
777681
|
-
"19": createCustomErrorClass("CosmosBroadcastCodeTxInMempoolCache"),
|
|
777682
|
-
"20": createCustomErrorClass("CosmosBroadcastCodeMempoolIsFull"),
|
|
777683
|
-
"21": createCustomErrorClass("CosmosBroadcastTxTooLarge"),
|
|
777684
|
-
"22": createCustomErrorClass("CosmosBroadcastKeyNotFound"),
|
|
777685
|
-
"23": createCustomErrorClass("CosmosBroadcastWrongPassword"),
|
|
777686
|
-
"24": createCustomErrorClass("CosmosBroadcastInvalidSigner"),
|
|
777687
|
-
"25": createCustomErrorClass("CosmosBroadcastInvalidGasAdjustment"),
|
|
777688
|
-
"26": createCustomErrorClass("CosmosBroadcastInvalidHeight"),
|
|
777689
|
-
"27": createCustomErrorClass("CosmosBroadcastInvalidVersion"),
|
|
777690
|
-
"28": createCustomErrorClass("CosmosBroadcastInvalidChainID"),
|
|
777691
|
-
"29": createCustomErrorClass("CosmosBroadcastInvalidType"),
|
|
777692
|
-
"30": createCustomErrorClass("CosmosBroadcastTimeoutHeight"),
|
|
777693
|
-
"31": createCustomErrorClass("CosmosBroadcastUnknownExtensionOptions"),
|
|
777694
|
-
"32": createCustomErrorClass("CosmosBroadcastWrongSequence"),
|
|
777695
|
-
"33": createCustomErrorClass("CosmosBroadcastPackAny"),
|
|
777696
|
-
"34": createCustomErrorClass("CosmosBroadcastUnpackAny"),
|
|
777697
|
-
"35": createCustomErrorClass("CosmosBroadcastLogic"),
|
|
777698
|
-
"36": createCustomErrorClass("CosmosBroadcastConflict")
|
|
777510
|
+
// ../../libs/ledgerjs/packages/hw-bolos/lib-es/PKIError.js
|
|
777511
|
+
var ErrorCode2 = {
|
|
777512
|
+
16943: "Incorrect structure type",
|
|
777513
|
+
16944: "Incorrect certificate version",
|
|
777514
|
+
16945: "Incorrect certificate validity",
|
|
777515
|
+
16946: "Incorrect certificate validity index",
|
|
777516
|
+
16947: "Unknown signer key ID",
|
|
777517
|
+
16948: "Unknown signature algorithm",
|
|
777518
|
+
16949: "Unknown public key ID",
|
|
777519
|
+
16950: "Unknown public key usage",
|
|
777520
|
+
16951: "Incorrect elliptic curve ID",
|
|
777521
|
+
16952: "Incorrect signature algorithm associated to the public key",
|
|
777522
|
+
16953: "Unknown target device",
|
|
777523
|
+
16941: "Unknown certificate tag",
|
|
777524
|
+
13057: "Failed to hash data",
|
|
777525
|
+
16942: "expected_key_usage doesn't match certificate key usage",
|
|
777526
|
+
22304: "Failed to verify signature",
|
|
777527
|
+
16664: "trusted_name buffer is too small to contain the trusted name"
|
|
777699
777528
|
};
|
|
777700
|
-
var
|
|
777701
|
-
|
|
777702
|
-
|
|
777703
|
-
|
|
777704
|
-
|
|
777705
|
-
|
|
777706
|
-
|
|
777707
|
-
|
|
777708
|
-
|
|
777709
|
-
|
|
777710
|
-
|
|
777711
|
-
|
|
777712
|
-
|
|
777713
|
-
|
|
777714
|
-
|
|
777715
|
-
|
|
777716
|
-
|
|
777717
|
-
|
|
777718
|
-
|
|
777719
|
-
|
|
777720
|
-
|
|
777721
|
-
|
|
777722
|
-
|
|
777723
|
-
|
|
777724
|
-
|
|
777725
|
-
|
|
777726
|
-
|
|
777727
|
-
|
|
777728
|
-
|
|
777729
|
-
|
|
777730
|
-
|
|
777731
|
-
|
|
777732
|
-
|
|
777733
|
-
|
|
777734
|
-
|
|
777735
|
-
|
|
777736
|
-
|
|
777737
|
-
var LINE_FEED_ASCII = 10;
|
|
777738
|
-
function isPrintableASCII(buffer2, isLegacy) {
|
|
777739
|
-
return buffer2.every((element) => {
|
|
777740
|
-
return (
|
|
777741
|
-
// The solana app was not allowing new lines as ascii
|
|
777742
|
-
// and would treat the message as UTF-8 (requiring blind signing)
|
|
777743
|
-
!isLegacy && element === LINE_FEED_ASCII || MIN_PRINTABLE_ASCII <= element && element <= MAX_PRINTABLE_ASCII
|
|
777744
|
-
);
|
|
777745
|
-
});
|
|
777746
|
-
}
|
|
777747
|
-
function isUTF8(buffer2) {
|
|
777748
|
-
try {
|
|
777749
|
-
new TextDecoder("utf8", { fatal: true }).decode(buffer2);
|
|
777750
|
-
return true;
|
|
777751
|
-
} catch {
|
|
777752
|
-
return false;
|
|
777529
|
+
var errorCodeValue = Object.keys(ErrorCode2).map((v38) => parseInt(v38));
|
|
777530
|
+
function throwError4(code) {
|
|
777531
|
+
switch (code) {
|
|
777532
|
+
case 16943:
|
|
777533
|
+
throw new PKIStructError();
|
|
777534
|
+
case 16944:
|
|
777535
|
+
throw new PKICertificateVersionError();
|
|
777536
|
+
case 16945:
|
|
777537
|
+
throw new PKICertificateValidityError();
|
|
777538
|
+
case 16946:
|
|
777539
|
+
throw new PKICertificateIndexError();
|
|
777540
|
+
case 16947:
|
|
777541
|
+
throw new PKIUnknownSignerIdError();
|
|
777542
|
+
case 16948:
|
|
777543
|
+
throw new PKIUnknownSignerAlgorithmError();
|
|
777544
|
+
case 16949:
|
|
777545
|
+
throw new PKIUnknownPublicIdError();
|
|
777546
|
+
case 16950:
|
|
777547
|
+
throw new PKIUnknownPublicUsageError();
|
|
777548
|
+
case 16951:
|
|
777549
|
+
throw new PKIIncorrectCurveError();
|
|
777550
|
+
case 16952:
|
|
777551
|
+
throw new PKIIncorrectSignatureError();
|
|
777552
|
+
case 16953:
|
|
777553
|
+
throw new PKIUnknownDeviceError();
|
|
777554
|
+
case 16941:
|
|
777555
|
+
throw new PKIUnknownCertificateTagError();
|
|
777556
|
+
case 13057:
|
|
777557
|
+
throw new PKIFailedHashError();
|
|
777558
|
+
case 16942:
|
|
777559
|
+
throw new PKIMismatchKeyError();
|
|
777560
|
+
case 22304:
|
|
777561
|
+
throw new PKIFailedVerificationError();
|
|
777562
|
+
case 16664:
|
|
777563
|
+
throw new PKITrustedNameTooSmallError();
|
|
777564
|
+
default:
|
|
777565
|
+
throw new PKIError("Unknown");
|
|
777753
777566
|
}
|
|
777754
777567
|
}
|
|
777755
|
-
|
|
777756
|
-
|
|
777757
|
-
|
|
777758
|
-
if (isPrintableASCII(messageBuffer, isLegacy)) {
|
|
777759
|
-
return 0;
|
|
777760
|
-
} else if (isUTF8(messageBuffer)) {
|
|
777761
|
-
return 1;
|
|
777762
|
-
}
|
|
777763
|
-
} else if (messageBuffer.length <= OFFCM_MAX_V0_LEN) {
|
|
777764
|
-
if (isUTF8(messageBuffer)) {
|
|
777765
|
-
return 2;
|
|
777766
|
-
}
|
|
777568
|
+
var PKIError = class extends Error {
|
|
777569
|
+
constructor(cause) {
|
|
777570
|
+
super("PKIError due to " + cause);
|
|
777767
777571
|
}
|
|
777768
|
-
|
|
777769
|
-
|
|
777770
|
-
|
|
777771
|
-
|
|
777772
|
-
|
|
777773
|
-
|
|
777774
|
-
var
|
|
777775
|
-
|
|
777776
|
-
|
|
777777
|
-
|
|
777778
|
-
|
|
777779
|
-
|
|
777780
|
-
|
|
777781
|
-
|
|
777782
|
-
|
|
777783
|
-
|
|
777784
|
-
|
|
777785
|
-
|
|
777786
|
-
|
|
777787
|
-
|
|
777788
|
-
|
|
777789
|
-
|
|
777790
|
-
|
|
777791
|
-
|
|
777792
|
-
}
|
|
777572
|
+
};
|
|
777573
|
+
var PKIStructError = class extends PKIError {
|
|
777574
|
+
constructor() {
|
|
777575
|
+
super(ErrorCode2[16943]);
|
|
777576
|
+
}
|
|
777577
|
+
};
|
|
777578
|
+
var PKICertificateVersionError = class extends PKIError {
|
|
777579
|
+
constructor() {
|
|
777580
|
+
super(ErrorCode2[16944]);
|
|
777581
|
+
}
|
|
777582
|
+
};
|
|
777583
|
+
var PKICertificateValidityError = class extends PKIError {
|
|
777584
|
+
constructor() {
|
|
777585
|
+
super(ErrorCode2[16945]);
|
|
777586
|
+
}
|
|
777587
|
+
};
|
|
777588
|
+
var PKICertificateIndexError = class extends PKIError {
|
|
777589
|
+
constructor() {
|
|
777590
|
+
super(ErrorCode2[16946]);
|
|
777591
|
+
}
|
|
777592
|
+
};
|
|
777593
|
+
var PKIUnknownSignerIdError = class extends PKIError {
|
|
777594
|
+
constructor() {
|
|
777595
|
+
super(ErrorCode2[16947]);
|
|
777596
|
+
}
|
|
777597
|
+
};
|
|
777598
|
+
var PKIUnknownSignerAlgorithmError = class extends PKIError {
|
|
777599
|
+
constructor() {
|
|
777600
|
+
super(ErrorCode2[16948]);
|
|
777601
|
+
}
|
|
777602
|
+
};
|
|
777603
|
+
var PKIUnknownPublicIdError = class extends PKIError {
|
|
777604
|
+
constructor() {
|
|
777605
|
+
super(ErrorCode2[16949]);
|
|
777606
|
+
}
|
|
777607
|
+
};
|
|
777608
|
+
var PKIUnknownPublicUsageError = class extends PKIError {
|
|
777609
|
+
constructor() {
|
|
777610
|
+
super(ErrorCode2[16950]);
|
|
777611
|
+
}
|
|
777612
|
+
};
|
|
777613
|
+
var PKIIncorrectCurveError = class extends PKIError {
|
|
777614
|
+
constructor() {
|
|
777615
|
+
super(ErrorCode2[16951]);
|
|
777616
|
+
}
|
|
777617
|
+
};
|
|
777618
|
+
var PKIIncorrectSignatureError = class extends PKIError {
|
|
777619
|
+
constructor() {
|
|
777620
|
+
super(ErrorCode2[16952]);
|
|
777621
|
+
}
|
|
777622
|
+
};
|
|
777623
|
+
var PKIUnknownDeviceError = class extends PKIError {
|
|
777624
|
+
constructor() {
|
|
777625
|
+
super(ErrorCode2[16953]);
|
|
777626
|
+
}
|
|
777627
|
+
};
|
|
777628
|
+
var PKIUnknownCertificateTagError = class extends PKIError {
|
|
777629
|
+
constructor() {
|
|
777630
|
+
super(ErrorCode2[16941]);
|
|
777631
|
+
}
|
|
777632
|
+
};
|
|
777633
|
+
var PKIFailedHashError = class extends PKIError {
|
|
777634
|
+
constructor() {
|
|
777635
|
+
super(ErrorCode2[13057]);
|
|
777636
|
+
}
|
|
777637
|
+
};
|
|
777638
|
+
var PKIMismatchKeyError = class extends PKIError {
|
|
777639
|
+
constructor() {
|
|
777640
|
+
super(ErrorCode2[16942]);
|
|
777641
|
+
}
|
|
777642
|
+
};
|
|
777643
|
+
var PKIFailedVerificationError = class extends PKIError {
|
|
777644
|
+
constructor() {
|
|
777645
|
+
super(ErrorCode2[22304]);
|
|
777646
|
+
}
|
|
777647
|
+
};
|
|
777648
|
+
var PKITrustedNameTooSmallError = class extends PKIError {
|
|
777649
|
+
constructor() {
|
|
777650
|
+
super(ErrorCode2[16664]);
|
|
777651
|
+
}
|
|
777652
|
+
};
|
|
777793
777653
|
|
|
777794
|
-
// ../../libs/
|
|
777795
|
-
var
|
|
777796
|
-
var
|
|
777797
|
-
var
|
|
777798
|
-
|
|
777799
|
-
|
|
777800
|
-
|
|
777654
|
+
// ../../libs/ledgerjs/packages/hw-bolos/lib-es/loadPKI.js
|
|
777655
|
+
var handledErrorCode = errorCodeValue.concat(StatusCodes.OK);
|
|
777656
|
+
var CLA7 = 176;
|
|
777657
|
+
var INS7 = 6;
|
|
777658
|
+
var P22 = 0;
|
|
777659
|
+
var keyUsage = {
|
|
777660
|
+
GENUINE_CHECK: 1,
|
|
777661
|
+
EXCHANGE_PAYLOAD: 2,
|
|
777662
|
+
NFT_METADATA: 3,
|
|
777663
|
+
TRUSTED_NAME: 4,
|
|
777664
|
+
BACKUP_PROVIDER: 5,
|
|
777665
|
+
RECOVER_ORCHESTRATOR: 6,
|
|
777666
|
+
PLUGIN_METADATA: 7,
|
|
777667
|
+
COIN_META: 8,
|
|
777668
|
+
SEED_ID_AUTH: 9,
|
|
777669
|
+
UNKNOWN: 10
|
|
777670
|
+
};
|
|
777671
|
+
var loadPKI_default = async (transport, key2, descriptor, signature3) => {
|
|
777672
|
+
const descriptorBuffer = Buffer.from(descriptor, "hex");
|
|
777673
|
+
const signatureBuffer = Buffer.from(signature3, "hex");
|
|
777674
|
+
const result2 = await transport.send(CLA7, INS7, keyUsage[key2], P22, Buffer.concat([
|
|
777675
|
+
new Uint8Array(descriptorBuffer),
|
|
777676
|
+
new Uint8Array(Buffer.from("15", "hex")),
|
|
777677
|
+
new Uint8Array(Buffer.from([signatureBuffer.length])),
|
|
777678
|
+
new Uint8Array(signatureBuffer)
|
|
777679
|
+
]), handledErrorCode);
|
|
777680
|
+
const resultCode = result2.readUInt16BE(result2.length - 2);
|
|
777681
|
+
if (resultCode !== StatusCodes.OK) {
|
|
777682
|
+
throwError4(resultCode);
|
|
777801
777683
|
}
|
|
777802
|
-
let signedMessage;
|
|
777803
|
-
const result2 = await signerContext3(deviceId, async (signer) => {
|
|
777804
|
-
const { version: version33 } = await signer.getAppConfiguration();
|
|
777805
|
-
const isLegacy = import_semver12.default.lt(version33, config_default5.getCoinConfig().legacyOCMSMaxVersion);
|
|
777806
|
-
signedMessage = toOffChainMessage(message2, account3.freshAddress, isLegacy);
|
|
777807
|
-
return signer.signMessage(account3.freshAddressPath, signedMessage.toString("hex"));
|
|
777808
|
-
});
|
|
777809
|
-
(0, import_invariant41.default)(signedMessage, "signedMessage should exist");
|
|
777810
|
-
const signatureCount = Buffer.from([1]);
|
|
777811
|
-
const envelope = Buffer.concat([signatureCount, result2.signature, signedMessage]);
|
|
777812
|
-
return { signature: import_bs587.default.encode(envelope) };
|
|
777813
777684
|
};
|
|
777814
777685
|
|
|
777815
|
-
// ../../libs/
|
|
777686
|
+
// ../../libs/live-signer-solana/lib-es/LegacySignerSolana.js
|
|
777687
|
+
init_lib_es();
|
|
777816
777688
|
var TRUSTED_NAME_MIN_VERSION = "1.7.1";
|
|
777817
777689
|
var MANAGER_APP_NAME = "Solana";
|
|
777818
|
-
async function checkVersion(app) {
|
|
777819
|
-
const { version: version33 } = await app.getAppConfiguration();
|
|
777820
|
-
if (import_semver13.default.lt(version33, TRUSTED_NAME_MIN_VERSION)) {
|
|
777821
|
-
throw new UpdateYourApp(void 0, {
|
|
777822
|
-
managerAppName: MANAGER_APP_NAME
|
|
777823
|
-
});
|
|
777824
|
-
}
|
|
777825
|
-
}
|
|
777826
777690
|
function isPKIUnsupportedError(err) {
|
|
777827
777691
|
return err instanceof TransportStatusError && err.message.includes("0x6a81");
|
|
777828
777692
|
}
|
|
777829
|
-
var
|
|
777830
|
-
|
|
777831
|
-
|
|
777832
|
-
|
|
777833
|
-
|
|
777834
|
-
|
|
777835
|
-
|
|
777836
|
-
|
|
777837
|
-
|
|
777838
|
-
|
|
777839
|
-
|
|
777840
|
-
|
|
777841
|
-
|
|
777842
|
-
|
|
777843
|
-
|
|
777844
|
-
|
|
777845
|
-
|
|
777846
|
-
|
|
777693
|
+
var LegacySignerSolana = class {
|
|
777694
|
+
signer;
|
|
777695
|
+
transport;
|
|
777696
|
+
constructor(transport) {
|
|
777697
|
+
this.signer = new Solana(transport);
|
|
777698
|
+
this.transport = transport;
|
|
777699
|
+
}
|
|
777700
|
+
getAppConfiguration() {
|
|
777701
|
+
return this.signer.getAppConfiguration();
|
|
777702
|
+
}
|
|
777703
|
+
async checkAppVersion() {
|
|
777704
|
+
const { version: version33 } = await this.getAppConfiguration();
|
|
777705
|
+
if (import_semver13.default.lt(version33, TRUSTED_NAME_MIN_VERSION)) {
|
|
777706
|
+
throw new UpdateYourApp(void 0, {
|
|
777707
|
+
managerAppName: MANAGER_APP_NAME
|
|
777708
|
+
});
|
|
777709
|
+
}
|
|
777710
|
+
}
|
|
777711
|
+
getAddress(path4, display) {
|
|
777712
|
+
return this.signer.getAddress(path4, display);
|
|
777713
|
+
}
|
|
777714
|
+
async signTransaction(path4, tx, resolution) {
|
|
777715
|
+
if (resolution) {
|
|
777716
|
+
if (!resolution.deviceModelId) {
|
|
777717
|
+
throw new Error("Resolution provided without a deviceModelId");
|
|
777718
|
+
}
|
|
777719
|
+
if (resolution.deviceModelId !== DeviceModelId.nanoS) {
|
|
777720
|
+
const { descriptor, signature: signature3 } = await lib_es_default2.getCertificate(resolution.deviceModelId);
|
|
777721
|
+
try {
|
|
777722
|
+
await loadPKI_default(this.transport, "TRUSTED_NAME", descriptor, signature3);
|
|
777723
|
+
} catch (err) {
|
|
777724
|
+
if (isPKIUnsupportedError(err)) {
|
|
777725
|
+
throw new LatestFirmwareVersionRequired("LatestFirmwareVersionRequired");
|
|
777847
777726
|
}
|
|
777848
|
-
|
|
777849
|
-
|
|
777850
|
-
|
|
777851
|
-
|
|
777852
|
-
|
|
777853
|
-
|
|
777854
|
-
|
|
777727
|
+
}
|
|
777728
|
+
if (resolution.tokenAddress) {
|
|
777729
|
+
await this.checkAppVersion();
|
|
777730
|
+
const challenge = await this.signer.getChallenge();
|
|
777731
|
+
const { signedDescriptor } = await lib_es_default3.getOwnerAddress(resolution.tokenAddress, challenge);
|
|
777732
|
+
if (signedDescriptor) {
|
|
777733
|
+
await this.signer.provideTrustedName(signedDescriptor);
|
|
777855
777734
|
}
|
|
777856
|
-
|
|
777857
|
-
|
|
777858
|
-
|
|
777859
|
-
|
|
777860
|
-
|
|
777861
|
-
|
|
777862
|
-
|
|
777735
|
+
}
|
|
777736
|
+
if (resolution.createATA) {
|
|
777737
|
+
await this.checkAppVersion();
|
|
777738
|
+
const challenge = await this.signer.getChallenge();
|
|
777739
|
+
const { signedDescriptor } = await lib_es_default3.computedTokenAddress(resolution.createATA.address, resolution.createATA.mintAddress, challenge);
|
|
777740
|
+
if (signedDescriptor) {
|
|
777741
|
+
await this.signer.provideTrustedName(signedDescriptor);
|
|
777863
777742
|
}
|
|
777864
777743
|
}
|
|
777865
777744
|
}
|
|
777866
|
-
return app.signTransaction(path4, tx);
|
|
777867
|
-
},
|
|
777868
|
-
signMessage: (path4, messageHex) => {
|
|
777869
|
-
return app.signOffchainMessage(path4, Buffer.from(messageHex, "hex"));
|
|
777870
777745
|
}
|
|
777871
|
-
|
|
777746
|
+
return this.signer.signTransaction(path4, tx);
|
|
777747
|
+
}
|
|
777748
|
+
signMessage(path4, messageHex) {
|
|
777749
|
+
return this.signer.signOffchainMessage(path4, Buffer.from(messageHex, "hex"));
|
|
777750
|
+
}
|
|
777872
777751
|
};
|
|
777752
|
+
|
|
777753
|
+
// ../../libs/ledger-live-common/lib-es/families/solana/setup.js
|
|
777754
|
+
var createSigner16 = (transport) => new LegacySignerSolana(transport);
|
|
777873
777755
|
var getCurrencyConfig7 = () => {
|
|
777874
777756
|
return getCurrencyConfiguration(getCryptoCurrencyById("solana"));
|
|
777875
777757
|
};
|
|
@@ -777920,6 +777802,10 @@ var import_bignumber240 = __toESM(require("bignumber.js"));
|
|
|
777920
777802
|
// ../../libs/coin-modules/coin-stacks/lib-es/contants.js
|
|
777921
777803
|
var STACKS_MAX_MEMO_SIZE = 34;
|
|
777922
777804
|
|
|
777805
|
+
// ../../libs/coin-modules/coin-stacks/lib-es/errors.js
|
|
777806
|
+
init_lib_es();
|
|
777807
|
+
var StacksMemoTooLong = createCustomErrorClass("StacksMemoTooLong");
|
|
777808
|
+
|
|
777923
777809
|
// ../../libs/coin-modules/coin-stacks/lib-es/bridge/utils/addresses.js
|
|
777924
777810
|
var import_c32check = __toESM(require_lib63());
|
|
777925
777811
|
var validateAddress3 = (input) => {
|
|
@@ -782096,6 +781982,21 @@ var NetworkCongestionLevel;
|
|
|
782096
781982
|
NetworkCongestionLevel2["HIGH"] = "HIGH";
|
|
782097
781983
|
})(NetworkCongestionLevel || (NetworkCongestionLevel = {}));
|
|
782098
781984
|
|
|
781985
|
+
// ../../libs/coin-modules/coin-stellar/lib-es/types/errors.js
|
|
781986
|
+
init_lib_es();
|
|
781987
|
+
var StellarBurnAddressError = createCustomErrorClass("StellarBurnAddressError");
|
|
781988
|
+
var StellarAssetRequired = createCustomErrorClass("StellarAssetRequired");
|
|
781989
|
+
var StellarMuxedAccountNotExist = createCustomErrorClass("StellarMuxedAccountNotExist");
|
|
781990
|
+
var StellarMemoRecommended = createCustomErrorClass("StellarMemoRecommended");
|
|
781991
|
+
var StellarWrongMemoFormat = createCustomErrorClass("StellarWrongMemoFormat");
|
|
781992
|
+
var StellarAssetNotAccepted = createCustomErrorClass("StellarAssetNotAccepted");
|
|
781993
|
+
var StellarAssetNotFound = createCustomErrorClass("StellarAssetNotFound");
|
|
781994
|
+
var StellarNotEnoughNativeBalance = createCustomErrorClass("StellarNotEnoughNativeBalance");
|
|
781995
|
+
var StellarFeeSmallerThanRecommended = createCustomErrorClass("StellarFeeSmallerThanRecommended");
|
|
781996
|
+
var StellarFeeSmallerThanBase = createCustomErrorClass("StellarFeeSmallerThanBase");
|
|
781997
|
+
var StellarNotEnoughNativeBalanceToAddTrustline = createCustomErrorClass("StellarNotEnoughNativeBalanceToAddTrustline");
|
|
781998
|
+
var StellarSourceHasMultiSign = createCustomErrorClass("StellarSourceHasMultiSign");
|
|
781999
|
+
|
|
782099
782000
|
// ../../libs/coin-modules/coin-stellar/lib-es/network/serialization.js
|
|
782100
782001
|
var import_bignumber246 = __toESM(require("bignumber.js"));
|
|
782101
782002
|
var currency = getCryptoCurrencyById("stellar");
|
|
@@ -782115,7 +782016,7 @@ function getReservedBalance(account3) {
|
|
|
782115
782016
|
const numOfEntries = new import_bignumber246.default(account3.subentry_count || 0);
|
|
782116
782017
|
return new import_bignumber246.default(BASE_RESERVE_MIN_COUNT).plus(numOfEntries).plus(numOfSponsoringEntries).minus(numOfSponsoredEntries).times(BASE_RESERVE).plus(amountInOffers);
|
|
782117
782018
|
}
|
|
782118
|
-
function rawOperationsToOperations(operations, addr, accountId2) {
|
|
782019
|
+
async function rawOperationsToOperations(operations, addr, accountId2, minHeight) {
|
|
782119
782020
|
const supportedOperationTypes = [
|
|
782120
782021
|
"create_account",
|
|
782121
782022
|
"payment",
|
|
@@ -782123,12 +782024,15 @@ function rawOperationsToOperations(operations, addr, accountId2) {
|
|
|
782123
782024
|
"path_payment_strict_receive",
|
|
782124
782025
|
"change_trust"
|
|
782125
782026
|
];
|
|
782126
|
-
|
|
782027
|
+
const ops = await Promise.all(operations.filter((operation) => {
|
|
782127
782028
|
return operation.from === addr || operation.to === addr || operation.funder === addr || operation.account === addr || operation.trustor === addr || operation.source_account === addr;
|
|
782128
|
-
}).filter((operation) => supportedOperationTypes.includes(operation.type)).map((operation) => formatOperation(operation, accountId2, addr)));
|
|
782029
|
+
}).filter((operation) => supportedOperationTypes.includes(operation.type)).map((operation) => formatOperation(operation, accountId2, addr, minHeight)));
|
|
782030
|
+
return ops.filter((op) => op !== void 0);
|
|
782129
782031
|
}
|
|
782130
|
-
async function formatOperation(rawOperation, accountId2, addr) {
|
|
782032
|
+
async function formatOperation(rawOperation, accountId2, addr, minHeight) {
|
|
782131
782033
|
const transaction = await rawOperation.transaction();
|
|
782034
|
+
if (transaction.ledger_attr < minHeight)
|
|
782035
|
+
return void 0;
|
|
782132
782036
|
const { hash: blockHash, closed_at: blockTime } = await transaction.ledger();
|
|
782133
782037
|
const type5 = getOperationType7(rawOperation, addr);
|
|
782134
782038
|
const value6 = getValue5(rawOperation, transaction, type5);
|
|
@@ -782377,14 +782281,14 @@ async function fetchAllOperations(accountId2, addr, order, cursor = "", maxOpera
|
|
|
782377
782281
|
if (!rawOperations || !rawOperations.records.length) {
|
|
782378
782282
|
return [];
|
|
782379
782283
|
}
|
|
782380
|
-
operations = operations.concat(await rawOperationsToOperations(rawOperations.records, addr, accountId2));
|
|
782284
|
+
operations = operations.concat(await rawOperationsToOperations(rawOperations.records, addr, accountId2, 0));
|
|
782381
782285
|
while (rawOperations.records.length > 0) {
|
|
782382
782286
|
if (maxOperations && fetchedOpsCount >= maxOperations) {
|
|
782383
782287
|
break;
|
|
782384
782288
|
}
|
|
782385
782289
|
fetchedOpsCount += limit;
|
|
782386
782290
|
rawOperations = await rawOperations.next();
|
|
782387
|
-
operations = operations.concat(await rawOperationsToOperations(rawOperations.records, addr, accountId2));
|
|
782291
|
+
operations = operations.concat(await rawOperationsToOperations(rawOperations.records, addr, accountId2, 0));
|
|
782388
782292
|
}
|
|
782389
782293
|
return operations;
|
|
782390
782294
|
} catch (e37) {
|
|
@@ -801791,6 +801695,11 @@ async function broadcast20(signature3) {
|
|
|
801791
801695
|
return await rpc18.injectOperation(signature3);
|
|
801792
801696
|
}
|
|
801793
801697
|
|
|
801698
|
+
// ../../libs/coin-modules/coin-tezos/lib-es/types/errors.js
|
|
801699
|
+
init_lib_es();
|
|
801700
|
+
var InvalidAddressBecauseAlreadyDelegated = createCustomErrorClass("InvalidAddressBecauseAlreadyDelegated");
|
|
801701
|
+
var UnsupportedTransactionMode = createCustomErrorClass("UnsupportedTransactionMode");
|
|
801702
|
+
|
|
801794
801703
|
// ../../libs/coin-modules/coin-tezos/lib-es/logic/craftTransaction.js
|
|
801795
801704
|
async function craftTransaction3(account3, transaction, publicKey3) {
|
|
801796
801705
|
const { address: address4 } = account3;
|
|
@@ -807715,6 +807624,12 @@ var params_default = {
|
|
|
807715
807624
|
Set: new abi.Event(Set2)
|
|
807716
807625
|
};
|
|
807717
807626
|
|
|
807627
|
+
// ../../libs/coin-modules/coin-vechain/lib-es/errors.js
|
|
807628
|
+
init_lib_es();
|
|
807629
|
+
var NotEnoughVTHO = createCustomErrorClass("NotEnoughVTHO");
|
|
807630
|
+
var MustBeVechain = createCustomErrorClass("MustBeVechain");
|
|
807631
|
+
var ImpossibleToCalculateAmountAndFees = createCustomErrorClass("ImpossibleToCalculateAmountAndFees");
|
|
807632
|
+
|
|
807718
807633
|
// ../../libs/coin-modules/coin-vechain/lib-es/common-logic/transaction-utils.js
|
|
807719
807634
|
var GAS_COEFFICIENT = 15e3;
|
|
807720
807635
|
var generateNonce = () => {
|
|
@@ -826138,7 +826053,103 @@ var SkipReason;
|
|
|
826138
826053
|
SkipReason2[SkipReason2["NotEnoughSpace"] = 2] = "NotEnoughSpace";
|
|
826139
826054
|
})(SkipReason || (SkipReason = {}));
|
|
826140
826055
|
|
|
826056
|
+
// ../../libs/ledger-live-common/lib-es/errors.js
|
|
826057
|
+
init_lib_es();
|
|
826058
|
+
init_lib_es();
|
|
826059
|
+
|
|
826060
|
+
// ../../libs/coin-modules/coin-aptos/lib-es/errors.js
|
|
826061
|
+
init_lib_es();
|
|
826062
|
+
var SequenceNumberTooOldError = createCustomErrorClass("SequenceNumberTooOld");
|
|
826063
|
+
var SequenceNumberTooNewError = createCustomErrorClass("SequenceNumberTooNew");
|
|
826064
|
+
var TransactionExpiredError = createCustomErrorClass("TransactionExpired");
|
|
826065
|
+
|
|
826066
|
+
// ../../libs/ledger-live-common/lib-es/errors.js
|
|
826067
|
+
var ConnectAppTimeout = createCustomErrorClass("ConnectAppTimeout");
|
|
826068
|
+
var ConnectManagerTimeout = createCustomErrorClass("ConnectManagerTimeout");
|
|
826069
|
+
var GetAppAndVersionUnsupportedFormat = createCustomErrorClass("GetAppAndVersionUnsupportedFormat");
|
|
826070
|
+
var FeeEstimationFailed3 = createCustomErrorClass("FeeEstimationFailed");
|
|
826071
|
+
var TransactionRefusedOnDevice = createCustomErrorClass("TransactionRefusedOnDevice");
|
|
826072
|
+
var LanguageInstallRefusedOnDevice = createCustomErrorClass("LanguageInstallRefusedOnDevice");
|
|
826073
|
+
var ImageLoadRefusedOnDevice = createCustomErrorClass("ImageLoadRefusedOnDevice");
|
|
826074
|
+
var ImageDoesNotExistOnDevice = createCustomErrorClass("ImageDoesNotExistOnDevice");
|
|
826075
|
+
var ImageCommitRefusedOnDevice = createCustomErrorClass("ImageCommitRefusedOnDevice");
|
|
826076
|
+
var LanguageInstallTimeout = createCustomErrorClass("LanguageInstallTimeout");
|
|
826077
|
+
var DeviceOnboarded = createCustomErrorClass("DeviceOnboarded");
|
|
826078
|
+
var DeviceNotOnboarded = createCustomErrorClass("DeviceNotOnboarded");
|
|
826079
|
+
var DeviceAlreadySetup = createCustomErrorClass("DeviceAlreadySetup");
|
|
826080
|
+
var SourceHasMultiSign = createCustomErrorClass("SourceHasMultiSign");
|
|
826081
|
+
var RPCHostRequired = createCustomErrorClass("RPCHostRequired");
|
|
826082
|
+
var RPCHostInvalid = createCustomErrorClass("RPCHostInvalid");
|
|
826083
|
+
var RPCUserRequired = createCustomErrorClass("RPCUserRequired");
|
|
826084
|
+
var RPCPassRequired = createCustomErrorClass("RPCPassRequired");
|
|
826085
|
+
var CosmosBroadcastError = {
|
|
826086
|
+
"1": createCustomErrorClass("CosmosBroadcastCodeInternal"),
|
|
826087
|
+
"2": createCustomErrorClass("CosmosBroadcastCodeTxDecode"),
|
|
826088
|
+
"3": createCustomErrorClass("CosmosBroadcastCodeInvalidSequence"),
|
|
826089
|
+
"4": createCustomErrorClass("CosmosBroadcastCodeUnauthorized"),
|
|
826090
|
+
"5": createCustomErrorClass("CosmosBroadcastCodeInsufficientFunds"),
|
|
826091
|
+
"6": createCustomErrorClass("CosmosBroadcastCodeUnknownRequest"),
|
|
826092
|
+
"7": createCustomErrorClass("CosmosBroadcastCodeInvalidAddress"),
|
|
826093
|
+
"8": createCustomErrorClass("CosmosBroadcastCodeInvalidPubKey"),
|
|
826094
|
+
"9": createCustomErrorClass("CosmosBroadcastCodeUnknownAddress"),
|
|
826095
|
+
"10": createCustomErrorClass("CosmosBroadcastCodeInvalidCoins"),
|
|
826096
|
+
"11": createCustomErrorClass("CosmosBroadcastCodeOutOfGas"),
|
|
826097
|
+
"12": createCustomErrorClass("CosmosBroadcastCodeMemoTooLarge"),
|
|
826098
|
+
"13": createCustomErrorClass("CosmosBroadcastCodeInsufficientFee"),
|
|
826099
|
+
"14": createCustomErrorClass("CosmosBroadcastCodeTooManySignatures"),
|
|
826100
|
+
"15": createCustomErrorClass("CosmosBroadcastCodeNoSignatures"),
|
|
826101
|
+
"16": createCustomErrorClass("CosmosBroadcastCodeJSONMarshal"),
|
|
826102
|
+
"17": createCustomErrorClass("CosmosBroadcastCodeJSONUnmarshal"),
|
|
826103
|
+
"18": createCustomErrorClass("CosmosBroadcastCodeInvalidRequest"),
|
|
826104
|
+
"19": createCustomErrorClass("CosmosBroadcastCodeTxInMempoolCache"),
|
|
826105
|
+
"20": createCustomErrorClass("CosmosBroadcastCodeMempoolIsFull"),
|
|
826106
|
+
"21": createCustomErrorClass("CosmosBroadcastTxTooLarge"),
|
|
826107
|
+
"22": createCustomErrorClass("CosmosBroadcastKeyNotFound"),
|
|
826108
|
+
"23": createCustomErrorClass("CosmosBroadcastWrongPassword"),
|
|
826109
|
+
"24": createCustomErrorClass("CosmosBroadcastInvalidSigner"),
|
|
826110
|
+
"25": createCustomErrorClass("CosmosBroadcastInvalidGasAdjustment"),
|
|
826111
|
+
"26": createCustomErrorClass("CosmosBroadcastInvalidHeight"),
|
|
826112
|
+
"27": createCustomErrorClass("CosmosBroadcastInvalidVersion"),
|
|
826113
|
+
"28": createCustomErrorClass("CosmosBroadcastInvalidChainID"),
|
|
826114
|
+
"29": createCustomErrorClass("CosmosBroadcastInvalidType"),
|
|
826115
|
+
"30": createCustomErrorClass("CosmosBroadcastTimeoutHeight"),
|
|
826116
|
+
"31": createCustomErrorClass("CosmosBroadcastUnknownExtensionOptions"),
|
|
826117
|
+
"32": createCustomErrorClass("CosmosBroadcastWrongSequence"),
|
|
826118
|
+
"33": createCustomErrorClass("CosmosBroadcastPackAny"),
|
|
826119
|
+
"34": createCustomErrorClass("CosmosBroadcastUnpackAny"),
|
|
826120
|
+
"35": createCustomErrorClass("CosmosBroadcastLogic"),
|
|
826121
|
+
"36": createCustomErrorClass("CosmosBroadcastConflict")
|
|
826122
|
+
};
|
|
826123
|
+
var SatStackVersionTooOld = createCustomErrorClass("SatStackVersionTooOld");
|
|
826124
|
+
var SatStackAccessDown = createCustomErrorClass("SatStackAccessDown");
|
|
826125
|
+
var SatStackStillSyncing = createCustomErrorClass("SatStackStillSyncing");
|
|
826126
|
+
var SatStackDescriptorNotImported = createCustomErrorClass("SatStackDescriptorNotImported");
|
|
826127
|
+
var SwapNoAvailableProviders = createCustomErrorClass("SwapNoAvailableProviders");
|
|
826128
|
+
var NoSuchAppOnProvider = createCustomErrorClass("NoSuchAppOnProvider");
|
|
826129
|
+
var SwapExchangeRateAmountTooLow = createCustomErrorClass("SwapExchangeRateAmountTooLow");
|
|
826130
|
+
var SwapExchangeRateAmountTooHigh = createCustomErrorClass("SwapExchangeRateAmountTooHigh");
|
|
826131
|
+
var SwapExchangeRateAmountTooLowOrTooHigh = createCustomErrorClass("SwapExchangeRateAmountTooLowOrTooHigh");
|
|
826132
|
+
var SwapGenericAPIError = createCustomErrorClass("SwapGenericAPIError");
|
|
826133
|
+
var SwapRateExpiredError = createCustomErrorClass("SwapRateExpiredError");
|
|
826134
|
+
var JSONRPCResponseError = createCustomErrorClass("JSONRPCResponseError");
|
|
826135
|
+
var JSONDecodeError = createCustomErrorClass("JSONDecodeError");
|
|
826136
|
+
var NoIPHeaderError = createCustomErrorClass("NoIPHeaderError");
|
|
826137
|
+
var CurrencyNotSupportedError = createCustomErrorClass("CurrencyNotSupportedError");
|
|
826138
|
+
var CurrencyDisabledError = createCustomErrorClass("CurrencyDisabledError");
|
|
826139
|
+
var CurrencyDisabledAsInputError = createCustomErrorClass("CurrencyDisabledAsInputError");
|
|
826140
|
+
var CurrencyDisabledAsOutputError = createCustomErrorClass("CurrencyDisabledAsOutputError");
|
|
826141
|
+
var CurrencyNotSupportedByProviderError = createCustomErrorClass("CurrencyNotSupportedByProviderError");
|
|
826142
|
+
var TradeMethodNotSupportedError = createCustomErrorClass("TradeMethodNotSupportedError");
|
|
826143
|
+
var UnexpectedError = createCustomErrorClass("UnexpectedError");
|
|
826144
|
+
var NotImplementedError = createCustomErrorClass("NotImplementedError");
|
|
826145
|
+
var ValidationError2 = createCustomErrorClass("ValidationError");
|
|
826146
|
+
var AccessDeniedError = createCustomErrorClass("AccessDeniedError");
|
|
826147
|
+
var OutdatedApp = createCustomErrorClass("OutdatedApp");
|
|
826148
|
+
var BluetoothNotSupportedError = createCustomErrorClass("FwUpdateBluetoothNotSupported");
|
|
826149
|
+
var EConnResetError = createCustomErrorClass("EConnReset");
|
|
826150
|
+
|
|
826141
826151
|
// ../../libs/ledger-live-common/lib-es/apps/logic.js
|
|
826152
|
+
init_lib_es();
|
|
826142
826153
|
var initState = ({ deviceModelId, appsListNames, installed, appByName, ...listAppsResult }, appsToRestore) => {
|
|
826143
826154
|
let state = {
|
|
826144
826155
|
...listAppsResult,
|
|
@@ -851561,7 +851572,7 @@ var swapBackendErrorCodes = {
|
|
|
851561
851572
|
"400": TradeMethodNotSupportedError,
|
|
851562
851573
|
"500": UnexpectedError,
|
|
851563
851574
|
"600": NotImplementedError,
|
|
851564
|
-
"700":
|
|
851575
|
+
"700": ValidationError2,
|
|
851565
851576
|
"701": AccessDeniedError
|
|
851566
851577
|
};
|
|
851567
851578
|
var getSwapAPIError = (errorCode, errorMessage) => {
|