@trezor/connect 9.1.5 → 9.1.7

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.
Files changed (186) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +1 -1
  3. package/lib/api/{binanceGetAddress.d.ts → binance/api/binanceGetAddress.d.ts} +4 -4
  4. package/lib/api/{binanceGetAddress.js → binance/api/binanceGetAddress.js} +10 -7
  5. package/lib/api/{binanceGetPublicKey.d.ts → binance/api/binanceGetPublicKey.d.ts} +3 -3
  6. package/lib/api/{binanceGetPublicKey.js → binance/api/binanceGetPublicKey.js} +5 -5
  7. package/lib/api/{binanceSignTransaction.d.ts → binance/api/binanceSignTransaction.d.ts} +3 -2
  8. package/lib/api/{binanceSignTransaction.js → binance/api/binanceSignTransaction.js} +8 -6
  9. package/lib/api/binance/api/index.d.ts +4 -0
  10. package/lib/api/binance/api/index.js +13 -0
  11. package/lib/api/binance/binanceSignTx.d.ts +1 -1
  12. package/lib/api/binance/binanceSignTx.js +2 -1
  13. package/lib/api/bitcoin/TransactionComposer.d.ts +4 -4
  14. package/lib/api/bitcoin/TransactionComposer.js +4 -18
  15. package/lib/api/bitcoin/inputs.d.ts +2 -2
  16. package/lib/api/bitcoin/inputs.js +4 -5
  17. package/lib/api/bitcoin/outputs.d.ts +4 -4
  18. package/lib/api/bitcoin/outputs.js +14 -23
  19. package/lib/api/blockchainEstimateFee.d.ts +2 -2
  20. package/lib/api/cardano/api/cardanoComposeTransaction.d.ts +8 -0
  21. package/lib/api/cardano/api/cardanoComposeTransaction.js +69 -0
  22. package/lib/api/{cardanoGetAddress.d.ts → cardano/api/cardanoGetAddress.d.ts} +4 -4
  23. package/lib/api/{cardanoGetAddress.js → cardano/api/cardanoGetAddress.js} +11 -8
  24. package/lib/api/{cardanoGetNativeScriptHash.d.ts → cardano/api/cardanoGetNativeScriptHash.d.ts} +3 -3
  25. package/lib/api/{cardanoGetNativeScriptHash.js → cardano/api/cardanoGetNativeScriptHash.js} +5 -5
  26. package/lib/api/{cardanoGetPublicKey.d.ts → cardano/api/cardanoGetPublicKey.d.ts} +3 -3
  27. package/lib/api/{cardanoGetPublicKey.js → cardano/api/cardanoGetPublicKey.js} +6 -6
  28. package/lib/api/{cardanoSignTransaction.d.ts → cardano/api/cardanoSignTransaction.d.ts} +19 -8
  29. package/lib/api/{cardanoSignTransaction.js → cardano/api/cardanoSignTransaction.js} +33 -13
  30. package/lib/api/cardano/api/index.d.ts +6 -0
  31. package/lib/api/cardano/api/index.js +17 -0
  32. package/lib/api/cardano/cardanoUtils.d.ts +6 -0
  33. package/lib/api/cardano/cardanoUtils.js +64 -1
  34. package/lib/api/common/paramsValidator.js +5 -3
  35. package/lib/api/composeTransaction.d.ts +5 -5
  36. package/lib/api/composeTransaction.js +14 -19
  37. package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -0
  38. package/lib/api/{eosGetPublicKey.js → eos/api/eosGetPublicKey.js} +7 -5
  39. package/lib/api/{eosSignTransaction.d.ts → eos/api/eosSignTransaction.d.ts} +3 -2
  40. package/lib/api/{eosSignTransaction.js → eos/api/eosSignTransaction.js} +8 -6
  41. package/lib/api/eos/api/index.d.ts +3 -0
  42. package/lib/api/eos/api/index.js +11 -0
  43. package/lib/api/eos/eosSignTx.d.ts +1 -1
  44. package/lib/api/eos/eosSignTx.js +2 -1
  45. package/lib/api/{ethereumGetAddress.d.ts → ethereum/api/ethereumGetAddress.d.ts} +5 -5
  46. package/lib/api/{ethereumGetAddress.js → ethereum/api/ethereumGetAddress.js} +13 -10
  47. package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +16 -0
  48. package/lib/api/{ethereumGetPublicKey.js → ethereum/api/ethereumGetPublicKey.js} +6 -6
  49. package/lib/api/{ethereumSignMessage.d.ts → ethereum/api/ethereumSignMessage.d.ts} +3 -3
  50. package/lib/api/{ethereumSignMessage.js → ethereum/api/ethereumSignMessage.js} +7 -7
  51. package/lib/api/{ethereumSignTransaction.d.ts → ethereum/api/ethereumSignTransaction.d.ts} +12 -9
  52. package/lib/api/{ethereumSignTransaction.js → ethereum/api/ethereumSignTransaction.js} +38 -43
  53. package/lib/api/{ethereumSignTypedData.d.ts → ethereum/api/ethereumSignTypedData.d.ts} +3 -3
  54. package/lib/api/{ethereumSignTypedData.js → ethereum/api/ethereumSignTypedData.js} +10 -10
  55. package/lib/api/{ethereumVerifyMessage.d.ts → ethereum/api/ethereumVerifyMessage.d.ts} +2 -2
  56. package/lib/api/{ethereumVerifyMessage.js → ethereum/api/ethereumVerifyMessage.js} +3 -3
  57. package/lib/api/ethereum/api/index.d.ts +7 -0
  58. package/lib/api/ethereum/api/index.js +19 -0
  59. package/lib/api/ethereum/ethereumSignTx.d.ts +4 -2
  60. package/lib/api/ethereum/ethereumSignTx.js +19 -3
  61. package/lib/api/firmware/verifyAuthenticityProof.js +1 -1
  62. package/lib/api/firmware/x509certificate.d.ts +1 -0
  63. package/lib/api/firmware/x509certificate.js +34 -2
  64. package/lib/api/getAccountDescriptor.d.ts +20 -0
  65. package/lib/api/getAccountDescriptor.js +162 -0
  66. package/lib/api/getAccountInfo.d.ts +2 -0
  67. package/lib/api/getAddress.d.ts +1 -1
  68. package/lib/api/getAddress.js +4 -1
  69. package/lib/api/index.d.ts +1 -24
  70. package/lib/api/index.js +3 -50
  71. package/lib/api/nem/api/index.d.ts +3 -0
  72. package/lib/api/nem/api/index.js +11 -0
  73. package/lib/api/{nemGetAddress.d.ts → nem/api/nemGetAddress.d.ts} +4 -4
  74. package/lib/api/{nemGetAddress.js → nem/api/nemGetAddress.js} +10 -7
  75. package/lib/api/{nemSignTransaction.d.ts → nem/api/nemSignTransaction.d.ts} +2 -2
  76. package/lib/api/{nemSignTransaction.js → nem/api/nemSignTransaction.js} +7 -6
  77. package/lib/api/nem/nemSignTx.d.ts +1 -1
  78. package/lib/api/nem/nemSignTx.js +2 -1
  79. package/lib/api/ripple/api/index.d.ts +3 -0
  80. package/lib/api/ripple/api/index.js +11 -0
  81. package/lib/api/{rippleGetAddress.d.ts → ripple/api/rippleGetAddress.d.ts} +4 -4
  82. package/lib/api/{rippleGetAddress.js → ripple/api/rippleGetAddress.js} +10 -7
  83. package/lib/api/{rippleSignTransaction.d.ts → ripple/api/rippleSignTransaction.d.ts} +2 -2
  84. package/lib/api/{rippleSignTransaction.js → ripple/api/rippleSignTransaction.js} +7 -5
  85. package/lib/api/signTransaction.js +2 -0
  86. package/lib/api/solana/additionalInfo.d.ts +10 -0
  87. package/lib/api/solana/additionalInfo.js +33 -0
  88. package/lib/api/solana/api/index.d.ts +4 -0
  89. package/lib/api/solana/api/index.js +13 -0
  90. package/lib/api/solana/api/solanaGetAddress.d.ts +23 -0
  91. package/lib/api/solana/api/solanaGetAddress.js +133 -0
  92. package/lib/api/solana/api/solanaGetPublicKey.d.ts +12 -0
  93. package/lib/api/solana/api/solanaGetPublicKey.js +83 -0
  94. package/lib/api/solana/api/solanaSignTransaction.d.ts +10 -0
  95. package/lib/api/solana/api/solanaSignTransaction.js +34 -0
  96. package/lib/api/stellar/api/index.d.ts +3 -0
  97. package/lib/api/stellar/api/index.js +11 -0
  98. package/lib/api/{stellarGetAddress.d.ts → stellar/api/stellarGetAddress.d.ts} +4 -4
  99. package/lib/api/{stellarGetAddress.js → stellar/api/stellarGetAddress.js} +10 -7
  100. package/lib/api/{stellarSignTransaction.d.ts → stellar/api/stellarSignTransaction.d.ts} +2 -2
  101. package/lib/api/{stellarSignTransaction.js → stellar/api/stellarSignTransaction.js} +6 -6
  102. package/lib/api/tezos/api/index.d.ts +4 -0
  103. package/lib/api/tezos/api/index.js +13 -0
  104. package/lib/api/{tezosGetAddress.d.ts → tezos/api/tezosGetAddress.d.ts} +4 -4
  105. package/lib/api/{tezosGetAddress.js → tezos/api/tezosGetAddress.js} +10 -7
  106. package/lib/api/{tezosGetPublicKey.d.ts → tezos/api/tezosGetPublicKey.d.ts} +3 -3
  107. package/lib/api/{tezosGetPublicKey.js → tezos/api/tezosGetPublicKey.js} +7 -5
  108. package/lib/api/{tezosSignTransaction.d.ts → tezos/api/tezosSignTransaction.d.ts} +2 -2
  109. package/lib/api/{tezosSignTransaction.js → tezos/api/tezosSignTransaction.js} +5 -5
  110. package/lib/api/tezos/tezosSignTx.d.ts +1 -1
  111. package/lib/api/tezos/tezosSignTx.js +2 -1
  112. package/lib/backend/Blockchain.js +3 -0
  113. package/lib/constants/cardano.js +2 -2
  114. package/lib/constants/nem.js +3 -3
  115. package/lib/constants/network.d.ts +3 -0
  116. package/lib/constants/network.js +13 -1
  117. package/lib/core/AbstractMethod.js +3 -0
  118. package/lib/core/index.d.ts +3 -1
  119. package/lib/core/index.js +17 -4
  120. package/lib/core/method.d.ts +2 -2
  121. package/lib/core/method.js +8 -2
  122. package/lib/core/method.native.d.ts +5 -0
  123. package/lib/core/method.native.js +34 -0
  124. package/lib/data/DataManager.d.ts +22 -0
  125. package/lib/data/config.d.ts +22 -0
  126. package/lib/data/config.js +12 -1
  127. package/lib/data/connectSettings.js +4 -0
  128. package/lib/data/defaultFeeLevels.js +9 -0
  129. package/lib/data/deviceAuthenticityConfig.js +4 -1
  130. package/lib/data/firmwareInfo.d.ts +1 -1
  131. package/lib/data/firmwareInfo.js +4 -1
  132. package/lib/data/version.d.ts +1 -1
  133. package/lib/data/version.js +1 -1
  134. package/lib/device/Device.d.ts +3 -1
  135. package/lib/device/Device.js +23 -4
  136. package/lib/device/DeviceCommands.d.ts +2 -2
  137. package/lib/device/DeviceCommands.js +19 -3
  138. package/lib/device/DeviceList.js +4 -1
  139. package/lib/events/popup.d.ts +19 -3
  140. package/lib/events/popup.js +3 -0
  141. package/lib/events/ui-request.d.ts +1 -1
  142. package/lib/factory.js +5 -0
  143. package/lib/types/api/binance/index.d.ts +1 -0
  144. package/lib/types/api/bitcoin/index.d.ts +2 -0
  145. package/lib/types/api/cardano/index.d.ts +2 -0
  146. package/lib/types/api/cardanoComposeTransaction.d.ts +44 -0
  147. package/lib/types/api/cardanoComposeTransaction.js +3 -0
  148. package/lib/types/api/cardanoSignTransaction.d.ts +9 -0
  149. package/lib/types/api/composeTransaction.d.ts +28 -54
  150. package/lib/types/api/eos/index.d.ts +1 -0
  151. package/lib/types/api/ethereum/index.d.ts +2 -0
  152. package/lib/types/api/getAccountDescriptor.d.ts +16 -0
  153. package/lib/types/api/getAccountDescriptor.js +3 -0
  154. package/lib/types/api/index.d.ts +10 -0
  155. package/lib/types/api/nem/index.d.ts +1 -0
  156. package/lib/types/api/ripple/index.d.ts +1 -0
  157. package/lib/types/api/solana/index.d.ts +22 -0
  158. package/lib/types/api/solana/index.js +3 -0
  159. package/lib/types/api/solanaGetAddress.d.ts +4 -0
  160. package/lib/types/api/solanaGetAddress.js +3 -0
  161. package/lib/types/api/solanaGetPublicKey.d.ts +5 -0
  162. package/lib/types/api/solanaGetPublicKey.js +3 -0
  163. package/lib/types/api/solanaSignTransaction.d.ts +4 -0
  164. package/lib/types/api/solanaSignTransaction.js +3 -0
  165. package/lib/types/api/tezos/index.d.ts +1 -0
  166. package/lib/types/coinInfo.d.ts +5 -16
  167. package/lib/types/device.d.ts +1 -1
  168. package/lib/types/device.js +1 -1
  169. package/lib/types/index.d.ts +3 -1
  170. package/lib/types/index.js +1 -0
  171. package/lib/types/params.d.ts +3 -0
  172. package/lib/types/settings.d.ts +1 -0
  173. package/lib/utils/debug.d.ts +6 -3
  174. package/lib/utils/debug.js +13 -7
  175. package/lib/utils/deviceFeaturesUtils.js +8 -5
  176. package/lib/utils/formatUtils.d.ts +2 -0
  177. package/lib/utils/formatUtils.js +19 -1
  178. package/lib/workers/workers-browser.d.ts +2 -1
  179. package/lib/workers/workers-browser.js +3 -1
  180. package/lib/workers/workers-react-native.d.ts +2 -1
  181. package/lib/workers/workers-react-native.js +3 -1
  182. package/lib/workers/workers.d.ts +8 -5
  183. package/lib/workers/workers.js +34 -10
  184. package/package.json +22 -19
  185. package/lib/api/eosGetPublicKey.d.ts +0 -11
  186. package/lib/api/ethereumGetPublicKey.d.ts +0 -16
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const paramsValidator_1 = require("./common/paramsValidator");
5
- const coinInfo_1 = require("../data/coinInfo");
6
- const pathUtils_1 = require("../utils/pathUtils");
3
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
+ const paramsValidator_1 = require("../../common/paramsValidator");
5
+ const coinInfo_1 = require("../../../data/coinInfo");
6
+ const pathUtils_1 = require("../../../utils/pathUtils");
7
7
  class RippleSignTransaction extends AbstractMethod_1.AbstractMethod {
8
8
  init() {
9
9
  this.requiredPermissions = ['read', 'write'];
@@ -12,9 +12,10 @@ class RippleSignTransaction extends AbstractMethod_1.AbstractMethod {
12
12
  (0, paramsValidator_1.validateParams)(payload, [
13
13
  { name: 'path', required: true },
14
14
  { name: 'transaction', required: true },
15
+ { name: 'chunkify', type: 'boolean' },
15
16
  ]);
16
17
  const path = (0, pathUtils_1.validatePath)(payload.path, 5);
17
- const { transaction } = payload;
18
+ const { transaction, chunkify } = payload;
18
19
  (0, paramsValidator_1.validateParams)(transaction, [
19
20
  { name: 'fee', type: 'uint' },
20
21
  { name: 'flags', type: 'number' },
@@ -38,6 +39,7 @@ class RippleSignTransaction extends AbstractMethod_1.AbstractMethod {
38
39
  destination: transaction.payment.destination,
39
40
  destination_tag: transaction.payment.destinationTag,
40
41
  },
42
+ chunkify: typeof chunkify === 'boolean' ? chunkify : false,
41
43
  };
42
44
  }
43
45
  get info() {
@@ -35,6 +35,7 @@ class SignTransaction extends AbstractMethod_1.AbstractMethod {
35
35
  { name: 'amountUnit', type: ['number', 'string'] },
36
36
  { name: 'unlockPath', type: 'object' },
37
37
  { name: 'serialize', type: 'boolean' },
38
+ { name: 'chunkify', type: 'boolean' },
38
39
  ]);
39
40
  if (payload.unlockPath) {
40
41
  (0, paramsValidator_1.validateParams)(payload.unlockPath, [
@@ -86,6 +87,7 @@ class SignTransaction extends AbstractMethod_1.AbstractMethod {
86
87
  amount_unit: payload.amountUnit,
87
88
  serialize: payload.serialize,
88
89
  coinjoin_request: payload.coinjoinRequest,
90
+ chunkify: typeof payload.chunkify === 'boolean' ? payload.chunkify : false,
89
91
  },
90
92
  coinInfo,
91
93
  push: typeof payload.push === 'boolean' ? payload.push : false,
@@ -0,0 +1,10 @@
1
+ import { SolanaTxAdditionalInfo } from '../../types/api/solana';
2
+ export declare const transformAdditionalInfo: (additionalInfo?: SolanaTxAdditionalInfo) => {
3
+ token_accounts_infos: {
4
+ base_address: string;
5
+ token_program: string;
6
+ token_mint: string;
7
+ token_account: string;
8
+ }[];
9
+ } | undefined;
10
+ //# sourceMappingURL=additionalInfo.d.ts.map
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transformAdditionalInfo = void 0;
4
+ const paramsValidator_1 = require("../common/paramsValidator");
5
+ const validateAdditionalInfo = (additionalInfo) => {
6
+ var _a;
7
+ (0, paramsValidator_1.validateParams)(additionalInfo, [{ name: 'tokenAccountsInfos', type: 'array' }]);
8
+ (_a = additionalInfo.tokenAccountsInfos) === null || _a === void 0 ? void 0 : _a.forEach(tokenAccountInfo => {
9
+ (0, paramsValidator_1.validateParams)(tokenAccountInfo, [
10
+ { name: 'baseAddress', type: 'string', required: true },
11
+ { name: 'tokenProgram', type: 'string', required: true },
12
+ { name: 'tokenMint', type: 'string', required: true },
13
+ { name: 'tokenAccount', type: 'string', required: true },
14
+ ]);
15
+ });
16
+ };
17
+ const transformAdditionalInfo = (additionalInfo) => {
18
+ var _a;
19
+ if (!additionalInfo) {
20
+ return undefined;
21
+ }
22
+ validateAdditionalInfo(additionalInfo);
23
+ return {
24
+ token_accounts_infos: ((_a = additionalInfo.tokenAccountsInfos) === null || _a === void 0 ? void 0 : _a.map(tokenAccountInfo => ({
25
+ base_address: tokenAccountInfo.baseAddress,
26
+ token_program: tokenAccountInfo.tokenProgram,
27
+ token_mint: tokenAccountInfo.tokenMint,
28
+ token_account: tokenAccountInfo.tokenAccount,
29
+ }))) || [],
30
+ };
31
+ };
32
+ exports.transformAdditionalInfo = transformAdditionalInfo;
33
+ //# sourceMappingURL=additionalInfo.js.map
@@ -0,0 +1,4 @@
1
+ export { default as solanaGetAddress } from './solanaGetAddress';
2
+ export { default as solanaGetPublicKey } from './solanaGetPublicKey';
3
+ export { default as solanaSignTransaction } from './solanaSignTransaction';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.solanaSignTransaction = exports.solanaGetPublicKey = exports.solanaGetAddress = void 0;
7
+ var solanaGetAddress_1 = require("./solanaGetAddress");
8
+ Object.defineProperty(exports, "solanaGetAddress", { enumerable: true, get: function () { return __importDefault(solanaGetAddress_1).default; } });
9
+ var solanaGetPublicKey_1 = require("./solanaGetPublicKey");
10
+ Object.defineProperty(exports, "solanaGetPublicKey", { enumerable: true, get: function () { return __importDefault(solanaGetPublicKey_1).default; } });
11
+ var solanaSignTransaction_1 = require("./solanaSignTransaction");
12
+ Object.defineProperty(exports, "solanaSignTransaction", { enumerable: true, get: function () { return __importDefault(solanaSignTransaction_1).default; } });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,23 @@
1
+ import { PROTO } from '../../../constants';
2
+ import { AbstractMethod } from '../../../core/AbstractMethod';
3
+ type Params = PROTO.SolanaGetAddress & {
4
+ address?: string;
5
+ };
6
+ export default class SolanaGetAddress extends AbstractMethod<'solanaGetAddress', Params[]> {
7
+ hasBundle?: boolean;
8
+ progress: number;
9
+ confirmed?: boolean;
10
+ init(): void;
11
+ get info(): "Export solana address" | "Export multiple Solana addresses";
12
+ getButtonRequestData(code: string): {
13
+ type: "address";
14
+ serializedPath: string;
15
+ address: string;
16
+ } | undefined;
17
+ confirmation(): Promise<boolean>;
18
+ noBackupConfirmation(): Promise<boolean>;
19
+ _call({ address_n, show_display, chunkify }: Params): Promise<PROTO.SolanaAddress>;
20
+ run(): Promise<import("../../..").Address | import("../../..").Address[]>;
21
+ }
22
+ export {};
23
+ //# sourceMappingURL=solanaGetAddress.d.ts.map
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const constants_1 = require("../../../constants");
4
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
5
+ const paramsValidator_1 = require("../../common/paramsValidator");
6
+ const coinInfo_1 = require("../../../data/coinInfo");
7
+ const pathUtils_1 = require("../../../utils/pathUtils");
8
+ const events_1 = require("../../../events");
9
+ class SolanaGetAddress extends AbstractMethod_1.AbstractMethod {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.progress = 0;
13
+ }
14
+ init() {
15
+ this.requiredPermissions = ['read'];
16
+ this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Solana'), this.firmwareRange);
17
+ this.hasBundle = !!this.payload.bundle;
18
+ const payload = !this.payload.bundle
19
+ ? { ...this.payload, bundle: [this.payload] }
20
+ : this.payload;
21
+ (0, paramsValidator_1.validateParams)(payload, [{ name: 'bundle', type: 'array' }]);
22
+ this.params = payload.bundle.map(batch => {
23
+ (0, paramsValidator_1.validateParams)(batch, [
24
+ { name: 'path', required: true },
25
+ { name: 'address', type: 'string' },
26
+ { name: 'showOnTrezor', type: 'boolean' },
27
+ { name: 'chunkify', type: 'boolean' },
28
+ ]);
29
+ const path = (0, pathUtils_1.validatePath)(batch.path, 2);
30
+ return {
31
+ address_n: path,
32
+ address: batch.address,
33
+ show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
34
+ chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
35
+ };
36
+ });
37
+ const useEventListener = payload.useEventListener &&
38
+ this.params.length === 1 &&
39
+ typeof this.params[0].address === 'string' &&
40
+ this.params[0].show_display;
41
+ this.confirmed = useEventListener;
42
+ this.useUi = !useEventListener;
43
+ }
44
+ get info() {
45
+ if (this.params.length === 1) {
46
+ return 'Export solana address';
47
+ }
48
+ return 'Export multiple Solana addresses';
49
+ }
50
+ getButtonRequestData(code) {
51
+ if (code === 'ButtonRequest_Address') {
52
+ return {
53
+ type: 'address',
54
+ serializedPath: (0, pathUtils_1.getSerializedPath)(this.params[this.progress].address_n),
55
+ address: this.params[this.progress].address || 'not-set',
56
+ };
57
+ }
58
+ }
59
+ async confirmation() {
60
+ if (this.confirmed)
61
+ return true;
62
+ await this.getPopupPromise().promise;
63
+ const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
64
+ let label;
65
+ if (this.params.length > 1) {
66
+ label = 'Export multiple Solana addresses';
67
+ }
68
+ else {
69
+ label = `Export Solana address for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`;
70
+ }
71
+ this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
72
+ view: 'export-address',
73
+ label,
74
+ }));
75
+ const uiResp = await uiPromise.promise;
76
+ this.confirmed = uiResp.payload;
77
+ return this.confirmed;
78
+ }
79
+ async noBackupConfirmation() {
80
+ await this.getPopupPromise().promise;
81
+ const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
82
+ this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
83
+ view: 'no-backup',
84
+ }));
85
+ const uiResp = await uiPromise.promise;
86
+ return uiResp.payload;
87
+ }
88
+ async _call({ address_n, show_display, chunkify }) {
89
+ const cmd = this.device.getCommands();
90
+ const response = await cmd.typedCall('SolanaGetAddress', 'SolanaAddress', {
91
+ address_n,
92
+ show_display,
93
+ chunkify,
94
+ });
95
+ return response.message;
96
+ }
97
+ async run() {
98
+ const responses = [];
99
+ for (let i = 0; i < this.params.length; i++) {
100
+ const batch = this.params[i];
101
+ if (batch.show_display) {
102
+ const silent = await this._call({
103
+ ...batch,
104
+ show_display: false,
105
+ });
106
+ if (typeof batch.address === 'string') {
107
+ if (batch.address !== silent.address) {
108
+ throw constants_1.ERRORS.TypedError('Method_AddressNotMatch');
109
+ }
110
+ }
111
+ else {
112
+ batch.address = silent.address;
113
+ }
114
+ }
115
+ const message = await this._call(batch);
116
+ responses.push({
117
+ path: batch.address_n,
118
+ serializedPath: (0, pathUtils_1.getSerializedPath)(batch.address_n),
119
+ address: message.address,
120
+ });
121
+ if (this.hasBundle) {
122
+ this.postMessage((0, events_1.createUiMessage)(events_1.UI.BUNDLE_PROGRESS, {
123
+ progress: i,
124
+ response: message,
125
+ }));
126
+ }
127
+ this.progress++;
128
+ }
129
+ return this.hasBundle ? responses : responses[0];
130
+ }
131
+ }
132
+ exports.default = SolanaGetAddress;
133
+ //# sourceMappingURL=solanaGetAddress.js.map
@@ -0,0 +1,12 @@
1
+ import { PROTO } from '../../../constants';
2
+ import { AbstractMethod } from '../../../core/AbstractMethod';
3
+ export default class SolanaGetPublicKey extends AbstractMethod<'solanaGetPublicKey', PROTO.SolanaGetPublicKey[]> {
4
+ hasBundle?: boolean;
5
+ confirmed?: boolean;
6
+ init(): void;
7
+ get info(): string;
8
+ confirmation(): Promise<boolean>;
9
+ noBackupConfirmation(): Promise<boolean>;
10
+ run(): Promise<import("../../..").SolanaPublicKey | import("../../..").SolanaPublicKey[]>;
11
+ }
12
+ //# sourceMappingURL=solanaGetPublicKey.d.ts.map
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
+ const paramsValidator_1 = require("../../common/paramsValidator");
5
+ const coinInfo_1 = require("../../../data/coinInfo");
6
+ const pathUtils_1 = require("../../../utils/pathUtils");
7
+ const events_1 = require("../../../events");
8
+ class SolanaGetPublicKey extends AbstractMethod_1.AbstractMethod {
9
+ init() {
10
+ this.requiredPermissions = ['read'];
11
+ this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Solana'), this.firmwareRange);
12
+ this.hasBundle = !!this.payload.bundle;
13
+ const payload = !this.payload.bundle
14
+ ? { ...this.payload, bundle: [this.payload] }
15
+ : this.payload;
16
+ (0, paramsValidator_1.validateParams)(payload, [{ name: 'bundle', type: 'array' }]);
17
+ this.params = payload.bundle.map(batch => {
18
+ (0, paramsValidator_1.validateParams)(batch, [
19
+ { name: 'path', required: true },
20
+ { name: 'showOnTrezor', type: 'boolean' },
21
+ ]);
22
+ const path = (0, pathUtils_1.validatePath)(batch.path, 2);
23
+ return {
24
+ address_n: path,
25
+ show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : false,
26
+ };
27
+ });
28
+ }
29
+ get info() {
30
+ return 'Export Solana public key';
31
+ }
32
+ async confirmation() {
33
+ if (this.confirmed)
34
+ return true;
35
+ await this.getPopupPromise().promise;
36
+ const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
37
+ let label;
38
+ if (this.params.length > 1) {
39
+ label = 'Export multiple Solana public keys';
40
+ }
41
+ else {
42
+ label = `Export Solana public key for account #${(0, pathUtils_1.fromHardened)(this.params[0].address_n[2]) + 1}`;
43
+ }
44
+ this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
45
+ view: 'export-xpub',
46
+ label,
47
+ }));
48
+ const uiResp = await uiPromise.promise;
49
+ this.confirmed = uiResp.payload;
50
+ return this.confirmed;
51
+ }
52
+ async noBackupConfirmation() {
53
+ await this.getPopupPromise().promise;
54
+ const uiPromise = this.createUiPromise(events_1.UI.RECEIVE_CONFIRMATION);
55
+ this.postMessage((0, events_1.createUiMessage)(events_1.UI.REQUEST_CONFIRMATION, {
56
+ view: 'no-backup',
57
+ }));
58
+ const uiResp = await uiPromise.promise;
59
+ return uiResp.payload;
60
+ }
61
+ async run() {
62
+ const responses = [];
63
+ const cmd = this.device.getCommands();
64
+ for (let i = 0; i < this.params.length; i++) {
65
+ const batch = this.params[i];
66
+ const { message } = await cmd.typedCall('SolanaGetPublicKey', 'SolanaPublicKey', batch);
67
+ responses.push({
68
+ path: batch.address_n,
69
+ serializedPath: (0, pathUtils_1.getSerializedPath)(batch.address_n),
70
+ publicKey: message.public_key,
71
+ });
72
+ if (this.hasBundle) {
73
+ this.postMessage((0, events_1.createUiMessage)(events_1.UI.BUNDLE_PROGRESS, {
74
+ progress: i,
75
+ response: message,
76
+ }));
77
+ }
78
+ }
79
+ return this.hasBundle ? responses : responses[0];
80
+ }
81
+ }
82
+ exports.default = SolanaGetPublicKey;
83
+ //# sourceMappingURL=solanaGetPublicKey.js.map
@@ -0,0 +1,10 @@
1
+ import { PROTO } from '../../../constants';
2
+ import { AbstractMethod } from '../../../core/AbstractMethod';
3
+ export default class SolanaSignTransaction extends AbstractMethod<'solanaSignTransaction', PROTO.SolanaSignTx> {
4
+ init(): void;
5
+ get info(): string;
6
+ run(): Promise<{
7
+ signature: string;
8
+ }>;
9
+ }
10
+ //# sourceMappingURL=solanaSignTransaction.d.ts.map
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
+ const paramsValidator_1 = require("../../common/paramsValidator");
5
+ const coinInfo_1 = require("../../../data/coinInfo");
6
+ const pathUtils_1 = require("../../../utils/pathUtils");
7
+ const additionalInfo_1 = require("../additionalInfo");
8
+ class SolanaSignTransaction extends AbstractMethod_1.AbstractMethod {
9
+ init() {
10
+ this.requiredPermissions = ['read', 'write'];
11
+ this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Solana'), this.firmwareRange);
12
+ const { payload } = this;
13
+ (0, paramsValidator_1.validateParams)(payload, [
14
+ { name: 'path', required: true },
15
+ { name: 'serializedTx', type: 'string', required: true },
16
+ ]);
17
+ const path = (0, pathUtils_1.validatePath)(payload.path, 2);
18
+ this.params = {
19
+ address_n: path,
20
+ serialized_tx: payload.serializedTx,
21
+ additional_info: (0, additionalInfo_1.transformAdditionalInfo)(payload.additionalInfo),
22
+ };
23
+ }
24
+ get info() {
25
+ return 'Sign Solana transaction';
26
+ }
27
+ async run() {
28
+ const cmd = this.device.getCommands();
29
+ const { message } = await cmd.typedCall('SolanaSignTx', 'SolanaTxSignature', this.params);
30
+ return { signature: message.signature };
31
+ }
32
+ }
33
+ exports.default = SolanaSignTransaction;
34
+ //# sourceMappingURL=solanaSignTransaction.js.map
@@ -0,0 +1,3 @@
1
+ export { default as stellarGetAddress } from './stellarGetAddress';
2
+ export { default as stellarSignTransaction } from './stellarSignTransaction';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.stellarSignTransaction = exports.stellarGetAddress = void 0;
7
+ var stellarGetAddress_1 = require("./stellarGetAddress");
8
+ Object.defineProperty(exports, "stellarGetAddress", { enumerable: true, get: function () { return __importDefault(stellarGetAddress_1).default; } });
9
+ var stellarSignTransaction_1 = require("./stellarSignTransaction");
10
+ Object.defineProperty(exports, "stellarSignTransaction", { enumerable: true, get: function () { return __importDefault(stellarSignTransaction_1).default; } });
11
+ //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import { PROTO } from '../constants';
1
+ import { AbstractMethod } from '../../../core/AbstractMethod';
2
+ import { PROTO } from '../../../constants';
3
3
  type Params = PROTO.StellarGetAddress & {
4
4
  address?: string;
5
5
  };
@@ -16,8 +16,8 @@ export default class StellarGetAddress extends AbstractMethod<'stellarGetAddress
16
16
  } | undefined;
17
17
  confirmation(): Promise<boolean>;
18
18
  noBackupConfirmation(): Promise<boolean>;
19
- _call({ address_n, show_display }: Params): Promise<PROTO.StellarAddress>;
20
- run(): Promise<import("..").Address | import("..").Address[]>;
19
+ _call({ address_n, show_display, chunkify }: Params): Promise<PROTO.StellarAddress>;
20
+ run(): Promise<import("../../..").Address | import("../../..").Address[]>;
21
21
  }
22
22
  export {};
23
23
  //# sourceMappingURL=stellarGetAddress.d.ts.map
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const paramsValidator_1 = require("./common/paramsValidator");
5
- const coinInfo_1 = require("../data/coinInfo");
6
- const pathUtils_1 = require("../utils/pathUtils");
7
- const constants_1 = require("../constants");
8
- const events_1 = require("../events");
3
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
+ const paramsValidator_1 = require("../../common/paramsValidator");
5
+ const coinInfo_1 = require("../../../data/coinInfo");
6
+ const pathUtils_1 = require("../../../utils/pathUtils");
7
+ const constants_1 = require("../../../constants");
8
+ const events_1 = require("../../../events");
9
9
  class StellarGetAddress extends AbstractMethod_1.AbstractMethod {
10
10
  constructor() {
11
11
  super(...arguments);
@@ -27,12 +27,14 @@ class StellarGetAddress extends AbstractMethod_1.AbstractMethod {
27
27
  { name: 'path', required: true },
28
28
  { name: 'address', type: 'string' },
29
29
  { name: 'showOnTrezor', type: 'boolean' },
30
+ { name: 'chunkify', type: 'boolean' },
30
31
  ]);
31
32
  const path = (0, pathUtils_1.validatePath)(batch.path, 3);
32
33
  return {
33
34
  address_n: path,
34
35
  address: batch.address,
35
36
  show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
37
+ chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
36
38
  };
37
39
  });
38
40
  const useEventListener = payload.useEventListener &&
@@ -79,11 +81,12 @@ class StellarGetAddress extends AbstractMethod_1.AbstractMethod {
79
81
  const uiResp = await uiPromise.promise;
80
82
  return uiResp.payload;
81
83
  }
82
- async _call({ address_n, show_display }) {
84
+ async _call({ address_n, show_display, chunkify }) {
83
85
  const cmd = this.device.getCommands();
84
86
  const response = await cmd.typedCall('StellarGetAddress', 'StellarAddress', {
85
87
  address_n,
86
88
  show_display,
89
+ chunkify,
87
90
  });
88
91
  return response.message;
89
92
  }
@@ -1,5 +1,5 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import { StellarTransaction } from '../types/api/stellar';
1
+ import { AbstractMethod } from '../../../core/AbstractMethod';
2
+ import { StellarTransaction } from '../../../types/api/stellar';
3
3
  type Params = {
4
4
  path: number[];
5
5
  networkPassphrase: string;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const AbstractMethod_1 = require("../core/AbstractMethod");
5
- const paramsValidator_1 = require("./common/paramsValidator");
6
- const coinInfo_1 = require("../data/coinInfo");
7
- const pathUtils_1 = require("../utils/pathUtils");
8
- const helper = tslib_1.__importStar(require("./stellar/stellarSignTx"));
9
- const constants_1 = require("../constants");
4
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
5
+ const paramsValidator_1 = require("../../common/paramsValidator");
6
+ const coinInfo_1 = require("../../../data/coinInfo");
7
+ const pathUtils_1 = require("../../../utils/pathUtils");
8
+ const helper = tslib_1.__importStar(require("../stellarSignTx"));
9
+ const constants_1 = require("../../../constants");
10
10
  const StellarSignTransactionFeatures = Object.freeze({
11
11
  manageBuyOffer: ['1.10.4', '2.4.3'],
12
12
  pathPaymentStrictSend: ['1.10.4', '2.4.3'],
@@ -0,0 +1,4 @@
1
+ export { default as tezosGetAddress } from './tezosGetAddress';
2
+ export { default as tezosGetPublicKey } from './tezosGetPublicKey';
3
+ export { default as tezosSignTransaction } from './tezosSignTransaction';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.tezosSignTransaction = exports.tezosGetPublicKey = exports.tezosGetAddress = void 0;
7
+ var tezosGetAddress_1 = require("./tezosGetAddress");
8
+ Object.defineProperty(exports, "tezosGetAddress", { enumerable: true, get: function () { return __importDefault(tezosGetAddress_1).default; } });
9
+ var tezosGetPublicKey_1 = require("./tezosGetPublicKey");
10
+ Object.defineProperty(exports, "tezosGetPublicKey", { enumerable: true, get: function () { return __importDefault(tezosGetPublicKey_1).default; } });
11
+ var tezosSignTransaction_1 = require("./tezosSignTransaction");
12
+ Object.defineProperty(exports, "tezosSignTransaction", { enumerable: true, get: function () { return __importDefault(tezosSignTransaction_1).default; } });
13
+ //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import { PROTO } from '../constants';
1
+ import { AbstractMethod } from '../../../core/AbstractMethod';
2
+ import { PROTO } from '../../../constants';
3
3
  type Params = PROTO.TezosGetAddress & {
4
4
  address?: string;
5
5
  };
@@ -16,8 +16,8 @@ export default class TezosGetAddress extends AbstractMethod<'tezosGetAddress', P
16
16
  } | undefined;
17
17
  confirmation(): Promise<boolean>;
18
18
  noBackupConfirmation(): Promise<boolean>;
19
- _call({ address_n, show_display }: Params): Promise<PROTO.TezosAddress>;
20
- run(): Promise<import("..").Address | import("..").Address[]>;
19
+ _call({ address_n, show_display, chunkify }: Params): Promise<PROTO.TezosAddress>;
20
+ run(): Promise<import("../../..").Address | import("../../..").Address[]>;
21
21
  }
22
22
  export {};
23
23
  //# sourceMappingURL=tezosGetAddress.d.ts.map
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const paramsValidator_1 = require("./common/paramsValidator");
5
- const coinInfo_1 = require("../data/coinInfo");
6
- const pathUtils_1 = require("../utils/pathUtils");
7
- const constants_1 = require("../constants");
8
- const events_1 = require("../events");
3
+ const AbstractMethod_1 = require("../../../core/AbstractMethod");
4
+ const paramsValidator_1 = require("../../common/paramsValidator");
5
+ const coinInfo_1 = require("../../../data/coinInfo");
6
+ const pathUtils_1 = require("../../../utils/pathUtils");
7
+ const constants_1 = require("../../../constants");
8
+ const events_1 = require("../../../events");
9
9
  class TezosGetAddress extends AbstractMethod_1.AbstractMethod {
10
10
  constructor() {
11
11
  super(...arguments);
@@ -27,12 +27,14 @@ class TezosGetAddress extends AbstractMethod_1.AbstractMethod {
27
27
  { name: 'path', required: true },
28
28
  { name: 'address', type: 'string' },
29
29
  { name: 'showOnTrezor', type: 'boolean' },
30
+ { name: 'chunkify', type: 'boolean' },
30
31
  ]);
31
32
  const path = (0, pathUtils_1.validatePath)(batch.path, 3);
32
33
  return {
33
34
  address_n: path,
34
35
  address: batch.address,
35
36
  show_display: typeof batch.showOnTrezor === 'boolean' ? batch.showOnTrezor : true,
37
+ chunkify: typeof batch.chunkify === 'boolean' ? batch.chunkify : false,
36
38
  };
37
39
  });
38
40
  const useEventListener = payload.useEventListener &&
@@ -79,11 +81,12 @@ class TezosGetAddress extends AbstractMethod_1.AbstractMethod {
79
81
  const uiResp = await uiPromise.promise;
80
82
  return uiResp.payload;
81
83
  }
82
- async _call({ address_n, show_display }) {
84
+ async _call({ address_n, show_display, chunkify }) {
83
85
  const cmd = this.device.getCommands();
84
86
  const response = await cmd.typedCall('TezosGetAddress', 'TezosAddress', {
85
87
  address_n,
86
88
  show_display,
89
+ chunkify,
87
90
  });
88
91
  return response.message;
89
92
  }
@@ -1,11 +1,11 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import type { PROTO } from '../constants';
1
+ import { AbstractMethod } from '../../../core/AbstractMethod';
2
+ import type { PROTO } from '../../../constants';
3
3
  export default class TezosGetPublicKey extends AbstractMethod<'tezosGetPublicKey', PROTO.TezosGetPublicKey[]> {
4
4
  hasBundle?: boolean;
5
5
  confirmed?: boolean;
6
6
  init(): void;
7
7
  get info(): string;
8
8
  confirmation(): Promise<boolean>;
9
- run(): Promise<import("..").PublicKey | import("..").PublicKey[]>;
9
+ run(): Promise<import("../../..").PublicKey | import("../../..").PublicKey[]>;
10
10
  }
11
11
  //# sourceMappingURL=tezosGetPublicKey.d.ts.map