@trezor/connect 9.1.5 → 9.1.6

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 (157) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/lib/api/{binanceGetAddress.d.ts → binance/api/binanceGetAddress.d.ts} +3 -3
  4. package/lib/api/{binanceGetAddress.js → binance/api/binanceGetAddress.js} +6 -6
  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} +2 -2
  8. package/lib/api/{binanceSignTransaction.js → binance/api/binanceSignTransaction.js} +5 -5
  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/bitcoin/TransactionComposer.d.ts +4 -4
  12. package/lib/api/bitcoin/TransactionComposer.js +4 -18
  13. package/lib/api/bitcoin/inputs.d.ts +2 -2
  14. package/lib/api/bitcoin/inputs.js +4 -5
  15. package/lib/api/bitcoin/outputs.d.ts +4 -4
  16. package/lib/api/bitcoin/outputs.js +14 -23
  17. package/lib/api/blockchainEstimateFee.d.ts +2 -2
  18. package/lib/api/cardano/api/cardanoComposeTransaction.d.ts +8 -0
  19. package/lib/api/cardano/api/cardanoComposeTransaction.js +69 -0
  20. package/lib/api/{cardanoGetAddress.d.ts → cardano/api/cardanoGetAddress.d.ts} +3 -3
  21. package/lib/api/{cardanoGetAddress.js → cardano/api/cardanoGetAddress.js} +7 -7
  22. package/lib/api/{cardanoGetNativeScriptHash.d.ts → cardano/api/cardanoGetNativeScriptHash.d.ts} +3 -3
  23. package/lib/api/{cardanoGetNativeScriptHash.js → cardano/api/cardanoGetNativeScriptHash.js} +5 -5
  24. package/lib/api/{cardanoGetPublicKey.d.ts → cardano/api/cardanoGetPublicKey.d.ts} +3 -3
  25. package/lib/api/{cardanoGetPublicKey.js → cardano/api/cardanoGetPublicKey.js} +6 -6
  26. package/lib/api/{cardanoSignTransaction.d.ts → cardano/api/cardanoSignTransaction.d.ts} +18 -8
  27. package/lib/api/{cardanoSignTransaction.js → cardano/api/cardanoSignTransaction.js} +30 -13
  28. package/lib/api/cardano/api/index.d.ts +6 -0
  29. package/lib/api/cardano/api/index.js +17 -0
  30. package/lib/api/cardano/cardanoUtils.d.ts +6 -0
  31. package/lib/api/cardano/cardanoUtils.js +64 -1
  32. package/lib/api/composeTransaction.d.ts +5 -5
  33. package/lib/api/composeTransaction.js +14 -19
  34. package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -0
  35. package/lib/api/{eosGetPublicKey.js → eos/api/eosGetPublicKey.js} +5 -5
  36. package/lib/api/{eosSignTransaction.d.ts → eos/api/eosSignTransaction.d.ts} +2 -2
  37. package/lib/api/{eosSignTransaction.js → eos/api/eosSignTransaction.js} +5 -5
  38. package/lib/api/eos/api/index.d.ts +3 -0
  39. package/lib/api/eos/api/index.js +11 -0
  40. package/lib/api/{ethereumGetAddress.d.ts → ethereum/api/ethereumGetAddress.d.ts} +4 -4
  41. package/lib/api/{ethereumGetAddress.js → ethereum/api/ethereumGetAddress.js} +9 -9
  42. package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +16 -0
  43. package/lib/api/{ethereumGetPublicKey.js → ethereum/api/ethereumGetPublicKey.js} +6 -6
  44. package/lib/api/{ethereumSignMessage.d.ts → ethereum/api/ethereumSignMessage.d.ts} +3 -3
  45. package/lib/api/{ethereumSignMessage.js → ethereum/api/ethereumSignMessage.js} +7 -7
  46. package/lib/api/{ethereumSignTransaction.d.ts → ethereum/api/ethereumSignTransaction.d.ts} +11 -9
  47. package/lib/api/{ethereumSignTransaction.js → ethereum/api/ethereumSignTransaction.js} +36 -43
  48. package/lib/api/{ethereumSignTypedData.d.ts → ethereum/api/ethereumSignTypedData.d.ts} +3 -3
  49. package/lib/api/{ethereumSignTypedData.js → ethereum/api/ethereumSignTypedData.js} +10 -10
  50. package/lib/api/{ethereumVerifyMessage.d.ts → ethereum/api/ethereumVerifyMessage.d.ts} +2 -2
  51. package/lib/api/{ethereumVerifyMessage.js → ethereum/api/ethereumVerifyMessage.js} +3 -3
  52. package/lib/api/ethereum/api/index.d.ts +7 -0
  53. package/lib/api/ethereum/api/index.js +19 -0
  54. package/lib/api/ethereum/ethereumSignTx.d.ts +2 -0
  55. package/lib/api/ethereum/ethereumSignTx.js +15 -1
  56. package/lib/api/firmware/verifyAuthenticityProof.js +1 -1
  57. package/lib/api/firmware/x509certificate.d.ts +1 -0
  58. package/lib/api/firmware/x509certificate.js +34 -2
  59. package/lib/api/getAccountDescriptor.d.ts +20 -0
  60. package/lib/api/getAccountDescriptor.js +162 -0
  61. package/lib/api/getAccountInfo.d.ts +2 -0
  62. package/lib/api/index.d.ts +1 -24
  63. package/lib/api/index.js +3 -50
  64. package/lib/api/nem/api/index.d.ts +3 -0
  65. package/lib/api/nem/api/index.js +11 -0
  66. package/lib/api/{nemGetAddress.d.ts → nem/api/nemGetAddress.d.ts} +3 -3
  67. package/lib/api/{nemGetAddress.js → nem/api/nemGetAddress.js} +6 -6
  68. package/lib/api/{nemSignTransaction.d.ts → nem/api/nemSignTransaction.d.ts} +2 -2
  69. package/lib/api/{nemSignTransaction.js → nem/api/nemSignTransaction.js} +5 -5
  70. package/lib/api/ripple/api/index.d.ts +3 -0
  71. package/lib/api/ripple/api/index.js +11 -0
  72. package/lib/api/{rippleGetAddress.d.ts → ripple/api/rippleGetAddress.d.ts} +3 -3
  73. package/lib/api/{rippleGetAddress.js → ripple/api/rippleGetAddress.js} +6 -6
  74. package/lib/api/{rippleSignTransaction.d.ts → ripple/api/rippleSignTransaction.d.ts} +2 -2
  75. package/lib/api/{rippleSignTransaction.js → ripple/api/rippleSignTransaction.js} +4 -4
  76. package/lib/api/solana/api/index.d.ts +4 -0
  77. package/lib/api/solana/api/index.js +13 -0
  78. package/lib/api/solana/api/solanaGetAddress.d.ts +23 -0
  79. package/lib/api/solana/api/solanaGetAddress.js +131 -0
  80. package/lib/api/solana/api/solanaGetPublicKey.d.ts +12 -0
  81. package/lib/api/solana/api/solanaGetPublicKey.js +84 -0
  82. package/lib/api/solana/api/solanaSignTransaction.d.ts +10 -0
  83. package/lib/api/solana/api/solanaSignTransaction.js +33 -0
  84. package/lib/api/stellar/api/index.d.ts +3 -0
  85. package/lib/api/stellar/api/index.js +11 -0
  86. package/lib/api/{stellarGetAddress.d.ts → stellar/api/stellarGetAddress.d.ts} +3 -3
  87. package/lib/api/{stellarGetAddress.js → stellar/api/stellarGetAddress.js} +6 -6
  88. package/lib/api/{stellarSignTransaction.d.ts → stellar/api/stellarSignTransaction.d.ts} +2 -2
  89. package/lib/api/{stellarSignTransaction.js → stellar/api/stellarSignTransaction.js} +6 -6
  90. package/lib/api/tezos/api/index.d.ts +4 -0
  91. package/lib/api/tezos/api/index.js +13 -0
  92. package/lib/api/{tezosGetAddress.d.ts → tezos/api/tezosGetAddress.d.ts} +3 -3
  93. package/lib/api/{tezosGetAddress.js → tezos/api/tezosGetAddress.js} +6 -6
  94. package/lib/api/{tezosGetPublicKey.d.ts → tezos/api/tezosGetPublicKey.d.ts} +3 -3
  95. package/lib/api/{tezosGetPublicKey.js → tezos/api/tezosGetPublicKey.js} +5 -5
  96. package/lib/api/{tezosSignTransaction.d.ts → tezos/api/tezosSignTransaction.d.ts} +2 -2
  97. package/lib/api/{tezosSignTransaction.js → tezos/api/tezosSignTransaction.js} +5 -5
  98. package/lib/backend/Blockchain.js +2 -0
  99. package/lib/constants/cardano.js +2 -2
  100. package/lib/constants/nem.js +3 -3
  101. package/lib/constants/network.d.ts +3 -0
  102. package/lib/constants/network.js +13 -1
  103. package/lib/core/index.d.ts +3 -1
  104. package/lib/core/index.js +17 -4
  105. package/lib/core/method.d.ts +2 -2
  106. package/lib/core/method.js +8 -2
  107. package/lib/core/method.native.d.ts +5 -0
  108. package/lib/core/method.native.js +34 -0
  109. package/lib/data/DataManager.d.ts +11 -0
  110. package/lib/data/config.d.ts +11 -0
  111. package/lib/data/config.js +4 -0
  112. package/lib/data/connectSettings.js +4 -0
  113. package/lib/data/defaultFeeLevels.js +8 -0
  114. package/lib/data/version.d.ts +1 -1
  115. package/lib/data/version.js +1 -1
  116. package/lib/device/Device.d.ts +1 -1
  117. package/lib/device/Device.js +11 -2
  118. package/lib/device/DeviceCommands.js +9 -0
  119. package/lib/device/DeviceList.js +4 -1
  120. package/lib/events/popup.d.ts +19 -3
  121. package/lib/events/popup.js +3 -0
  122. package/lib/factory.js +5 -0
  123. package/lib/types/api/cardanoComposeTransaction.d.ts +44 -0
  124. package/lib/types/api/cardanoComposeTransaction.js +3 -0
  125. package/lib/types/api/cardanoSignTransaction.d.ts +9 -0
  126. package/lib/types/api/composeTransaction.d.ts +28 -54
  127. package/lib/types/api/ethereum/index.d.ts +1 -0
  128. package/lib/types/api/getAccountDescriptor.d.ts +16 -0
  129. package/lib/types/api/getAccountDescriptor.js +3 -0
  130. package/lib/types/api/index.d.ts +10 -0
  131. package/lib/types/api/solana/index.d.ts +12 -0
  132. package/lib/types/api/solana/index.js +3 -0
  133. package/lib/types/api/solanaGetAddress.d.ts +4 -0
  134. package/lib/types/api/solanaGetAddress.js +3 -0
  135. package/lib/types/api/solanaGetPublicKey.d.ts +5 -0
  136. package/lib/types/api/solanaGetPublicKey.js +3 -0
  137. package/lib/types/api/solanaSignTransaction.d.ts +4 -0
  138. package/lib/types/api/solanaSignTransaction.js +3 -0
  139. package/lib/types/coinInfo.d.ts +2 -13
  140. package/lib/types/device.js +1 -1
  141. package/lib/types/index.d.ts +3 -1
  142. package/lib/types/index.js +1 -0
  143. package/lib/types/settings.d.ts +1 -0
  144. package/lib/utils/debug.d.ts +1 -2
  145. package/lib/utils/debug.js +6 -1
  146. package/lib/utils/deviceFeaturesUtils.js +2 -0
  147. package/lib/utils/formatUtils.d.ts +2 -0
  148. package/lib/utils/formatUtils.js +19 -1
  149. package/lib/workers/workers-browser.d.ts +2 -1
  150. package/lib/workers/workers-browser.js +3 -1
  151. package/lib/workers/workers-react-native.d.ts +2 -1
  152. package/lib/workers/workers-react-native.js +3 -1
  153. package/lib/workers/workers.d.ts +8 -5
  154. package/lib/workers/workers.js +34 -10
  155. package/package.json +22 -18
  156. package/lib/api/eosGetPublicKey.d.ts +0 -11
  157. package/lib/api/ethereumGetPublicKey.d.ts +0 -16
@@ -1,34 +1,15 @@
1
+ import type { AccountAddresses, Utxo as AccountUtxo, Address as AccountAddress } from '@trezor/blockchain-link';
2
+ import type { ComposeInput as ComposeInputBase, ComposeOutput as ComposeOutputBase, ComposeResultError as ComposeResultErrorBase, ComposeResultFinal as ComposeResultFinalBase, ComposeResultNonFinal as ComposeResultNonFinalBase } from '@trezor/utxo-lib';
1
3
  import type { PROTO } from '../../constants';
2
- import type { AccountAddresses, Utxo as AccountUtxo } from '@trezor/blockchain-link';
3
4
  import type { Params, Response } from '../params';
4
- export interface RegularOutput {
5
- type?: 'external';
6
- address: string;
7
- amount: string;
8
- script_type?: 'PAYTOADDRESS';
9
- }
10
- export interface InternalOutput {
11
- type?: 'internal';
12
- address_n: number[];
13
- amount: string;
14
- script_type?: string;
15
- }
16
- export interface SendMaxOutput {
17
- type: 'send-max';
18
- address: string;
19
- }
20
- export interface OpReturnOutput {
21
- type: 'opreturn';
22
- dataHex: string;
23
- }
24
- export interface NoAddressOutput {
25
- type: 'noaddress';
26
- amount: string;
27
- }
28
- export interface NoAddressSendMaxOutput {
29
- type: 'send-max-noaddress';
30
- }
31
- export type ComposeOutput = RegularOutput | InternalOutput | SendMaxOutput | OpReturnOutput | NoAddressOutput | NoAddressSendMaxOutput;
5
+ export type ComposeOutputPayment = Omit<Extract<ComposeOutputBase, {
6
+ type: 'payment';
7
+ }>, 'type'> & {
8
+ type?: 'payment';
9
+ };
10
+ export type ComposeOutput = Exclude<ComposeOutputBase, {
11
+ type: 'payment';
12
+ }> | ComposeOutputPayment;
32
13
  export interface ComposeParams {
33
14
  outputs: ComposeOutput[];
34
15
  coin: string;
@@ -45,15 +26,14 @@ export type SignedTransaction = {
45
26
  serializedTx: string;
46
27
  txid?: string;
47
28
  };
29
+ export type ComposeUtxo = AccountUtxo & Partial<ComposeInputBase>;
48
30
  export interface PrecomposeParams {
49
31
  outputs: ComposeOutput[];
50
32
  coin: string;
51
33
  account: {
52
34
  path: string;
53
35
  addresses: AccountAddresses;
54
- utxo: (AccountUtxo & {
55
- required?: boolean;
56
- })[];
36
+ utxo: ComposeUtxo[];
57
37
  };
58
38
  feeLevels: {
59
39
  feePerUnit: string;
@@ -64,29 +44,23 @@ export interface PrecomposeParams {
64
44
  sequence?: number;
65
45
  skipPermutation?: boolean;
66
46
  }
67
- export type PrecomposedTransaction = {
47
+ export type ComposedInputs = AccountUtxo & ComposeInputBase;
48
+ export type ComposeResultError = ComposeResultErrorBase | {
68
49
  type: 'error';
69
- error: string;
70
- } | {
71
- type: 'nonfinal';
72
- max?: string;
73
- totalSpent: string;
74
- fee: string;
75
- feePerByte: string;
76
- bytes: number;
77
- } | {
78
- type: 'final';
79
- max?: string;
80
- totalSpent: string;
81
- fee: string;
82
- feePerByte: string;
83
- bytes: number;
84
- transaction: {
85
- inputs: PROTO.TxInputType[];
86
- outputs: PROTO.TxOutputType[];
87
- outputsPermutation: number[];
88
- };
50
+ error: 'ADDRESSES-NOT-SET';
51
+ };
52
+ export type ComposeResultFinal = ComposeResultFinalBase<ComposedInputs, ComposeOutputBase, AccountAddress>;
53
+ export type ComposeResultNonFinal = ComposeResultNonFinalBase<ComposedInputs>;
54
+ export type ComposeResult = ComposeResultError | ComposeResultNonFinal | ComposeResultFinal;
55
+ export type PrecomposeResultError = ComposeResultError;
56
+ export type PrecomposeResultNonFinal = Omit<ComposeResultNonFinal, 'inputs'> & {
57
+ inputs: PROTO.TxInputType[];
58
+ };
59
+ export type PrecomposeResultFinal = Omit<ComposeResultFinal, 'inputs' | 'outputs'> & {
60
+ inputs: PROTO.TxInputType[];
61
+ outputs: PROTO.TxOutputType[];
89
62
  };
63
+ export type PrecomposedResult = PrecomposeResultError | PrecomposeResultNonFinal | PrecomposeResultFinal;
90
64
  export declare function composeTransaction(params: Params<ComposeParams>): Response<SignedTransaction>;
91
- export declare function composeTransaction(params: Params<PrecomposeParams>): Response<PrecomposedTransaction[]>;
65
+ export declare function composeTransaction(params: Params<PrecomposeParams>): Response<PrecomposedResult[]>;
92
66
  //# sourceMappingURL=composeTransaction.d.ts.map
@@ -40,6 +40,7 @@ export interface EthereumSignedTx {
40
40
  v: string;
41
41
  r: string;
42
42
  s: string;
43
+ serializedTx: string;
43
44
  }
44
45
  interface EthereumSignTypedDataTypeProperty {
45
46
  name: string;
@@ -0,0 +1,16 @@
1
+ import type { PROTO } from '../../constants';
2
+ import type { Params, BundledParams, Response, DerivationPath } from '../params';
3
+ export interface GetAccountDescriptorParams {
4
+ path: DerivationPath;
5
+ coin: string;
6
+ derivationType?: PROTO.CardanoDerivationType;
7
+ suppressBackupWarning?: boolean;
8
+ }
9
+ export interface GetAccountDescriptorResponse {
10
+ descriptor: string;
11
+ path: string;
12
+ legacyXpub?: string;
13
+ }
14
+ export declare function getAccountDescriptor(params: Params<GetAccountDescriptorParams>): Response<GetAccountDescriptorResponse>;
15
+ export declare function getAccountDescriptor(params: BundledParams<GetAccountDescriptorParams>): Response<(GetAccountDescriptorResponse | null)[]>;
16
+ //# sourceMappingURL=getAccountDescriptor.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=getAccountDescriptor.js.map
@@ -22,6 +22,7 @@ import { cardanoGetAddress } from './cardanoGetAddress';
22
22
  import { cardanoGetNativeScriptHash } from './cardanoGetNativeScriptHash';
23
23
  import { cardanoGetPublicKey } from './cardanoGetPublicKey';
24
24
  import { cardanoSignTransaction } from './cardanoSignTransaction';
25
+ import { cardanoComposeTransaction } from './cardanoComposeTransaction';
25
26
  import { changePin } from './changePin';
26
27
  import { cipherKeyValue } from './cipherKeyValue';
27
28
  import { composeTransaction } from './composeTransaction';
@@ -36,6 +37,7 @@ import { ethereumSignTransaction } from './ethereumSignTransaction';
36
37
  import { ethereumSignTypedData } from './ethereumSignTypedData';
37
38
  import { ethereumVerifyMessage } from './ethereumVerifyMessage';
38
39
  import { firmwareUpdate } from './firmwareUpdate';
40
+ import { getAccountDescriptor } from './getAccountDescriptor';
39
41
  import { getAccountInfo } from './getAccountInfo';
40
42
  import { getAddress } from './getAddress';
41
43
  import { getCoinInfo } from './getCoinInfo';
@@ -66,6 +68,9 @@ import { setBusy } from './setBusy';
66
68
  import { setProxy } from './setProxy';
67
69
  import { signMessage } from './signMessage';
68
70
  import { signTransaction } from './signTransaction';
71
+ import { solanaGetPublicKey } from './solanaGetPublicKey';
72
+ import { solanaGetAddress } from './solanaGetAddress';
73
+ import { solanaSignTransaction } from './solanaSignTransaction';
69
74
  import { stellarGetAddress } from './stellarGetAddress';
70
75
  import { stellarSignTransaction } from './stellarSignTransaction';
71
76
  import { tezosGetAddress } from './tezosGetAddress';
@@ -105,6 +110,7 @@ export interface TrezorConnect {
105
110
  cardanoGetNativeScriptHash: typeof cardanoGetNativeScriptHash;
106
111
  cardanoGetPublicKey: typeof cardanoGetPublicKey;
107
112
  cardanoSignTransaction: typeof cardanoSignTransaction;
113
+ cardanoComposeTransaction: typeof cardanoComposeTransaction;
108
114
  changePin: typeof changePin;
109
115
  cipherKeyValue: typeof cipherKeyValue;
110
116
  composeTransaction: typeof composeTransaction;
@@ -120,6 +126,7 @@ export interface TrezorConnect {
120
126
  ethereumSignTypedData: typeof ethereumSignTypedData;
121
127
  ethereumVerifyMessage: typeof ethereumVerifyMessage;
122
128
  firmwareUpdate: typeof firmwareUpdate;
129
+ getAccountDescriptor: typeof getAccountDescriptor;
123
130
  getAccountInfo: typeof getAccountInfo;
124
131
  getAddress: typeof getAddress;
125
132
  getCoinInfo: typeof getCoinInfo;
@@ -149,6 +156,9 @@ export interface TrezorConnect {
149
156
  setProxy: typeof setProxy;
150
157
  signMessage: typeof signMessage;
151
158
  signTransaction: typeof signTransaction;
159
+ solanaGetPublicKey: typeof solanaGetPublicKey;
160
+ solanaGetAddress: typeof solanaGetAddress;
161
+ solanaSignTransaction: typeof solanaSignTransaction;
152
162
  stellarGetAddress: typeof stellarGetAddress;
153
163
  stellarSignTransaction: typeof stellarSignTransaction;
154
164
  tezosGetAddress: typeof tezosGetAddress;
@@ -0,0 +1,12 @@
1
+ import type { PublicKey } from '../../params';
2
+ export interface SolanaPublicKey extends PublicKey {
3
+ publicKey: string;
4
+ }
5
+ export interface SolanaSignTransaction {
6
+ path: string | number[];
7
+ serializedTx: string;
8
+ }
9
+ export interface SolanaSignedTransaction {
10
+ signature: string;
11
+ }
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ import type { Address, GetAddress, Params, BundledParams, Response } from '../params';
2
+ export declare function solanaGetAddress(params: Params<GetAddress>): Response<Address>;
3
+ export declare function solanaGetAddress(params: BundledParams<GetAddress>): Response<Address[]>;
4
+ //# sourceMappingURL=solanaGetAddress.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=solanaGetAddress.js.map
@@ -0,0 +1,5 @@
1
+ import type { GetPublicKey, Params, BundledParams, Response } from '../params';
2
+ import type { SolanaPublicKey } from './solana';
3
+ export declare function solanaGetPublicKey(params: Params<GetPublicKey>): Response<SolanaPublicKey>;
4
+ export declare function solanaGetPublicKey(params: BundledParams<GetPublicKey>): Response<SolanaPublicKey[]>;
5
+ //# sourceMappingURL=solanaGetPublicKey.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=solanaGetPublicKey.js.map
@@ -0,0 +1,4 @@
1
+ import type { Params, Response } from '../params';
2
+ import type { SolanaSignTransaction, SolanaSignedTransaction } from './solana';
3
+ export declare function solanaSignTransaction(params: Params<SolanaSignTransaction>): Response<SolanaSignedTransaction>;
4
+ //# sourceMappingURL=solanaSignTransaction.d.ts.map
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=solanaSignTransaction.js.map
@@ -1,22 +1,12 @@
1
+ import { Network } from '@trezor/utxo-lib';
1
2
  import { FeeLevel } from './fees';
3
+ export type { Network } from '@trezor/utxo-lib';
2
4
  export interface CoinSupport {
3
5
  connect: boolean;
4
6
  T1B1: string;
5
7
  T2T1: string;
6
8
  T2B1: string;
7
9
  }
8
- export interface Network {
9
- messagePrefix: string;
10
- bech32: string;
11
- bip32: {
12
- public: number;
13
- private: number;
14
- };
15
- pubKeyHash: number;
16
- scriptHash: number;
17
- wif: number;
18
- forkId?: number;
19
- }
20
10
  export interface BlockchainLink {
21
11
  type: string;
22
12
  url: string[];
@@ -64,5 +54,4 @@ export interface MiscNetworkInfo extends Common {
64
54
  network?: typeof undefined;
65
55
  }
66
56
  export type CoinInfo = BitcoinNetworkInfo | EthereumNetworkInfo | MiscNetworkInfo;
67
- export {};
68
57
  //# sourceMappingURL=coinInfo.d.ts.map
@@ -5,7 +5,7 @@ var FirmwareType;
5
5
  (function (FirmwareType) {
6
6
  FirmwareType["BitcoinOnly"] = "bitcoin-only";
7
7
  FirmwareType["Regular"] = "regular";
8
- })(FirmwareType = exports.FirmwareType || (exports.FirmwareType = {}));
8
+ })(FirmwareType || (exports.FirmwareType = FirmwareType = {}));
9
9
  var messages_1 = require("@trezor/protobuf/lib/messages");
10
10
  Object.defineProperty(exports, "DeviceModelInternal", { enumerable: true, get: function () { return messages_1.DeviceModelInternal; } });
11
11
  //# sourceMappingURL=device.js.map
@@ -12,9 +12,11 @@ export * from './api/bitcoin';
12
12
  export * from './api/eos';
13
13
  export * from './api/ripple';
14
14
  export * from './api/ethereum';
15
+ export * from './api/solana';
15
16
  export * from './api/stellar';
16
17
  export * from './api/tezos';
17
- export type { ComposeOutput, PrecomposedTransaction } from './api/composeTransaction';
18
+ export type { ComposeOutput, PrecomposeResultError, PrecomposeResultNonFinal, PrecomposeResultFinal, PrecomposedResult, } from './api/composeTransaction';
19
+ export type { PrecomposedTransactionCardano, PrecomposedTransactionErrorCardano, PrecomposedTransactionFinalCardano, PrecomposedTransactionNonFinalCardano, } from './api/cardanoComposeTransaction';
18
20
  export type { RecoveryDevice } from './api/recoveryDevice';
19
21
  export type { AuthenticateDeviceResult } from './api/authenticateDevice';
20
22
  export type { TokenInfo, TokenTransfer, InternalTransfer, FiatRates, Target as TransactionTarget, AccountBalanceHistory as BlockchainAccountBalanceHistory, } from '@trezor/blockchain-link';
@@ -15,6 +15,7 @@ tslib_1.__exportStar(require("./api/bitcoin"), exports);
15
15
  tslib_1.__exportStar(require("./api/eos"), exports);
16
16
  tslib_1.__exportStar(require("./api/ripple"), exports);
17
17
  tslib_1.__exportStar(require("./api/ethereum"), exports);
18
+ tslib_1.__exportStar(require("./api/solana"), exports);
18
19
  tslib_1.__exportStar(require("./api/stellar"), exports);
19
20
  tslib_1.__exportStar(require("./api/tezos"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -31,5 +31,6 @@ export interface ConnectSettings {
31
31
  env: 'node' | 'web' | 'webextension' | 'electron' | 'react-native';
32
32
  timestamp: number;
33
33
  proxy?: Proxy;
34
+ sharedLogger?: boolean;
34
35
  }
35
36
  //# sourceMappingURL=settings.d.ts.map
@@ -7,7 +7,7 @@ export type LogMessage = {
7
7
  export type LogWriter = {
8
8
  add: (message: LogMessage) => void;
9
9
  };
10
- declare class Log {
10
+ export declare class Log {
11
11
  prefix: string;
12
12
  enabled: boolean;
13
13
  css: string;
@@ -26,5 +26,4 @@ export declare const setLogWriter: (logWriterFactory: () => LogWriter | undefine
26
26
  export declare const enableLog: (enabled?: boolean) => void;
27
27
  export declare const enableLogByPrefix: (prefix: string, enabled: boolean) => void;
28
28
  export declare const getLog: () => LogMessage[];
29
- export {};
30
29
  //# sourceMappingURL=debug.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLog = exports.enableLogByPrefix = exports.enableLog = exports.setLogWriter = exports.initLog = void 0;
3
+ exports.getLog = exports.enableLogByPrefix = exports.enableLog = exports.setLogWriter = exports.initLog = exports.Log = void 0;
4
4
  const green = '#bada55';
5
5
  const blue = '#20abd8';
6
6
  const orange = '#f4a744';
@@ -82,6 +82,7 @@ class Log {
82
82
  }
83
83
  }
84
84
  }
85
+ exports.Log = Log;
85
86
  const _logs = {};
86
87
  let writer;
87
88
  const initLog = (prefix, enabled, logWriter) => {
@@ -96,6 +97,10 @@ const setLogWriter = (logWriterFactory) => {
96
97
  writer = logWriterFactory();
97
98
  if (writer) {
98
99
  _logs[key].setWriter(writer);
100
+ const { messages } = _logs[key];
101
+ messages.forEach(message => {
102
+ writer === null || writer === void 0 ? void 0 : writer.add(message);
103
+ });
99
104
  }
100
105
  });
101
106
  };
@@ -70,6 +70,8 @@ const getUnavailableCapabilities = (features, coins) => {
70
70
  return !capabilities.includes('Capability_Cardano');
71
71
  if (info.shortcut === 'XRP' || info.shortcut === 'tXRP')
72
72
  return !capabilities.includes('Capability_Ripple');
73
+ if (info.shortcut === 'SOL' || info.shortcut === 'DSOL')
74
+ return !capabilities.includes('Capability_Solana');
73
75
  return !capabilities.includes(`Capability_${info.name}`);
74
76
  });
75
77
  unavailable.forEach(info => {
@@ -4,5 +4,7 @@ export declare const formatTime: (n: number) => string;
4
4
  export declare const btckb2satoshib: (n: string) => string;
5
5
  export declare const hasHexPrefix: (str: string) => boolean;
6
6
  export declare const stripHexPrefix: (str: string) => string;
7
+ export declare const addHexPrefix: (str: string) => string;
7
8
  export declare const messageToHex: (message: string) => string;
9
+ export declare const deepTransform: (transform: (str: string) => string) => <T>(value: T) => T;
8
10
  //# sourceMappingURL=formatUtils.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.messageToHex = exports.stripHexPrefix = exports.hasHexPrefix = exports.btckb2satoshib = exports.formatTime = exports.formatAmount = void 0;
3
+ exports.deepTransform = exports.messageToHex = exports.addHexPrefix = exports.stripHexPrefix = exports.hasHexPrefix = exports.btckb2satoshib = exports.formatTime = exports.formatAmount = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
6
6
  const formatAmount = (n, coinInfo) => `${new bignumber_js_1.default(n).div(10 ** coinInfo.decimals).toString(10)} ${coinInfo.shortcut}`;
@@ -30,6 +30,8 @@ const hasHexPrefix = (str) => str.slice(0, 2).toLowerCase() === '0x';
30
30
  exports.hasHexPrefix = hasHexPrefix;
31
31
  const stripHexPrefix = (str) => ((0, exports.hasHexPrefix)(str) ? str.slice(2) : str);
32
32
  exports.stripHexPrefix = stripHexPrefix;
33
+ const addHexPrefix = (str) => (str && !(0, exports.hasHexPrefix)(str) ? `0x${str}` : str);
34
+ exports.addHexPrefix = addHexPrefix;
33
35
  const isHexString = (value, length) => {
34
36
  if (typeof value !== 'string' || !value.match(/^(0x|0X)?[0-9A-Fa-f]*$/)) {
35
37
  return false;
@@ -54,4 +56,20 @@ const messageToHex = (message) => {
54
56
  return buffer.toString('hex');
55
57
  };
56
58
  exports.messageToHex = messageToHex;
59
+ const deepTransform = (transform) => {
60
+ const recursion = (value) => {
61
+ if (typeof value === 'string') {
62
+ return transform(value);
63
+ }
64
+ if (Array.isArray(value)) {
65
+ return value.map(recursion);
66
+ }
67
+ if (value && typeof value === 'object') {
68
+ return Object.entries(value).reduce((obj, [k, v]) => ({ ...obj, [k]: recursion(v) }), {});
69
+ }
70
+ return value;
71
+ };
72
+ return recursion;
73
+ };
74
+ exports.deepTransform = deepTransform;
57
75
  //# sourceMappingURL=formatUtils.js.map
@@ -1,6 +1,7 @@
1
1
  import BlockbookWorker from '@trezor/blockchain-link/lib/workers/blockbook';
2
2
  import RippleWorker from '@trezor/blockchain-link/lib/workers/ripple';
3
3
  import BlockfrostWorker from '@trezor/blockchain-link/lib/workers/blockfrost';
4
+ import SolanaWorker from '@trezor/blockchain-link/lib/workers/solana';
4
5
  declare const ElectrumWorker: undefined;
5
- export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker };
6
+ export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker, SolanaWorker };
6
7
  //# sourceMappingURL=workers-browser.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
3
+ exports.SolanaWorker = exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const blockbook_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockbook"));
6
6
  exports.BlockbookWorker = blockbook_1.default;
@@ -8,6 +8,8 @@ const ripple_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/wo
8
8
  exports.RippleWorker = ripple_1.default;
9
9
  const blockfrost_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockfrost"));
10
10
  exports.BlockfrostWorker = blockfrost_1.default;
11
+ const solana_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/solana"));
12
+ exports.SolanaWorker = solana_1.default;
11
13
  const ElectrumWorker = undefined;
12
14
  exports.ElectrumWorker = ElectrumWorker;
13
15
  //# sourceMappingURL=workers-browser.js.map
@@ -1,6 +1,7 @@
1
1
  import BlockbookWorker from '@trezor/blockchain-link/lib/workers/blockbook';
2
2
  import RippleWorker from '@trezor/blockchain-link/lib/workers/ripple';
3
3
  import BlockfrostWorker from '@trezor/blockchain-link/lib/workers/blockfrost';
4
+ import SolanaWorker from '@trezor/blockchain-link/lib/workers/solana';
4
5
  declare const ElectrumWorker: undefined;
5
- export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker };
6
+ export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker, SolanaWorker };
6
7
  //# sourceMappingURL=workers-react-native.d.ts.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
3
+ exports.SolanaWorker = exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const blockbook_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockbook"));
6
6
  exports.BlockbookWorker = blockbook_1.default;
@@ -8,6 +8,8 @@ const ripple_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/wo
8
8
  exports.RippleWorker = ripple_1.default;
9
9
  const blockfrost_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockfrost"));
10
10
  exports.BlockfrostWorker = blockfrost_1.default;
11
+ const solana_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/solana"));
12
+ exports.SolanaWorker = solana_1.default;
11
13
  const ElectrumWorker = undefined;
12
14
  exports.ElectrumWorker = ElectrumWorker;
13
15
  //# sourceMappingURL=workers-react-native.js.map
@@ -1,6 +1,9 @@
1
- import BlockbookWorker from '@trezor/blockchain-link/lib/workers/blockbook';
2
- import RippleWorker from '@trezor/blockchain-link/lib/workers/ripple';
3
- import BlockfrostWorker from '@trezor/blockchain-link/lib/workers/blockfrost';
4
- import ElectrumWorker from '@trezor/blockchain-link/lib/workers/electrum';
5
- export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker };
1
+ import type { BaseWorker } from '@trezor/blockchain-link/lib/workers/baseWorker';
2
+ type WorkerAsyncImporter = () => Promise<BaseWorker<unknown>>;
3
+ declare const BlockbookWorker: WorkerAsyncImporter;
4
+ declare const RippleWorker: WorkerAsyncImporter;
5
+ declare const BlockfrostWorker: WorkerAsyncImporter;
6
+ declare const ElectrumWorker: WorkerAsyncImporter;
7
+ declare const SolanaWorker: WorkerAsyncImporter;
8
+ export { BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker, SolanaWorker };
6
9
  //# sourceMappingURL=workers.d.ts.map
@@ -1,13 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
4
- const tslib_1 = require("tslib");
5
- const blockbook_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockbook"));
6
- exports.BlockbookWorker = blockbook_1.default;
7
- const ripple_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/ripple"));
8
- exports.RippleWorker = ripple_1.default;
9
- const blockfrost_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/blockfrost"));
10
- exports.BlockfrostWorker = blockfrost_1.default;
11
- const electrum_1 = tslib_1.__importDefault(require("@trezor/blockchain-link/lib/workers/electrum"));
12
- exports.ElectrumWorker = electrum_1.default;
26
+ exports.SolanaWorker = exports.ElectrumWorker = exports.BlockfrostWorker = exports.RippleWorker = exports.BlockbookWorker = void 0;
27
+ const BlockbookWorker = () => Promise.resolve().then(() => __importStar(require('@trezor/blockchain-link/lib/workers/blockbook'))).then(w => w.default());
28
+ exports.BlockbookWorker = BlockbookWorker;
29
+ const RippleWorker = () => Promise.resolve().then(() => __importStar(require('@trezor/blockchain-link/lib/workers/ripple'))).then(w => w.default());
30
+ exports.RippleWorker = RippleWorker;
31
+ const BlockfrostWorker = () => Promise.resolve().then(() => __importStar(require('@trezor/blockchain-link/lib/workers/blockfrost'))).then(w => w.default());
32
+ exports.BlockfrostWorker = BlockfrostWorker;
33
+ const ElectrumWorker = () => Promise.resolve().then(() => __importStar(require('@trezor/blockchain-link/lib/workers/electrum'))).then(w => w.default());
34
+ exports.ElectrumWorker = ElectrumWorker;
35
+ const SolanaWorker = () => Promise.resolve().then(() => __importStar(require('@trezor/blockchain-link/lib/workers/solana'))).then(w => w.default());
36
+ exports.SolanaWorker = SolanaWorker;
13
37
  //# sourceMappingURL=workers.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trezor/connect",
3
- "version": "9.1.5",
3
+ "version": "9.1.6",
4
4
  "author": "Trezor <info@trezor.io>",
5
5
  "homepage": "https://github.com/trezor/trezor-suite/tree/develop/packages/connect",
6
6
  "description": "High-level javascript interface for Trezor hardware wallet.",
@@ -49,27 +49,31 @@
49
49
  "prepublish": "yarn tsx ../../scripts/prepublish.js"
50
50
  },
51
51
  "dependencies": {
52
- "@trezor/blockchain-link": "2.1.18",
53
- "@trezor/blockchain-link-types": "1.0.7",
54
- "@trezor/connect-analytics": "1.0.8",
55
- "@trezor/connect-common": "0.0.22",
56
- "@trezor/protobuf": "1.0.2",
57
- "@trezor/protocol": "1.0.2",
58
- "@trezor/transport": "1.1.17",
59
- "@trezor/utils": "9.0.14",
60
- "@trezor/utxo-lib": "1.0.12",
52
+ "@ethereumjs/common": "^3.1.2",
53
+ "@ethereumjs/tx": "^4.1.2",
54
+ "@fivebinaries/coin-selection": "2.2.0",
55
+ "@trezor/blockchain-link": "2.1.19",
56
+ "@trezor/blockchain-link-types": "1.0.8",
57
+ "@trezor/connect-analytics": "1.0.9",
58
+ "@trezor/connect-common": "0.0.23",
59
+ "@trezor/protobuf": "1.0.3",
60
+ "@trezor/protocol": "1.0.3",
61
+ "@trezor/transport": "1.1.18",
62
+ "@trezor/utils": "9.0.15",
63
+ "@trezor/utxo-lib": "2.0.1",
61
64
  "bignumber.js": "^9.1.1",
62
65
  "blakejs": "^1.2.1",
63
66
  "bs58": "^5.0.0",
64
67
  "bs58check": "^3.0.1",
65
- "cross-fetch": "^3.1.6",
68
+ "cross-fetch": "^4.0.0",
66
69
  "events": "^3.3.0"
67
70
  },
68
71
  "devDependencies": {
69
72
  "@trezor/trezor-user-env-link": "1.0.2",
70
- "@types/karma": "^6.3.4",
71
- "@types/parse-uri": "^1.0.0",
72
- "jest": "^29.5.0",
73
+ "@types/karma": "^6.3.6",
74
+ "@types/parse-uri": "^1.0.2",
75
+ "ethereum-cryptography": "^2.0.0",
76
+ "jest": "29.5.0",
73
77
  "jest-environment-jsdom": "^29.5.0",
74
78
  "karma": "^6.4.2",
75
79
  "karma-babel-preprocessor": "^8.0.2",
@@ -78,11 +82,11 @@
78
82
  "karma-jasmine-async": "^0.0.1",
79
83
  "karma-sourcemap-loader": "^0.4.0",
80
84
  "karma-webpack": "^5.0.0",
81
- "rimraf": "^5.0.1",
85
+ "rimraf": "^5.0.5",
82
86
  "ts-node": "^10.9.1",
83
- "tsx": "^3.12.7",
84
- "typescript": "4.9.5",
85
- "webpack": "^5.87.0",
87
+ "tsx": "^3.14.0",
88
+ "typescript": "5.3.2",
89
+ "webpack": "^5.89.0",
86
90
  "ws": "7.5.9"
87
91
  },
88
92
  "peerDependencies": {
@@ -1,11 +0,0 @@
1
- import { AbstractMethod } from '../core/AbstractMethod';
2
- import type { PROTO } from '../constants';
3
- export default class EosGetPublicKey extends AbstractMethod<'eosGetPublicKey', PROTO.EosGetPublicKey[]> {
4
- hasBundle?: boolean;
5
- confirmed?: boolean;
6
- init(): void;
7
- get info(): string;
8
- confirmation(): Promise<boolean>;
9
- run(): Promise<import("..").EosPublicKey | import("..").EosPublicKey[]>;
10
- }
11
- //# sourceMappingURL=eosGetPublicKey.d.ts.map