@trezor/connect 9.0.4 → 9.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/README.md +1 -1
- package/lib/api/binanceGetAddress.d.ts +1 -1
- package/lib/api/binanceSignTransaction.d.ts +1 -1
- package/lib/api/bitcoin/Fees.d.ts +1 -1
- package/lib/api/bitcoin/TransactionComposer.d.ts +1 -1
- package/lib/api/bitcoin/signtxVerify.d.ts +1 -1
- package/lib/api/blockchainDisconnect.d.ts +1 -1
- package/lib/api/blockchainEstimateFee.d.ts +1 -1
- package/lib/api/blockchainGetAccountBalanceHistory.d.ts +1 -1
- package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -1
- package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -1
- package/lib/api/blockchainGetTransactions.d.ts +1 -1
- package/lib/api/blockchainSetCustomBackend.d.ts +1 -1
- package/lib/api/blockchainSubscribe.d.ts +1 -1
- package/lib/api/blockchainSubscribeFiatRates.d.ts +1 -1
- package/lib/api/blockchainUnsubscribe.d.ts +1 -1
- package/lib/api/blockchainUnsubscribeFiatRates.d.ts +1 -1
- package/lib/api/cardano/cardanoCertificate.d.ts +2 -2
- package/lib/api/cardano/cardanoInputs.d.ts +3 -3
- package/lib/api/cardano/cardanoOutputs.d.ts +1 -1
- package/lib/api/cardano/cardanoTokenBundle.d.ts +1 -1
- package/lib/api/cardanoGetAddress.d.ts +1 -1
- package/lib/api/cardanoSignTransaction.d.ts +1 -1
- package/lib/api/common/Discovery.d.ts +2 -2
- package/lib/api/common/paramsValidator.d.ts +2 -2
- package/lib/api/composeTransaction.d.ts +1 -1
- package/lib/api/eos/eosSignTx.js +1 -1
- package/lib/api/eosSignTransaction.d.ts +1 -1
- package/lib/api/ethereumGetAddress.d.ts +1 -1
- package/lib/api/ethereumGetPublicKey.d.ts +1 -1
- package/lib/api/ethereumSignTransaction.d.ts +1 -1
- package/lib/api/ethereumSignTypedData.d.ts +1 -1
- package/lib/api/firmware/uploadFirmware.d.ts +2 -2
- package/lib/api/firmwareUpdate.d.ts +1 -1
- package/lib/api/firmwareUpdate.js +1 -1
- package/lib/api/getAccountInfo.d.ts +1 -1
- package/lib/api/getAddress.d.ts +1 -1
- package/lib/api/getCoinInfo.d.ts +2 -2
- package/lib/api/getPublicKey.d.ts +1 -1
- package/lib/api/nemGetAddress.d.ts +1 -1
- package/lib/api/pushTransaction.d.ts +1 -1
- package/lib/api/rippleGetAddress.d.ts +1 -1
- package/lib/api/setBusy.js +5 -1
- package/lib/api/setProxy.js +3 -4
- package/lib/api/signTransaction.d.ts +1 -1
- package/lib/api/stellarGetAddress.d.ts +1 -1
- package/lib/api/stellarSignTransaction.d.ts +1 -1
- package/lib/api/tezosGetAddress.d.ts +1 -1
- package/lib/backend/BackendManager.d.ts +1 -1
- package/lib/backend/BackendManager.js +0 -4
- package/lib/backend/Blockchain.d.ts +3 -9
- package/lib/backend/Blockchain.js +2 -17
- package/lib/constants/network.d.ts +1 -1
- package/lib/core/AbstractMethod.d.ts +4 -4
- package/lib/core/AbstractMethod.js +7 -5
- package/lib/core/index.js +2 -0
- package/lib/data/DataManager.d.ts +1 -1
- package/lib/data/analyticsInfo.d.ts +6 -0
- package/lib/data/analyticsInfo.js +37 -0
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/AbortController.d.ts +1 -1
- package/lib/device/DescriptorStream.d.ts +1 -1
- package/lib/device/Device.d.ts +1 -1
- package/lib/device/Device.js +3 -0
- package/lib/device/DeviceCommands.d.ts +7 -7
- package/lib/device/DeviceCommands.js +3 -1
- package/lib/device/DeviceList.d.ts +1 -1
- package/lib/events/blockchain.d.ts +4 -5
- package/lib/events/call.d.ts +10 -10
- package/lib/events/core.d.ts +3 -2
- package/lib/events/device.d.ts +3 -3
- package/lib/events/iframe.d.ts +2 -2
- package/lib/events/popup.d.ts +2 -2
- package/lib/events/transport.d.ts +3 -3
- package/lib/events/ui-promise.d.ts +2 -2
- package/lib/events/ui-request.d.ts +8 -6
- package/lib/events/ui-response.d.ts +2 -2
- package/lib/types/account.d.ts +2 -2
- package/lib/types/api/binance/index.d.ts +1 -1
- package/lib/types/api/bitcoin/index.d.ts +2 -2
- package/lib/types/api/blockchainGetTransactions.d.ts +1 -1
- package/lib/types/api/blockchainSetCustomBackend.d.ts +1 -1
- package/lib/types/api/blockchainSubscribe.d.ts +1 -1
- package/lib/types/api/blockchainSubscribeFiatRates.d.ts +1 -1
- package/lib/types/api/cardano/index.d.ts +2 -2
- package/lib/types/api/composeTransaction.d.ts +3 -3
- package/lib/types/api/eos/index.d.ts +1 -1
- package/lib/types/api/getAddress.d.ts +1 -1
- package/lib/types/api/nem/index.d.ts +9 -9
- package/lib/types/api/off.d.ts +2 -2
- package/lib/types/api/on.d.ts +2 -2
- package/lib/types/api/pushTransaction.d.ts +1 -1
- package/lib/types/api/setProxy.d.ts +1 -2
- package/lib/types/api/stellar/index.d.ts +2 -2
- package/lib/types/coinInfo.d.ts +3 -3
- package/lib/types/device.d.ts +13 -13
- package/lib/types/firmware.d.ts +3 -3
- package/lib/types/params.d.ts +3 -3
- package/lib/types/settings.d.ts +1 -2
- package/lib/types/utils.d.ts +2 -2
- package/lib/utils/accountUtils.d.ts +1 -1
- package/lib/utils/browserUtils.d.ts +2 -2
- package/lib/utils/debug.d.ts +1 -1
- package/lib/utils/deferred.d.ts +2 -2
- package/lib/utils/interactionTimeout.d.ts +1 -1
- package/lib/workers/RNUsbPlugin.d.ts +1 -1
- package/lib/workers/workers.d.ts +1 -1
- package/package.json +83 -80
|
@@ -67,7 +67,7 @@ export interface CardanoAssetGroup {
|
|
|
67
67
|
policyId: string;
|
|
68
68
|
tokenAmounts: CardanoToken[];
|
|
69
69
|
}
|
|
70
|
-
export
|
|
70
|
+
export type CardanoOutput = ({
|
|
71
71
|
addressParameters: CardanoAddressParameters;
|
|
72
72
|
} | {
|
|
73
73
|
address: string;
|
|
@@ -123,7 +123,7 @@ export interface CardanoWithdrawal {
|
|
|
123
123
|
scriptHash?: string;
|
|
124
124
|
keyHash?: string;
|
|
125
125
|
}
|
|
126
|
-
export
|
|
126
|
+
export type CardanoMint = CardanoAssetGroup[];
|
|
127
127
|
export interface CardanoCollateralInput {
|
|
128
128
|
path?: string | number[];
|
|
129
129
|
prev_hash: string;
|
|
@@ -28,7 +28,7 @@ export interface NoAddressOutput {
|
|
|
28
28
|
export interface NoAddressSendMaxOutput {
|
|
29
29
|
type: 'send-max-noaddress';
|
|
30
30
|
}
|
|
31
|
-
export
|
|
31
|
+
export type ComposeOutput = RegularOutput | InternalOutput | SendMaxOutput | OpReturnOutput | NoAddressOutput | NoAddressSendMaxOutput;
|
|
32
32
|
export interface ComposeParams {
|
|
33
33
|
outputs: ComposeOutput[];
|
|
34
34
|
coin: string;
|
|
@@ -40,7 +40,7 @@ export interface ComposeParams {
|
|
|
40
40
|
floorBaseFee?: boolean;
|
|
41
41
|
skipPermutation?: boolean;
|
|
42
42
|
}
|
|
43
|
-
export
|
|
43
|
+
export type SignedTransaction = {
|
|
44
44
|
signatures: string[];
|
|
45
45
|
serializedTx: string;
|
|
46
46
|
txid?: string;
|
|
@@ -64,7 +64,7 @@ export interface PrecomposeParams {
|
|
|
64
64
|
sequence?: number;
|
|
65
65
|
skipPermutation?: boolean;
|
|
66
66
|
}
|
|
67
|
-
export
|
|
67
|
+
export type PrecomposedTransaction = {
|
|
68
68
|
type: 'error';
|
|
69
69
|
error: string;
|
|
70
70
|
} | {
|
|
@@ -26,7 +26,7 @@ export interface EosTxActionCommon {
|
|
|
26
26
|
account: string;
|
|
27
27
|
authorization: PROTO.EosPermissionLevel[];
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type EosTxAction = (EosTxActionCommon & {
|
|
30
30
|
name: 'transfer';
|
|
31
31
|
data: {
|
|
32
32
|
from: string;
|
|
@@ -7,7 +7,7 @@ interface GetAddress extends GetAddressShared {
|
|
|
7
7
|
scriptType?: PROTO.InternalInputScriptType;
|
|
8
8
|
unlockPath?: PROTO.UnlockPath;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
type Address = AddressShared & PROTO.Address;
|
|
11
11
|
export declare function getAddress(params: Params<GetAddress>): Response<Address>;
|
|
12
12
|
export declare function getAddress(params: BundledParams<GetAddress>): Response<Address[]>;
|
|
13
13
|
export {};
|
|
@@ -37,52 +37,52 @@ export interface TransactionCommon {
|
|
|
37
37
|
deadline: number;
|
|
38
38
|
signer?: string;
|
|
39
39
|
}
|
|
40
|
-
export
|
|
40
|
+
export type NEMTransferTransaction = TransactionCommon & {
|
|
41
41
|
type: NEM.TxType.TRANSFER;
|
|
42
42
|
recipient: string;
|
|
43
43
|
amount: PROTO.UintType;
|
|
44
44
|
mosaics?: NEMMosaic[];
|
|
45
45
|
message?: Message;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type NEMImportanceTransaction = TransactionCommon & {
|
|
48
48
|
type: NEM.TxType.IMPORTANCE_TRANSFER;
|
|
49
49
|
importanceTransfer: {
|
|
50
50
|
mode: PROTO.NEMImportanceTransferMode;
|
|
51
51
|
publicKey: string;
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
-
export
|
|
54
|
+
export type NEMAggregateModificationTransaction = TransactionCommon & {
|
|
55
55
|
type: NEM.TxType.AGGREGATE_MODIFICATION;
|
|
56
56
|
modifications?: Modification[];
|
|
57
57
|
minCosignatories: {
|
|
58
58
|
relativeChange: number;
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
-
export
|
|
61
|
+
export type NEMProvisionNamespaceTransaction = TransactionCommon & {
|
|
62
62
|
type: NEM.TxType.PROVISION_NAMESPACE;
|
|
63
63
|
newPart: string;
|
|
64
64
|
parent?: string;
|
|
65
65
|
rentalFeeSink: string;
|
|
66
66
|
rentalFee: number;
|
|
67
67
|
};
|
|
68
|
-
export
|
|
68
|
+
export type NEMMosaicCreationTransaction = TransactionCommon & {
|
|
69
69
|
type: NEM.TxType.MOSAIC_CREATION;
|
|
70
70
|
mosaicDefinition: MosaicDefinition;
|
|
71
71
|
creationFeeSink: string;
|
|
72
72
|
creationFee: number;
|
|
73
73
|
};
|
|
74
|
-
export
|
|
74
|
+
export type NEMSupplyChangeTransaction = TransactionCommon & {
|
|
75
75
|
type: NEM.TxType.SUPPLY_CHANGE;
|
|
76
76
|
mosaicId: MosaicID;
|
|
77
77
|
supplyType: PROTO.NEMSupplyChangeType;
|
|
78
78
|
delta: number;
|
|
79
79
|
};
|
|
80
|
-
export
|
|
81
|
-
export
|
|
80
|
+
export type NEMRegularTransaction = NEMTransferTransaction | NEMImportanceTransaction | NEMAggregateModificationTransaction | NEMProvisionNamespaceTransaction | NEMMosaicCreationTransaction | NEMSupplyChangeTransaction;
|
|
81
|
+
export type NEMMultisigTransaction = TransactionCommon & {
|
|
82
82
|
type: NEM.TxType.COSIGNING | NEM.TxType.MULTISIG | NEM.TxType.MULTISIG_SIGNATURE;
|
|
83
83
|
otherTrans: NEMRegularTransaction;
|
|
84
84
|
};
|
|
85
|
-
export
|
|
85
|
+
export type NEMTransaction = NEMRegularTransaction | NEMMultisigTransaction;
|
|
86
86
|
export interface NEMSignTransaction {
|
|
87
87
|
path: string | number[];
|
|
88
88
|
transaction: NEMTransaction;
|
package/lib/types/api/off.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import { BLOCKCHAIN_EVENT, BlockchainEvent } from '../../events/blockchain';
|
|
|
2
2
|
import { DEVICE_EVENT, DeviceEvent } from '../../events/device';
|
|
3
3
|
import { TRANSPORT_EVENT, TransportEvent } from '../../events/transport';
|
|
4
4
|
import { UI_EVENT, UiEvent } from '../../events/ui-request';
|
|
5
|
-
|
|
5
|
+
type EventType<Event> = Event extends {
|
|
6
6
|
type: string;
|
|
7
7
|
} ? Event['type'] : never;
|
|
8
|
-
export
|
|
8
|
+
export type EventListenerType = typeof BLOCKCHAIN_EVENT | typeof DEVICE_EVENT | typeof TRANSPORT_EVENT | typeof UI_EVENT | EventType<TransportEvent> | EventType<UiEvent> | EventType<DeviceEvent> | EventType<BlockchainEvent>;
|
|
9
9
|
export declare function off(type: EventListenerType, cb: (...args: any[]) => any): void;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=off.d.ts.map
|
package/lib/types/api/on.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import type { DeviceEvent, DeviceEventListenerFn } from '../../events/device';
|
|
|
3
3
|
import type { TransportEvent, TransportEventListenerFn } from '../../events/transport';
|
|
4
4
|
import type { UiEvent, UiEventListenerFn, ProgressEventListenerFn } from '../../events/ui-request';
|
|
5
5
|
import type { UnionToIntersection } from '../utils';
|
|
6
|
-
|
|
6
|
+
type DetailedEvent<Event> = Event extends {
|
|
7
7
|
type: string;
|
|
8
8
|
} ? Event extends {
|
|
9
9
|
payload: any;
|
|
10
10
|
} ? (type: Event['type'], cb: (event: Event['payload']) => any) => void : (type: Event['type'], cb: () => any) => void : never;
|
|
11
|
-
|
|
11
|
+
type EventsUnion = BlockchainEventListenerFn | DetailedEvent<BlockchainEvent> | DeviceEventListenerFn | DetailedEvent<DeviceEvent> | TransportEventListenerFn | DetailedEvent<TransportEvent> | UiEventListenerFn | DetailedEvent<UiEvent> | ProgressEventListenerFn;
|
|
12
12
|
export declare const on: UnionToIntersection<EventsUnion>;
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=on.d.ts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { PROTO } from '../../constants';
|
|
2
2
|
import type { CommonParams, Response } from '../params';
|
|
3
3
|
import type { Proxy } from '../settings';
|
|
4
|
-
export
|
|
4
|
+
export type SetProxy = {
|
|
5
5
|
proxy: Proxy;
|
|
6
|
-
useOnionLinks?: boolean;
|
|
7
6
|
};
|
|
8
7
|
export declare function setProxy(params: CommonParams & SetProxy): Response<PROTO.Success>;
|
|
9
8
|
//# sourceMappingURL=setProxy.d.ts.map
|
|
@@ -124,7 +124,7 @@ export interface StellarInflationOperation {
|
|
|
124
124
|
type: 'inflation';
|
|
125
125
|
source?: string;
|
|
126
126
|
}
|
|
127
|
-
export
|
|
127
|
+
export type StellarOperation = StellarCreateAccountOperation | StellarPaymentOperation | StellarPathPaymentStrictReceiveOperation | StellarPathPaymentStrictSendOperation | StellarPassiveSellOfferOperation | StellarManageSellOfferOperation | StellarManageBuyOfferOperation | StellarSetOptionsOperation | StellarChangeTrustOperation | StellarAllowTrustOperation | StellarAccountMergeOperation | StellarInflationOperation | StellarManageDataOperation | StellarBumpSequenceOperation;
|
|
128
128
|
export interface StellarTransaction {
|
|
129
129
|
source: string;
|
|
130
130
|
fee: number;
|
|
@@ -150,7 +150,7 @@ export interface StellarSignedTx {
|
|
|
150
150
|
publicKey: string;
|
|
151
151
|
signature: string;
|
|
152
152
|
}
|
|
153
|
-
export
|
|
153
|
+
export type StellarOperationMessage = ({
|
|
154
154
|
type: 'StellarCreateAccountOp';
|
|
155
155
|
} & PROTO.StellarCreateAccountOp) | ({
|
|
156
156
|
type: 'StellarPaymentOp';
|
package/lib/types/coinInfo.d.ts
CHANGED
|
@@ -19,8 +19,8 @@ export interface BlockchainLink {
|
|
|
19
19
|
type: string;
|
|
20
20
|
url: string[];
|
|
21
21
|
}
|
|
22
|
-
export
|
|
23
|
-
export
|
|
22
|
+
export type BitcoinDefaultFeesKeys = 'High' | 'Normal' | 'Economy' | 'Low';
|
|
23
|
+
export type BitcoinDefaultFees = {
|
|
24
24
|
[key in BitcoinDefaultFeesKeys]: number;
|
|
25
25
|
};
|
|
26
26
|
interface Common {
|
|
@@ -74,6 +74,6 @@ export interface MiscNetworkInfo extends Common {
|
|
|
74
74
|
defaultFees: BitcoinDefaultFees;
|
|
75
75
|
network: typeof undefined;
|
|
76
76
|
}
|
|
77
|
-
export
|
|
77
|
+
export type CoinInfo = BitcoinNetworkInfo | EthereumNetworkInfo | MiscNetworkInfo;
|
|
78
78
|
export {};
|
|
79
79
|
//# sourceMappingURL=coinInfo.d.ts.map
|
package/lib/types/device.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { PROTO } from '../constants';
|
|
2
2
|
import type { ReleaseInfo } from './firmware';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
3
|
+
export type DeviceStatus = 'available' | 'occupied' | 'used';
|
|
4
|
+
export type DeviceMode = 'normal' | 'bootloader' | 'initialize' | 'seedless';
|
|
5
|
+
export type DeviceFirmwareStatus = 'valid' | 'outdated' | 'required' | 'unknown' | 'none';
|
|
6
|
+
export type UnavailableCapability = 'no-capability' | 'no-support' | 'update-required' | 'trezor-connect-outdated';
|
|
7
|
+
export type FirmwareType = 'bitcoin-only' | 'regular';
|
|
8
|
+
export type UnavailableCapabilities = {
|
|
9
9
|
[key: string]: UnavailableCapability;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type KnownDevice = {
|
|
12
12
|
type: 'acquired';
|
|
13
13
|
id: string | null;
|
|
14
14
|
path: string;
|
|
@@ -23,7 +23,7 @@ export declare type KnownDevice = {
|
|
|
23
23
|
features: PROTO.Features;
|
|
24
24
|
unavailableCapabilities: UnavailableCapabilities;
|
|
25
25
|
};
|
|
26
|
-
export
|
|
26
|
+
export type UnknownDevice = {
|
|
27
27
|
type: 'unacquired';
|
|
28
28
|
id?: null;
|
|
29
29
|
path: string;
|
|
@@ -38,7 +38,7 @@ export declare type UnknownDevice = {
|
|
|
38
38
|
state?: typeof undefined;
|
|
39
39
|
unavailableCapabilities?: typeof undefined;
|
|
40
40
|
};
|
|
41
|
-
export
|
|
41
|
+
export type UnreadableDevice = {
|
|
42
42
|
type: 'unreadable';
|
|
43
43
|
id?: null;
|
|
44
44
|
path: string;
|
|
@@ -53,9 +53,9 @@ export declare type UnreadableDevice = {
|
|
|
53
53
|
state?: typeof undefined;
|
|
54
54
|
unavailableCapabilities?: typeof undefined;
|
|
55
55
|
};
|
|
56
|
-
export
|
|
57
|
-
export
|
|
58
|
-
|
|
56
|
+
export type Device = KnownDevice | UnknownDevice | UnreadableDevice;
|
|
57
|
+
export type Features = PROTO.Features;
|
|
58
|
+
type FeaturesNarrowing = {
|
|
59
59
|
major_version: 2;
|
|
60
60
|
fw_major: null;
|
|
61
61
|
fw_minor: null;
|
|
@@ -91,6 +91,6 @@ declare type FeaturesNarrowing = {
|
|
|
91
91
|
bootloader_mode: true;
|
|
92
92
|
firmware_present: true;
|
|
93
93
|
};
|
|
94
|
-
export
|
|
94
|
+
export type StrictFeatures = Features & FeaturesNarrowing;
|
|
95
95
|
export {};
|
|
96
96
|
//# sourceMappingURL=device.d.ts.map
|
package/lib/types/firmware.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ export interface FirmwareRange {
|
|
|
8
8
|
max: string;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export type VersionArray = [1 | 2, number, number];
|
|
12
|
+
export type FirmwareRelease = {
|
|
13
13
|
required: boolean;
|
|
14
14
|
url: string;
|
|
15
15
|
fingerprint: string;
|
|
@@ -25,7 +25,7 @@ export declare type FirmwareRelease = {
|
|
|
25
25
|
rollout?: number;
|
|
26
26
|
channel?: string;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type ReleaseInfo = {
|
|
29
29
|
changelog: FirmwareRelease[] | null;
|
|
30
30
|
release: FirmwareRelease;
|
|
31
31
|
isLatest: boolean;
|
package/lib/types/params.d.ts
CHANGED
|
@@ -11,13 +11,13 @@ export interface CommonParams {
|
|
|
11
11
|
skipFinalReload?: boolean;
|
|
12
12
|
useCardanoDerivation?: boolean;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type Params<T> = CommonParams & T & {
|
|
15
15
|
bundle?: undefined;
|
|
16
16
|
};
|
|
17
17
|
interface Bundle<T> {
|
|
18
18
|
bundle: T[];
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export type BundledParams<T> = CommonParams & Bundle<T>;
|
|
21
21
|
export interface CommonParamsWithCoin extends CommonParams {
|
|
22
22
|
coin: string;
|
|
23
23
|
}
|
|
@@ -32,7 +32,7 @@ export interface Success<T> {
|
|
|
32
32
|
success: true;
|
|
33
33
|
payload: T;
|
|
34
34
|
}
|
|
35
|
-
export
|
|
35
|
+
export type Response<T> = Promise<Success<T> | Unsuccessful>;
|
|
36
36
|
export interface GetAddress {
|
|
37
37
|
path: string | number[];
|
|
38
38
|
address?: string;
|
package/lib/types/settings.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export interface Manifest {
|
|
|
3
3
|
appUrl: string;
|
|
4
4
|
email: string;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type Proxy = BlockchainSettings['proxy'];
|
|
7
7
|
export interface ConnectSettings {
|
|
8
8
|
manifest?: Manifest;
|
|
9
9
|
connectSrc?: string;
|
|
@@ -29,6 +29,5 @@ export interface ConnectSettings {
|
|
|
29
29
|
env: 'node' | 'web' | 'webextension' | 'electron' | 'react-native';
|
|
30
30
|
timestamp: number;
|
|
31
31
|
proxy?: Proxy;
|
|
32
|
-
useOnionLinks?: boolean;
|
|
33
32
|
}
|
|
34
33
|
//# sourceMappingURL=settings.d.ts.map
|
package/lib/types/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
2
|
+
export type MessageFactoryFn<Group, Event> = UnionToIntersection<Event extends {
|
|
3
3
|
type: string;
|
|
4
4
|
} ? Event extends {
|
|
5
5
|
payload: any;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type BrowserState = {
|
|
2
2
|
name: string;
|
|
3
3
|
osname: string;
|
|
4
4
|
supported: boolean;
|
|
5
5
|
outdated: boolean;
|
|
6
6
|
mobile: boolean;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type SupportedBrowser = {
|
|
9
9
|
version: number;
|
|
10
10
|
download: string;
|
|
11
11
|
update: string;
|
package/lib/utils/debug.d.ts
CHANGED
package/lib/utils/deferred.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Deferred<T, I = any, D = any> = {
|
|
2
2
|
id?: I;
|
|
3
3
|
data?: D;
|
|
4
4
|
promise: Promise<T>;
|
|
5
5
|
resolve: (t: T) => void;
|
|
6
6
|
reject: (e: Error) => void;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type AsyncDeferred<T> = {
|
|
9
9
|
promise: Promise<T>;
|
|
10
10
|
resolve: (t: T) => void;
|
|
11
11
|
reject: (e: Error) => void;
|
package/lib/workers/workers.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import RippleWorker from '@trezor/blockchain-link/lib/workers/ripple';
|
|
|
3
3
|
import BlockfrostWorker from '@trezor/blockchain-link/lib/workers/blockfrost';
|
|
4
4
|
import ElectrumWorker from '@trezor/blockchain-link/lib/workers/electrum';
|
|
5
5
|
import type { Transport } from '@trezor/transport';
|
|
6
|
-
|
|
6
|
+
type TransportWrapper = () => Transport;
|
|
7
7
|
declare const WebUsbPlugin: TransportWrapper | typeof undefined;
|
|
8
8
|
declare const ReactNativeUsbPlugin: TransportWrapper | typeof undefined;
|
|
9
9
|
export { WebUsbPlugin, ReactNativeUsbPlugin, BlockbookWorker, RippleWorker, BlockfrostWorker, ElectrumWorker, };
|
package/package.json
CHANGED
|
@@ -1,81 +1,84 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
2
|
+
"name": "@trezor/connect",
|
|
3
|
+
"version": "9.0.5",
|
|
4
|
+
"author": "Trezor <info@trezor.io>",
|
|
5
|
+
"homepage": "https://github.com/trezor/trezor-suite/tree/develop/packages/connect",
|
|
6
|
+
"description": "High-level javascript interface for Trezor hardware wallet.",
|
|
7
|
+
"npmPublishAccess": "public",
|
|
8
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git://github.com/trezor/trezor-suite.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/trezor/trezor-suite/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"Trezor",
|
|
18
|
+
"trezor-connect",
|
|
19
|
+
"javascript"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"main": "lib/index",
|
|
23
|
+
"browser": {
|
|
24
|
+
"./lib/index": "./lib/index-browser",
|
|
25
|
+
"./lib/utils/assets": "./lib/utils/assets-browser",
|
|
26
|
+
"./lib/workers/workers": "./lib/workers/workers-browser"
|
|
27
|
+
},
|
|
28
|
+
"react-native": {
|
|
29
|
+
"./lib/index": "./lib/index",
|
|
30
|
+
"./lib/workers/workers": "./lib/workers/workers-react-native",
|
|
31
|
+
"./lib/utils/assets": "./lib/utils/assets-native"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"lib/",
|
|
35
|
+
"!**/*.map"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"lint:js": "yarn g:eslint '**/*.{ts,tsx,js}'",
|
|
39
|
+
"test:unit": "jest",
|
|
40
|
+
"type-check": "tsc --build",
|
|
41
|
+
"build:lib": "rimraf ./lib && yarn tsc --build tsconfig.lib.json",
|
|
42
|
+
"version:beta": "tsx scripts/bump-version.ts prerelease",
|
|
43
|
+
"version:patch": "tsx scripts/bump-version.ts patch",
|
|
44
|
+
"version:minor": "tsx scripts/bump-version.ts minor",
|
|
45
|
+
"version:major": "tsx scripts/bump-version.ts major",
|
|
46
|
+
"test:e2e:web": "ts-node -O '{\"module\": \"commonjs\"}' ./e2e/run.ts web",
|
|
47
|
+
"test:e2e:node": "ts-node -O '{\"module\": \"commonjs\"}' ./e2e/run.ts node",
|
|
48
|
+
"prepublishOnly": "yarn tsx ../../scripts/prepublishNPM.js",
|
|
49
|
+
"prepublish": "yarn tsx ../../scripts/prepublish.js"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@trezor/blockchain-link": "^2.1.6",
|
|
53
|
+
"@trezor/connect-common": "0.0.11",
|
|
54
|
+
"@trezor/transport": "^1.1.6",
|
|
55
|
+
"@trezor/utils": "^9.0.4",
|
|
56
|
+
"@trezor/utxo-lib": "^1.0.2",
|
|
57
|
+
"bignumber.js": "^9.1.0",
|
|
58
|
+
"blakejs": "^1.2.1",
|
|
59
|
+
"bowser": "^2.11.0",
|
|
60
|
+
"cross-fetch": "^3.1.5",
|
|
61
|
+
"events": "^3.3.0",
|
|
62
|
+
"parse-uri": "1.0.7",
|
|
63
|
+
"randombytes": "2.1.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@trezor/connect-analytics": "1.0.0",
|
|
67
|
+
"@trezor/trezor-user-env-link": "1.0.0",
|
|
68
|
+
"@types/karma": "^6.3.3",
|
|
69
|
+
"@types/parse-uri": "^1.0.0",
|
|
70
|
+
"@types/randombytes": "^2.0.0",
|
|
71
|
+
"jest": "^26.6.3",
|
|
72
|
+
"karma": "^6.4.1",
|
|
73
|
+
"karma-babel-preprocessor": "^8.0.2",
|
|
74
|
+
"karma-chrome-launcher": "^3.1.1",
|
|
75
|
+
"karma-jasmine": "^5.1.0",
|
|
76
|
+
"karma-jasmine-async": "^0.0.1",
|
|
77
|
+
"karma-sourcemap-loader": "^0.3.8",
|
|
78
|
+
"karma-webpack": "^5.0.0",
|
|
79
|
+
"rimraf": "^3.0.2",
|
|
80
|
+
"ts-node": "^10.9.1",
|
|
81
|
+
"tsx": "^3.8.2",
|
|
82
|
+
"typescript": "4.9.3"
|
|
83
|
+
}
|
|
84
|
+
}
|