@trezor/connect 9.1.9 → 9.1.11

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 (229) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +1 -1
  3. package/lib/api/applyFlags.d.ts +4 -2
  4. package/lib/api/applyFlags.js +3 -2
  5. package/lib/api/applySettings.d.ts +4 -2
  6. package/lib/api/applySettings.js +3 -13
  7. package/lib/api/authenticateDevice.js +3 -11
  8. package/lib/api/authorizeCoinjoin.d.ts +3 -1
  9. package/lib/api/authorizeCoinjoin.js +3 -11
  10. package/lib/api/backupDevice.d.ts +3 -1
  11. package/lib/api/binance/api/binanceGetAddress.d.ts +4 -2
  12. package/lib/api/binance/api/binanceGetAddress.js +4 -10
  13. package/lib/api/binance/api/binanceGetPublicKey.d.ts +9 -1
  14. package/lib/api/binance/api/binanceGetPublicKey.js +3 -5
  15. package/lib/api/binance/api/binanceSignTransaction.d.ts +4 -1
  16. package/lib/api/binance/api/binanceSignTransaction.js +5 -6
  17. package/lib/api/binance/binanceSignTx.d.ts +84 -3
  18. package/lib/api/binance/binanceSignTx.js +3 -26
  19. package/lib/api/bitcoin/Fees.d.ts +14 -2
  20. package/lib/api/bitcoin/TransactionComposer.d.ts +13 -2
  21. package/lib/api/bitcoin/refTx.d.ts +2 -2
  22. package/lib/api/bitcoin/refTx.js +22 -24
  23. package/lib/api/bitcoin/signtxVerify.d.ts +1 -1
  24. package/lib/api/blockchainDisconnect.d.ts +1 -1
  25. package/lib/api/blockchainDisconnect.js +3 -2
  26. package/lib/api/blockchainGetAccountBalanceHistory.d.ts +1 -1
  27. package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -1
  28. package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -1
  29. package/lib/api/blockchainGetTransactions.d.ts +1 -1
  30. package/lib/api/cancelCoinjoinAuthorization.d.ts +3 -1
  31. package/lib/api/cancelCoinjoinAuthorization.js +3 -0
  32. package/lib/api/cardano/api/cardanoGetAddress.d.ts +4 -2
  33. package/lib/api/cardano/api/cardanoGetAddress.js +4 -13
  34. package/lib/api/cardano/api/cardanoGetNativeScriptHash.d.ts +1 -1
  35. package/lib/api/cardano/api/cardanoGetNativeScriptHash.js +3 -13
  36. package/lib/api/cardano/api/cardanoGetPublicKey.d.ts +1 -1
  37. package/lib/api/cardano/api/cardanoGetPublicKey.js +4 -7
  38. package/lib/api/cardano/api/cardanoSignTransaction.d.ts +26 -4
  39. package/lib/api/cardano/api/cardanoSignTransaction.js +15 -46
  40. package/lib/api/cardano/cardanoAddressParameters.d.ts +1 -1
  41. package/lib/api/cardano/cardanoAddressParameters.js +3 -14
  42. package/lib/api/cardano/cardanoAuxiliaryData.d.ts +1 -1
  43. package/lib/api/cardano/cardanoAuxiliaryData.js +5 -20
  44. package/lib/api/cardano/cardanoCertificate.d.ts +1 -1
  45. package/lib/api/cardano/cardanoCertificate.js +20 -59
  46. package/lib/api/cardano/cardanoInputs.d.ts +20 -8
  47. package/lib/api/cardano/cardanoInputs.js +18 -14
  48. package/lib/api/cardano/cardanoOutputs.d.ts +31 -2
  49. package/lib/api/cardano/cardanoOutputs.js +14 -11
  50. package/lib/api/cardano/cardanoTokenBundle.d.ts +11 -6
  51. package/lib/api/cardano/cardanoTokenBundle.js +9 -21
  52. package/lib/api/changePin.d.ts +4 -2
  53. package/lib/api/changePin.js +3 -2
  54. package/lib/api/changeWipeCode.d.ts +3 -1
  55. package/lib/api/cipherKeyValue.d.ts +5 -1
  56. package/lib/api/cipherKeyValue.js +13 -21
  57. package/lib/api/common/paramsValidator.js +5 -4
  58. package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -1
  59. package/lib/api/eos/api/eosGetPublicKey.js +3 -6
  60. package/lib/api/eos/api/eosSignTransaction.js +3 -5
  61. package/lib/api/eos/eosSignTx.d.ts +160 -2
  62. package/lib/api/ethereum/api/ethereumGetAddress.js +4 -10
  63. package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +21 -1
  64. package/lib/api/ethereum/api/ethereumGetPublicKey.js +3 -5
  65. package/lib/api/ethereum/api/ethereumSignMessage.d.ts +6 -3
  66. package/lib/api/ethereum/api/ethereumSignMessage.js +3 -5
  67. package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +2 -2
  68. package/lib/api/ethereum/api/ethereumSignTransaction.js +3 -25
  69. package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +83 -3
  70. package/lib/api/ethereum/api/ethereumSignTypedData.js +20 -12
  71. package/lib/api/ethereum/api/ethereumVerifyMessage.d.ts +3 -1
  72. package/lib/api/ethereum/api/ethereumVerifyMessage.js +3 -6
  73. package/lib/api/ethereum/ethereumDefinitions.d.ts +37 -19
  74. package/lib/api/ethereum/ethereumDefinitions.js +21 -15
  75. package/lib/api/ethereum/ethereumSignTx.d.ts +1 -1
  76. package/lib/api/firmware/getBinary.js +5 -4
  77. package/lib/api/firmware/modifyFirmware.js +3 -2
  78. package/lib/api/firmware/uploadFirmware.d.ts +3 -1
  79. package/lib/api/firmware/verifyAuthenticityProof.js +3 -3
  80. package/lib/api/firmwareUpdate.js +10 -15
  81. package/lib/api/getAccountDescriptor.d.ts +2 -2
  82. package/lib/api/getAccountDescriptor.js +4 -7
  83. package/lib/api/getAccountInfo.d.ts +8 -8
  84. package/lib/api/getAddress.d.ts +8 -2
  85. package/lib/api/getAddress.js +10 -20
  86. package/lib/api/getCoinInfo.d.ts +117 -2
  87. package/lib/api/getCoinInfo.js +3 -2
  88. package/lib/api/getFeatures.d.ts +49 -1
  89. package/lib/api/getFirmwareHash.d.ts +3 -1
  90. package/lib/api/getFirmwareHash.js +3 -1
  91. package/lib/api/getOwnershipId.js +4 -7
  92. package/lib/api/getOwnershipProof.js +4 -11
  93. package/lib/api/getPublicKey.d.ts +21 -1
  94. package/lib/api/getPublicKey.js +4 -18
  95. package/lib/api/nem/api/nemGetAddress.d.ts +4 -2
  96. package/lib/api/nem/api/nemGetAddress.js +4 -11
  97. package/lib/api/nem/api/nemSignTransaction.d.ts +4 -1
  98. package/lib/api/nem/api/nemSignTransaction.js +7 -5
  99. package/lib/api/nem/nemSignTx.d.ts +75 -1
  100. package/lib/api/pushTransaction.js +3 -5
  101. package/lib/api/rebootToBootloader.d.ts +3 -1
  102. package/lib/api/recoveryDevice.d.ts +3 -1
  103. package/lib/api/recoveryDevice.js +3 -12
  104. package/lib/api/requestLogin.js +7 -9
  105. package/lib/api/resetDevice.d.ts +3 -1
  106. package/lib/api/resetDevice.js +3 -12
  107. package/lib/api/ripple/api/rippleGetAddress.d.ts +4 -2
  108. package/lib/api/ripple/api/rippleGetAddress.js +4 -10
  109. package/lib/api/ripple/api/rippleSignTransaction.js +3 -17
  110. package/lib/api/setBusy.d.ts +3 -1
  111. package/lib/api/setBusy.js +3 -1
  112. package/lib/api/showDeviceTutorial.d.ts +3 -1
  113. package/lib/api/signMessage.d.ts +4 -1
  114. package/lib/api/signMessage.js +3 -7
  115. package/lib/api/solana/additionalInfo.js +3 -14
  116. package/lib/api/solana/api/solanaGetAddress.d.ts +4 -2
  117. package/lib/api/solana/api/solanaGetAddress.js +4 -7
  118. package/lib/api/solana/api/solanaGetPublicKey.d.ts +13 -1
  119. package/lib/api/solana/api/solanaGetPublicKey.js +3 -5
  120. package/lib/api/solana/api/solanaSignTransaction.js +3 -4
  121. package/lib/api/stellar/api/stellarGetAddress.d.ts +4 -2
  122. package/lib/api/stellar/api/stellarGetAddress.js +4 -10
  123. package/lib/api/stellar/api/stellarSignTransaction.js +3 -5
  124. package/lib/api/stellar/stellarSignTx.d.ts +5 -3
  125. package/lib/api/stellar/stellarSignTx.js +3 -15
  126. package/lib/api/tezos/api/tezosGetAddress.d.ts +4 -2
  127. package/lib/api/tezos/api/tezosGetAddress.js +4 -10
  128. package/lib/api/tezos/api/tezosGetPublicKey.d.ts +9 -1
  129. package/lib/api/tezos/api/tezosGetPublicKey.js +3 -6
  130. package/lib/api/tezos/api/tezosSignTransaction.d.ts +5 -1
  131. package/lib/api/tezos/api/tezosSignTransaction.js +3 -5
  132. package/lib/api/tezos/tezosSignTx.d.ts +70 -2
  133. package/lib/api/tezos/tezosSignTx.js +3 -44
  134. package/lib/api/unlockPath.js +3 -4
  135. package/lib/api/verifyMessage.d.ts +3 -1
  136. package/lib/api/verifyMessage.js +3 -7
  137. package/lib/api/wipeDevice.d.ts +3 -1
  138. package/lib/constants/index.d.ts +1 -1
  139. package/lib/constants/index.js +1 -1
  140. package/lib/constants/nem.d.ts +7 -0
  141. package/lib/constants/nem.js +5 -1
  142. package/lib/core/AbstractMethod.d.ts +1 -1
  143. package/lib/core/AbstractMethod.js +4 -3
  144. package/lib/core/index.js +4 -4
  145. package/lib/data/coinInfo.d.ts +588 -12
  146. package/lib/data/coinInfo.js +6 -6
  147. package/lib/data/config.js +5 -0
  148. package/lib/data/deviceAuthenticityConfig.d.ts +19 -13
  149. package/lib/data/deviceAuthenticityConfig.js +23 -1
  150. package/lib/data/firmwareInfo.js +11 -10
  151. package/lib/data/version.d.ts +1 -1
  152. package/lib/data/version.js +1 -1
  153. package/lib/device/Device.d.ts +2 -6
  154. package/lib/device/Device.js +8 -27
  155. package/lib/device/DeviceCommands.d.ts +36 -4
  156. package/lib/device/DeviceCommands.js +5 -2
  157. package/lib/device/DeviceList.js +1 -1
  158. package/lib/events/ui-promise.d.ts +1 -1
  159. package/lib/index.d.ts +1 -1
  160. package/lib/index.js +2 -2
  161. package/lib/types/api/applySettings.d.ts +18 -2
  162. package/lib/types/api/applySettings.js +9 -0
  163. package/lib/types/api/authenticateDevice.d.ts +22 -5
  164. package/lib/types/api/authenticateDevice.js +7 -0
  165. package/lib/types/api/authorizeCoinjoin.d.ts +15 -13
  166. package/lib/types/api/authorizeCoinjoin.js +15 -0
  167. package/lib/types/api/binance/index.d.ts +203 -30
  168. package/lib/types/api/binance/index.js +48 -0
  169. package/lib/types/api/bitcoin/index.d.ts +18 -15
  170. package/lib/types/api/bitcoin/index.js +17 -0
  171. package/lib/types/api/cancelCoinjoinAuthorization.d.ts +5 -4
  172. package/lib/types/api/cancelCoinjoinAuthorization.js +5 -0
  173. package/lib/types/api/cardano/index.d.ts +685 -187
  174. package/lib/types/api/cardano/index.js +208 -0
  175. package/lib/types/api/cardanoSignTransaction.d.ts +5 -8
  176. package/lib/types/api/cipherKeyValue.d.ts +12 -11
  177. package/lib/types/api/cipherKeyValue.js +12 -0
  178. package/lib/types/api/eos/index.d.ts +783 -116
  179. package/lib/types/api/eos/index.js +177 -0
  180. package/lib/types/api/ethereum/index.d.ts +163 -57
  181. package/lib/types/api/ethereum/index.js +90 -0
  182. package/lib/types/api/firmwareUpdate.d.ts +11 -11
  183. package/lib/types/api/firmwareUpdate.js +15 -0
  184. package/lib/types/api/getAccountDescriptor.d.ts +10 -8
  185. package/lib/types/api/getAccountDescriptor.js +10 -0
  186. package/lib/types/api/getAddress.d.ts +42 -9
  187. package/lib/types/api/getAddress.js +14 -0
  188. package/lib/types/api/getOwnershipId.d.ts +33 -8
  189. package/lib/types/api/getOwnershipId.js +10 -0
  190. package/lib/types/api/getOwnershipProof.d.ts +37 -12
  191. package/lib/types/api/getOwnershipProof.js +14 -0
  192. package/lib/types/api/getPublicKey.d.ts +31 -21
  193. package/lib/types/api/getPublicKey.js +26 -0
  194. package/lib/types/api/nem/index.d.ts +841 -91
  195. package/lib/types/api/nem/index.js +130 -0
  196. package/lib/types/api/pushTransaction.d.ts +6 -4
  197. package/lib/types/api/pushTransaction.js +6 -0
  198. package/lib/types/api/recoveryDevice.d.ts +14 -4
  199. package/lib/types/api/recoveryDevice.js +9 -0
  200. package/lib/types/api/requestLogin.d.ts +38 -13
  201. package/lib/types/api/requestLogin.js +15 -0
  202. package/lib/types/api/resetDevice.d.ts +15 -13
  203. package/lib/types/api/resetDevice.js +9 -0
  204. package/lib/types/api/ripple/index.d.ts +40 -22
  205. package/lib/types/api/ripple/index.js +24 -0
  206. package/lib/types/api/solana/index.d.ts +42 -21
  207. package/lib/types/api/solana/index.js +26 -0
  208. package/lib/types/api/stellar/index.d.ts +890 -180
  209. package/lib/types/api/stellar/index.js +249 -0
  210. package/lib/types/api/tezos/index.d.ts +162 -59
  211. package/lib/types/api/tezos/index.js +61 -0
  212. package/lib/types/api/unlockPath.d.ts +7 -5
  213. package/lib/types/api/unlockPath.js +7 -0
  214. package/lib/types/coinInfo.d.ts +273 -56
  215. package/lib/types/coinInfo.js +81 -0
  216. package/lib/types/device.d.ts +1 -1
  217. package/lib/types/device.js +2 -2
  218. package/lib/types/fees.d.ts +29 -25
  219. package/lib/types/fees.js +36 -0
  220. package/lib/types/firmware.d.ts +1 -0
  221. package/lib/types/firmware.js +3 -0
  222. package/lib/types/params.d.ts +26 -17
  223. package/lib/types/params.js +23 -0
  224. package/lib/utils/deviceFeaturesUtils.js +5 -4
  225. package/lib/utils/firmwareUtils.js +5 -4
  226. package/lib/utils/hdnodeUtils.d.ts +191 -1
  227. package/lib/utils/pathUtils.d.ts +191 -1
  228. package/lib/utils/urlUtils.js +3 -3
  229. package/package.json +10 -9
@@ -21,19 +21,19 @@ export default class GetAccountInfo extends AbstractMethod<'getAccountInfo', Req
21
21
  balance: string;
22
22
  availableBalance: string;
23
23
  empty: boolean;
24
- tokens?: import("packages/blockchain-link-types/lib/common").TokenInfo[] | undefined;
25
- addresses?: import("packages/blockchain-link-types/lib/common").AccountAddresses | undefined;
24
+ tokens?: import("@trezor/blockchain-link-types/lib/common").TokenInfo[] | undefined;
25
+ addresses?: import("@trezor/blockchain-link-types/lib/common").AccountAddresses | undefined;
26
26
  history: {
27
27
  total: number;
28
28
  tokens?: number | undefined;
29
29
  unconfirmed: number;
30
- transactions?: import("packages/blockchain-link-types/lib/common").Transaction[] | undefined;
30
+ transactions?: import("@trezor/blockchain-link-types/lib/common").Transaction[] | undefined;
31
31
  txids?: string[] | undefined;
32
32
  addrTxCount?: number | undefined;
33
33
  };
34
34
  misc?: {
35
35
  nonce?: string | undefined;
36
- erc20Contract?: import("packages/blockchain-link-types/lib/common").TokenInfo | undefined;
36
+ erc20Contract?: import("@trezor/blockchain-link-types/lib/common").TokenInfo | undefined;
37
37
  sequence?: number | undefined;
38
38
  reserve?: string | undefined;
39
39
  rewards?: string | undefined;
@@ -62,19 +62,19 @@ export default class GetAccountInfo extends AbstractMethod<'getAccountInfo', Req
62
62
  balance: string;
63
63
  availableBalance: string;
64
64
  empty: boolean;
65
- tokens?: import("packages/blockchain-link-types/lib/common").TokenInfo[] | undefined;
66
- addresses?: import("packages/blockchain-link-types/lib/common").AccountAddresses | undefined;
65
+ tokens?: import("@trezor/blockchain-link-types/lib/common").TokenInfo[] | undefined;
66
+ addresses?: import("@trezor/blockchain-link-types/lib/common").AccountAddresses | undefined;
67
67
  history: {
68
68
  total: number;
69
69
  tokens?: number | undefined;
70
70
  unconfirmed: number;
71
- transactions?: import("packages/blockchain-link-types/lib/common").Transaction[] | undefined;
71
+ transactions?: import("@trezor/blockchain-link-types/lib/common").Transaction[] | undefined;
72
72
  txids?: string[] | undefined;
73
73
  addrTxCount?: number | undefined;
74
74
  };
75
75
  misc?: {
76
76
  nonce?: string | undefined;
77
- erc20Contract?: import("packages/blockchain-link-types/lib/common").TokenInfo | undefined;
77
+ erc20Contract?: import("@trezor/blockchain-link-types/lib/common").TokenInfo | undefined;
78
78
  sequence?: number | undefined;
79
79
  reserve?: string | undefined;
80
80
  rewards?: string | undefined;
@@ -1,6 +1,6 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
- import type { BitcoinNetworkInfo } from '../types';
3
+ import { type BitcoinNetworkInfo } from '../types';
4
4
  type Params = PROTO.GetAddress & {
5
5
  address?: string;
6
6
  coinInfo: BitcoinNetworkInfo;
@@ -24,7 +24,13 @@ export default class GetAddress extends AbstractMethod<'getAddress', Params[]> {
24
24
  serializedPath: string;
25
25
  address: string;
26
26
  }>;
27
- run(): Promise<(import("../types").Address & PROTO.Address) | (import("../types").Address & PROTO.Address)[]>;
27
+ run(): Promise<(import("../types").Address & {
28
+ mac?: string | undefined;
29
+ address: string;
30
+ }) | (import("../types").Address & {
31
+ mac?: string | undefined;
32
+ address: string;
33
+ })[]>;
28
34
  }
29
35
  export {};
30
36
  //# sourceMappingURL=getAddress.d.ts.map
@@ -6,6 +6,9 @@ const pathUtils_1 = require("../utils/pathUtils");
6
6
  const coinInfo_1 = require("../data/coinInfo");
7
7
  const constants_1 = require("../constants");
8
8
  const events_1 = require("../events");
9
+ const types_1 = require("../types");
10
+ const schema_utils_1 = require("@trezor/schema-utils");
11
+ const getAddress_1 = require("../types/api/getAddress");
9
12
  class GetAddress extends AbstractMethod_1.AbstractMethod {
10
13
  constructor() {
11
14
  super(...arguments);
@@ -17,27 +20,14 @@ class GetAddress extends AbstractMethod_1.AbstractMethod {
17
20
  const payload = !this.payload.bundle
18
21
  ? { ...this.payload, bundle: [this.payload] }
19
22
  : this.payload;
20
- (0, paramsValidator_1.validateParams)(payload, [
21
- { name: 'bundle', type: 'array' },
22
- { name: 'useEventListener', type: 'boolean' },
23
- ]);
24
- this.params = payload.bundle.map(batch => {
25
- (0, paramsValidator_1.validateParams)(batch, [
26
- { name: 'path', required: true },
27
- { name: 'coin', type: 'string' },
28
- { name: 'address', type: 'string' },
29
- { name: 'showOnTrezor', type: 'boolean' },
30
- { name: 'multisig', type: 'object' },
31
- { name: 'scriptType', type: 'string' },
32
- { name: 'unlockPath', type: 'object' },
33
- { name: 'chunkify', type: 'boolean' },
34
- ]);
35
- if (batch.unlockPath) {
36
- (0, paramsValidator_1.validateParams)(batch.unlockPath, [
37
- { name: 'address_n', required: true, type: 'array' },
38
- { name: 'mac', required: true, type: 'string' },
39
- ]);
23
+ payload === null || payload === void 0 ? void 0 : payload.bundle.forEach(bundleElement => {
24
+ var _a, _b;
25
+ if (bundleElement.multisig && ((_a = bundleElement.multisig) === null || _a === void 0 ? void 0 : _a.signatures) === undefined) {
26
+ bundleElement.multisig.signatures = Array((_b = bundleElement.multisig) === null || _b === void 0 ? void 0 : _b.pubkeys.length).fill('');
40
27
  }
28
+ });
29
+ (0, schema_utils_1.Assert)((0, types_1.Bundle)(getAddress_1.GetAddress), payload);
30
+ this.params = payload.bundle.map(batch => {
41
31
  const path = (0, pathUtils_1.validatePath)(batch.path, 1);
42
32
  let coinInfo;
43
33
  if (batch.coin) {
@@ -1,11 +1,126 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
- import type { CoinInfo } from '../types';
2
+ import { CoinInfo } from '../types';
3
3
  type Params = {
4
4
  coinInfo: CoinInfo;
5
5
  };
6
6
  export default class GetCoinInfo extends AbstractMethod<'getCoinInfo', Params> {
7
7
  init(): void;
8
- run(): Promise<CoinInfo>;
8
+ run(): Promise<({
9
+ blockchainLink?: {
10
+ type: string;
11
+ url: string[];
12
+ } | undefined;
13
+ name: string;
14
+ label: string;
15
+ blockTime: number;
16
+ minFee: number;
17
+ maxFee: number;
18
+ shortcut: string;
19
+ slip44: number;
20
+ support: {
21
+ T1B1: string | false;
22
+ T2T1: string | false;
23
+ T2B1: string | false;
24
+ connect: boolean;
25
+ };
26
+ decimals: number;
27
+ defaultFees: {
28
+ feeLimit?: string | undefined;
29
+ feePerTx?: string | undefined;
30
+ label: "high" | "normal" | "economy" | "low" | "custom";
31
+ feePerUnit: string;
32
+ blocks: number;
33
+ }[];
34
+ } & {
35
+ cashAddrPrefix?: string | undefined;
36
+ xPubMagicSegwitNative?: number | undefined;
37
+ xPubMagicSegwit?: number | undefined;
38
+ taproot?: boolean | undefined;
39
+ type: "bitcoin";
40
+ dustLimit: number;
41
+ curveName: string;
42
+ forceBip143: boolean;
43
+ hashGenesisBlock: string;
44
+ maxAddressLength: number;
45
+ maxFeeSatoshiKb: number;
46
+ minAddressLength: number;
47
+ minFeeSatoshiKb: number;
48
+ segwit: boolean;
49
+ xPubMagic: number;
50
+ network: {
51
+ forkId?: number | undefined;
52
+ messagePrefix: string;
53
+ bech32: string;
54
+ bip32: {
55
+ public: number;
56
+ private: number;
57
+ };
58
+ pubKeyHash: number;
59
+ scriptHash: number;
60
+ wif: number;
61
+ };
62
+ isBitcoin: boolean;
63
+ }) | ({
64
+ blockchainLink?: {
65
+ type: string;
66
+ url: string[];
67
+ } | undefined;
68
+ name: string;
69
+ label: string;
70
+ blockTime: number;
71
+ minFee: number;
72
+ maxFee: number;
73
+ shortcut: string;
74
+ slip44: number;
75
+ support: {
76
+ T1B1: string | false;
77
+ T2T1: string | false;
78
+ T2B1: string | false;
79
+ connect: boolean;
80
+ };
81
+ decimals: number;
82
+ defaultFees: {
83
+ feeLimit?: string | undefined;
84
+ feePerTx?: string | undefined;
85
+ label: "high" | "normal" | "economy" | "low" | "custom";
86
+ feePerUnit: string;
87
+ blocks: number;
88
+ }[];
89
+ } & {
90
+ network?: undefined;
91
+ type: "ethereum";
92
+ chainId: number;
93
+ }) | ({
94
+ blockchainLink?: {
95
+ type: string;
96
+ url: string[];
97
+ } | undefined;
98
+ name: string;
99
+ label: string;
100
+ blockTime: number;
101
+ minFee: number;
102
+ maxFee: number;
103
+ shortcut: string;
104
+ slip44: number;
105
+ support: {
106
+ T1B1: string | false;
107
+ T2T1: string | false;
108
+ T2B1: string | false;
109
+ connect: boolean;
110
+ };
111
+ decimals: number;
112
+ defaultFees: {
113
+ feeLimit?: string | undefined;
114
+ feePerTx?: string | undefined;
115
+ label: "high" | "normal" | "economy" | "low" | "custom";
116
+ feePerUnit: string;
117
+ blocks: number;
118
+ }[];
119
+ } & {
120
+ network?: undefined;
121
+ type: "nem" | "misc";
122
+ curve: string;
123
+ })>;
9
124
  }
10
125
  export {};
11
126
  //# sourceMappingURL=getCoinInfo.d.ts.map
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
- const paramsValidator_1 = require("./common/paramsValidator");
5
4
  const constants_1 = require("../constants");
6
5
  const coinInfo_1 = require("../data/coinInfo");
6
+ const types_1 = require("../types");
7
+ const schema_utils_1 = require("@trezor/schema-utils");
7
8
  class GetCoinInfo extends AbstractMethod_1.AbstractMethod {
8
9
  init() {
9
10
  this.requiredPermissions = [];
10
11
  this.useDevice = false;
11
12
  this.useUi = false;
12
13
  const { payload } = this;
13
- (0, paramsValidator_1.validateParams)(payload, [{ name: 'coin', type: 'string', required: true }]);
14
+ (0, schema_utils_1.Assert)(types_1.CoinObj, payload);
14
15
  const coinInfo = (0, coinInfo_1.getCoinInfo)(payload.coin);
15
16
  if (!coinInfo) {
16
17
  throw constants_1.ERRORS.TypedError('Method_UnknownCoin');
@@ -1,6 +1,54 @@
1
1
  import { AbstractMethod } from '../core/AbstractMethod';
2
2
  export default class GetFeatures extends AbstractMethod<'getFeatures'> {
3
3
  init(): void;
4
- run(): Promise<import("packages/protobuf/lib/messages").Features>;
4
+ run(): Promise<{
5
+ hide_passphrase_from_host?: boolean | undefined;
6
+ _passphrase_cached?: boolean | undefined;
7
+ busy?: boolean | undefined;
8
+ homescreen_format?: "Toif" | "Jpeg" | "ToiG" | undefined;
9
+ unit_color?: number | undefined;
10
+ unit_btconly?: boolean | undefined;
11
+ homescreen_width?: number | undefined;
12
+ homescreen_height?: number | undefined;
13
+ bootloader_locked?: boolean | undefined;
14
+ flags: number | null;
15
+ language: string | null;
16
+ label: string | null;
17
+ auto_lock_delay_ms: number | null;
18
+ display_rotation: number | null;
19
+ passphrase_always_on_device: boolean | null;
20
+ safety_checks: "Strict" | "PromptAlways" | "PromptTemporarily" | null;
21
+ experimental_features: boolean | null;
22
+ vendor: string;
23
+ major_version: number;
24
+ minor_version: number;
25
+ patch_version: number;
26
+ bootloader_mode: boolean | null;
27
+ device_id: string | null;
28
+ pin_protection: boolean | null;
29
+ passphrase_protection: boolean | null;
30
+ initialized: boolean | null;
31
+ revision: string | null;
32
+ bootloader_hash: string | null;
33
+ imported: boolean | null;
34
+ unlocked: boolean | null;
35
+ firmware_present: boolean | null;
36
+ needs_backup: boolean | null;
37
+ model: string;
38
+ fw_major: number | null;
39
+ fw_minor: number | null;
40
+ fw_patch: number | null;
41
+ fw_vendor: string | null;
42
+ unfinished_backup: boolean | null;
43
+ no_backup: boolean | null;
44
+ recovery_mode: boolean | null;
45
+ capabilities: ("Capability_Bitcoin" | "Capability_Bitcoin_like" | "Capability_Binance" | "Capability_Cardano" | "Capability_Crypto" | "Capability_EOS" | "Capability_Ethereum" | "Capability_Lisk" | "Capability_Monero" | "Capability_NEM" | "Capability_Ripple" | "Capability_Stellar" | "Capability_Tezos" | "Capability_U2F" | "Capability_Shamir" | "Capability_ShamirGroups" | "Capability_PassphraseEntry" | "Capability_Solana")[];
46
+ backup_type: "Bip39" | "Slip39_Basic" | "Slip39_Advanced" | null;
47
+ sd_card_present: boolean | null;
48
+ sd_protection: boolean | null;
49
+ wipe_code_protection: boolean | null;
50
+ session_id: string | null;
51
+ internal_model: import("@trezor/protobuf/lib/messages-schema").DeviceModelInternal;
52
+ }>;
5
53
  }
6
54
  //# sourceMappingURL=getFeatures.d.ts.map
@@ -2,6 +2,8 @@ import { AbstractMethod } from '../core/AbstractMethod';
2
2
  import { PROTO } from '../constants';
3
3
  export default class GetFirmwareHash extends AbstractMethod<'getFirmwareHash', PROTO.GetFirmwareHash> {
4
4
  init(): void;
5
- run(): Promise<PROTO.FirmwareHash>;
5
+ run(): Promise<{
6
+ hash: string;
7
+ }>;
6
8
  }
7
9
  //# sourceMappingURL=getFirmwareHash.d.ts.map
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const AbstractMethod_1 = require("../core/AbstractMethod");
4
+ const constants_1 = require("../constants");
4
5
  const events_1 = require("../events");
5
6
  const paramsValidator_1 = require("./common/paramsValidator");
7
+ const schema_utils_1 = require("@trezor/schema-utils");
6
8
  class GetFirmwareHash extends AbstractMethod_1.AbstractMethod {
7
9
  init() {
8
10
  this.requiredPermissions = ['management'];
@@ -10,7 +12,7 @@ class GetFirmwareHash extends AbstractMethod_1.AbstractMethod {
10
12
  this.useDeviceState = false;
11
13
  this.allowDeviceMode = [events_1.UI.INITIALIZE];
12
14
  const { payload } = this;
13
- (0, paramsValidator_1.validateParams)(payload, [{ name: 'challenge', type: 'string' }]);
15
+ (0, schema_utils_1.Assert)(constants_1.PROTO.GetFirmwareHash, payload);
14
16
  this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, null, this.firmwareRange);
15
17
  this.params = {
16
18
  challenge: payload.challenge,
@@ -5,6 +5,9 @@ const paramsValidator_1 = require("./common/paramsValidator");
5
5
  const pathUtils_1 = require("../utils/pathUtils");
6
6
  const coinInfo_1 = require("../data/coinInfo");
7
7
  const events_1 = require("../events");
8
+ const schema_utils_1 = require("@trezor/schema-utils");
9
+ const exports_1 = require("../exports");
10
+ const getOwnershipId_1 = require("../types/api/getOwnershipId");
8
11
  class GetOwnershipId extends AbstractMethod_1.AbstractMethod {
9
12
  init() {
10
13
  this.requiredPermissions = ['read'];
@@ -12,14 +15,8 @@ class GetOwnershipId extends AbstractMethod_1.AbstractMethod {
12
15
  const payload = !this.payload.bundle
13
16
  ? { ...this.payload, bundle: [this.payload] }
14
17
  : this.payload;
15
- (0, paramsValidator_1.validateParams)(payload, [{ name: 'bundle', type: 'array' }]);
18
+ (0, schema_utils_1.Assert)((0, exports_1.Bundle)(getOwnershipId_1.GetOwnershipId), payload);
16
19
  this.params = payload.bundle.map(batch => {
17
- (0, paramsValidator_1.validateParams)(batch, [
18
- { name: 'path', required: true },
19
- { name: 'coin', type: 'string' },
20
- { name: 'multisig', type: 'object' },
21
- { name: 'scriptType', type: 'string' },
22
- ]);
23
20
  const address_n = (0, pathUtils_1.validatePath)(batch.path, 1);
24
21
  const coinInfo = (0, coinInfo_1.getBitcoinNetwork)(batch.coin || address_n);
25
22
  const script_type = batch.scriptType || (0, pathUtils_1.getScriptType)(address_n);
@@ -5,6 +5,9 @@ const paramsValidator_1 = require("./common/paramsValidator");
5
5
  const pathUtils_1 = require("../utils/pathUtils");
6
6
  const coinInfo_1 = require("../data/coinInfo");
7
7
  const events_1 = require("../events");
8
+ const schema_utils_1 = require("@trezor/schema-utils");
9
+ const exports_1 = require("../exports");
10
+ const getOwnershipProof_1 = require("../types/api/getOwnershipProof");
8
11
  class GetOwnershipProof extends AbstractMethod_1.AbstractMethod {
9
12
  init() {
10
13
  this.requiredPermissions = ['read'];
@@ -12,18 +15,8 @@ class GetOwnershipProof extends AbstractMethod_1.AbstractMethod {
12
15
  const payload = !this.payload.bundle
13
16
  ? { ...this.payload, bundle: [this.payload] }
14
17
  : this.payload;
15
- (0, paramsValidator_1.validateParams)(payload, [{ name: 'bundle', type: 'array' }]);
18
+ (0, schema_utils_1.Assert)((0, exports_1.Bundle)(getOwnershipProof_1.GetOwnershipProof), payload);
16
19
  this.params = payload.bundle.map(batch => {
17
- (0, paramsValidator_1.validateParams)(batch, [
18
- { name: 'path', required: true },
19
- { name: 'coin', type: 'string' },
20
- { name: 'multisig', type: 'object' },
21
- { name: 'scriptType', type: 'string' },
22
- { name: 'userConfirmation', type: 'boolean' },
23
- { name: 'ownershipIds', type: 'array' },
24
- { name: 'commitmentData', type: 'string' },
25
- { name: 'preauthorized', type: 'boolean' },
26
- ]);
27
20
  const address_n = (0, pathUtils_1.validatePath)(batch.path, 1);
28
21
  const coinInfo = (0, coinInfo_1.getBitcoinNetwork)(batch.coin || address_n);
29
22
  const script_type = batch.scriptType || (0, pathUtils_1.getScriptType)(address_n);
@@ -13,7 +13,27 @@ export default class GetPublicKey extends AbstractMethod<'getPublicKey', Params[
13
13
  get info(): string;
14
14
  confirmation(): Promise<boolean>;
15
15
  noBackupConfirmation(allowSuppression?: boolean): Promise<boolean>;
16
- run(): Promise<import("../types/api/getPublicKey").HDNodeResponse | import("../types/api/getPublicKey").HDNodeResponse[]>;
16
+ run(): Promise<{
17
+ xpubSegwit?: string | undefined;
18
+ path: number[];
19
+ publicKey: string;
20
+ serializedPath: string;
21
+ depth: number;
22
+ fingerprint: number;
23
+ chainCode: string;
24
+ childNum: number;
25
+ xpub: string;
26
+ } | {
27
+ xpubSegwit?: string | undefined;
28
+ path: number[];
29
+ publicKey: string;
30
+ serializedPath: string;
31
+ depth: number;
32
+ fingerprint: number;
33
+ chainCode: string;
34
+ childNum: number;
35
+ xpub: string;
36
+ }[]>;
17
37
  }
18
38
  export {};
19
39
  //# sourceMappingURL=getPublicKey.d.ts.map
@@ -6,6 +6,9 @@ const pathUtils_1 = require("../utils/pathUtils");
6
6
  const events_1 = require("../events");
7
7
  const coinInfo_1 = require("../data/coinInfo");
8
8
  const accountUtils_1 = require("../utils/accountUtils");
9
+ const schema_utils_1 = require("@trezor/schema-utils");
10
+ const types_1 = require("../types");
11
+ const getPublicKey_1 = require("../types/api/getPublicKey");
9
12
  class GetPublicKey extends AbstractMethod_1.AbstractMethod {
10
13
  init() {
11
14
  this.requiredPermissions = ['read'];
@@ -13,25 +16,8 @@ class GetPublicKey extends AbstractMethod_1.AbstractMethod {
13
16
  const payload = !this.payload.bundle
14
17
  ? { ...this.payload, bundle: [this.payload] }
15
18
  : this.payload;
16
- (0, paramsValidator_1.validateParams)(payload, [{ name: 'bundle', type: 'array' }]);
19
+ (0, schema_utils_1.Assert)((0, types_1.Bundle)(getPublicKey_1.GetPublicKey), payload);
17
20
  this.params = payload.bundle.map(batch => {
18
- (0, paramsValidator_1.validateParams)(batch, [
19
- { name: 'path', required: true },
20
- { name: 'coin', type: 'string' },
21
- { name: 'crossChain', type: 'boolean' },
22
- { name: 'showOnTrezor', type: 'boolean' },
23
- { name: 'scriptType', type: ['string', 'number'] },
24
- { name: 'ignoreXpubMagic', type: 'boolean' },
25
- { name: 'ecdsaCurveName', type: 'boolean' },
26
- { name: 'unlockPath', type: 'object' },
27
- { name: 'suppressBackupWarning', type: 'boolean' },
28
- ]);
29
- if (batch.unlockPath) {
30
- (0, paramsValidator_1.validateParams)(batch.unlockPath, [
31
- { name: 'address_n', required: true, type: 'array' },
32
- { name: 'mac', required: true, type: 'string' },
33
- ]);
34
- }
35
21
  let coinInfo;
36
22
  if (batch.coin) {
37
23
  coinInfo = (0, coinInfo_1.getBitcoinNetwork)(batch.coin);
@@ -16,8 +16,10 @@ export default class NEMGetAddress extends AbstractMethod<'nemGetAddress', Param
16
16
  } | undefined;
17
17
  confirmation(): Promise<boolean>;
18
18
  noBackupConfirmation(): Promise<boolean>;
19
- _call({ address_n, network, show_display, chunkify }: Params): Promise<PROTO.NEMAddress>;
20
- run(): Promise<import("../../..").Address | import("../../..").Address[]>;
19
+ _call({ address_n, network, show_display, chunkify }: Params): Promise<{
20
+ address: string;
21
+ }>;
22
+ run(): Promise<import("../../../types").Address | import("../../../types").Address[]>;
21
23
  }
22
24
  export {};
23
25
  //# sourceMappingURL=nemGetAddress.d.ts.map
@@ -6,6 +6,9 @@ const coinInfo_1 = require("../../../data/coinInfo");
6
6
  const pathUtils_1 = require("../../../utils/pathUtils");
7
7
  const constants_1 = require("../../../constants");
8
8
  const events_1 = require("../../../events");
9
+ const schema_utils_1 = require("@trezor/schema-utils");
10
+ const types_1 = require("../../../types");
11
+ const getAddress_1 = require("../../../types/api/getAddress");
9
12
  const MAINNET = 0x68;
10
13
  const TESTNET = 0x98;
11
14
  const MIJIN = 0x60;
@@ -21,18 +24,8 @@ class NEMGetAddress extends AbstractMethod_1.AbstractMethod {
21
24
  const payload = !this.payload.bundle
22
25
  ? { ...this.payload, bundle: [this.payload] }
23
26
  : this.payload;
24
- (0, paramsValidator_1.validateParams)(payload, [
25
- { name: 'bundle', type: 'array' },
26
- { name: 'useEventListener', type: 'boolean' },
27
- ]);
27
+ (0, schema_utils_1.Assert)((0, types_1.Bundle)(getAddress_1.GetAddress), payload);
28
28
  this.params = payload.bundle.map(batch => {
29
- (0, paramsValidator_1.validateParams)(batch, [
30
- { name: 'path', required: true },
31
- { name: 'address', type: 'string' },
32
- { name: 'network', type: 'number' },
33
- { name: 'showOnTrezor', type: 'boolean' },
34
- { name: 'chunkify', type: 'boolean' },
35
- ]);
36
29
  const path = (0, pathUtils_1.validatePath)(batch.path, 3);
37
30
  return {
38
31
  address_n: path,
@@ -3,6 +3,9 @@ import type { PROTO } from '../../../constants';
3
3
  export default class NEMSignTransaction extends AbstractMethod<'nemSignTransaction', PROTO.NEMSignTx> {
4
4
  init(): void;
5
5
  get info(): string;
6
- run(): Promise<PROTO.NEMSignedTx>;
6
+ run(): Promise<{
7
+ signature: string;
8
+ data: string;
9
+ }>;
7
10
  }
8
11
  //# sourceMappingURL=nemSignTransaction.d.ts.map
@@ -6,16 +6,18 @@ const paramsValidator_1 = require("../../common/paramsValidator");
6
6
  const coinInfo_1 = require("../../../data/coinInfo");
7
7
  const pathUtils_1 = require("../../../utils/pathUtils");
8
8
  const helper = tslib_1.__importStar(require("../nemSignTx"));
9
+ const schema_utils_1 = require("@trezor/schema-utils");
10
+ const nem_1 = require("../../../types/api/nem");
9
11
  class NEMSignTransaction extends AbstractMethod_1.AbstractMethod {
10
12
  init() {
13
+ var _a;
11
14
  this.requiredPermissions = ['read', 'write'];
12
15
  this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('NEM'), this.firmwareRange);
13
16
  const { payload } = this;
14
- (0, paramsValidator_1.validateParams)(payload, [
15
- { name: 'path', required: true },
16
- { name: 'transaction', required: true },
17
- { name: 'chunkify', type: 'boolean' },
18
- ]);
17
+ if ((_a = payload === null || payload === void 0 ? void 0 : payload.transaction) === null || _a === void 0 ? void 0 : _a.timestamp) {
18
+ payload.transaction.timeStamp = payload.transaction.timestamp;
19
+ }
20
+ (0, schema_utils_1.AssertWeak)(nem_1.NEMSignTransaction, payload);
19
21
  const path = (0, pathUtils_1.validatePath)(payload.path, 3);
20
22
  this.params = helper.createTx(payload.transaction, path, payload.chunkify);
21
23
  }
@@ -1,4 +1,78 @@
1
1
  import { PROTO } from '../../constants';
2
2
  import * as $T from '../../types/api/nem';
3
- export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chunkify?: boolean) => PROTO.NEMSignTx;
3
+ export declare const createTx: (tx: $T.NEMTransaction, address_n: number[], chunkify?: boolean) => {
4
+ chunkify?: boolean | undefined;
5
+ transfer?: {
6
+ payload?: string | undefined;
7
+ public_key?: string | undefined;
8
+ mosaics?: {
9
+ quantity: number;
10
+ namespace: string;
11
+ mosaic: string;
12
+ }[] | undefined;
13
+ amount: string | number;
14
+ recipient: string;
15
+ } | undefined;
16
+ multisig?: {
17
+ address_n?: number[] | undefined;
18
+ network?: number | undefined;
19
+ signer?: string | undefined;
20
+ timestamp: number;
21
+ fee: string | number;
22
+ deadline: number;
23
+ } | undefined;
24
+ cosigning?: boolean | undefined;
25
+ provision_namespace?: {
26
+ parent?: string | undefined;
27
+ fee: string | number;
28
+ namespace: string;
29
+ sink: string;
30
+ } | undefined;
31
+ mosaic_creation?: {
32
+ fee: string | number;
33
+ sink: string;
34
+ definition: {
35
+ name?: string | undefined;
36
+ fee?: string | number | undefined;
37
+ levy?: PROTO.NEMMosaicLevy | undefined;
38
+ divisibility?: number | undefined;
39
+ transferable?: boolean | undefined;
40
+ ticker?: string | undefined;
41
+ levy_address?: string | undefined;
42
+ levy_namespace?: string | undefined;
43
+ levy_mosaic?: string | undefined;
44
+ supply?: number | undefined;
45
+ mutable_supply?: boolean | undefined;
46
+ networks?: number[] | undefined;
47
+ description: string;
48
+ namespace: string;
49
+ mosaic: string;
50
+ };
51
+ } | undefined;
52
+ supply_change?: {
53
+ type: PROTO.NEMSupplyChangeType;
54
+ delta: number;
55
+ namespace: string;
56
+ mosaic: string;
57
+ } | undefined;
58
+ aggregate_modification?: {
59
+ modifications?: {
60
+ type: PROTO.NEMModificationType;
61
+ public_key: string;
62
+ }[] | undefined;
63
+ relative_change?: number | undefined;
64
+ } | undefined;
65
+ importance_transfer?: {
66
+ public_key: string;
67
+ mode: PROTO.NEMImportanceTransferMode;
68
+ } | undefined;
69
+ transaction: {
70
+ address_n?: number[] | undefined;
71
+ network?: number | undefined;
72
+ signer?: string | undefined;
73
+ timestamp: number;
74
+ fee: string | number;
75
+ deadline: number;
76
+ };
77
+ };
4
78
  //# sourceMappingURL=nemSignTx.d.ts.map