@trezor/connect 9.0.3 → 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/authorizeCoinJoin.js +6 -2
- 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/enhanceSignTx.js +1 -1
- package/lib/api/bitcoin/inputs.js +3 -2
- package/lib/api/bitcoin/refTx.js +3 -3
- package/lib/api/bitcoin/signtxVerify.d.ts +1 -1
- package/lib/api/blockchainDisconnect.d.ts +1 -1
- package/lib/api/blockchainDisconnect.js +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/blockchainSetCustomBackend.js +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/cardanoAuxiliaryData.d.ts +1 -1
- package/lib/api/cardano/cardanoAuxiliaryData.js +38 -16
- 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 +2 -1
- package/lib/api/cardanoSignTransaction.js +23 -3
- 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/getOwnershipProof.d.ts +1 -5
- package/lib/api/getOwnershipProof.js +5 -3
- package/lib/api/getPublicKey.d.ts +1 -1
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +3 -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.d.ts +7 -0
- package/lib/api/setBusy.js +31 -0
- package/lib/api/setProxy.js +3 -4
- package/lib/api/signTransaction.d.ts +2 -2
- package/lib/api/signTransaction.js +10 -3
- 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 +21 -0
- package/lib/backend/BackendManager.js +87 -0
- package/lib/backend/Blockchain.d.ts +66 -0
- package/lib/backend/Blockchain.js +189 -0
- package/lib/backend/BlockchainLink.d.ts +6 -71
- package/lib/backend/BlockchainLink.js +12 -288
- package/lib/constants/cardano.d.ts +3 -1
- package/lib/constants/cardano.js +3 -1
- package/lib/constants/network.d.ts +1 -1
- package/lib/core/AbstractMethod.d.ts +5 -4
- package/lib/core/AbstractMethod.js +7 -5
- package/lib/core/index.d.ts +1 -1
- package/lib/core/index.js +3 -1
- package/lib/core/method.d.ts +1 -1
- 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/config.js +1 -1
- 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 +2 -2
- package/lib/device/Device.js +11 -2
- package/lib/device/DeviceCommands.d.ts +8 -7
- package/lib/device/DeviceCommands.js +14 -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/factory.js +1 -0
- package/lib/types/account.d.ts +2 -2
- package/lib/types/api/authorizeCoinJoin.d.ts +1 -0
- package/lib/types/api/binance/index.d.ts +1 -1
- package/lib/types/api/bitcoin/index.d.ts +6 -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 +12 -5
- 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/index.d.ts +2 -0
- 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/setBusy.d.ts +4 -0
- package/lib/types/api/setBusy.js +3 -0
- 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 -78
- package/lib/utils/bufferUtils.d.ts +0 -3
- package/lib/utils/bufferUtils.js +0 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CommonParamsWithCoin, Response } from '../params';
|
|
2
2
|
import type { BlockchainLink } from '../coinInfo';
|
|
3
|
-
export
|
|
3
|
+
export type BlockchainSetCustomBackend = CommonParamsWithCoin & {
|
|
4
4
|
blockchainLink?: BlockchainLink;
|
|
5
5
|
};
|
|
6
6
|
export declare function blockchainSetCustomBackend(params: BlockchainSetCustomBackend): Response<boolean>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SubscriptionAccountInfo, BlockchainLinkResponse } from '@trezor/blockchain-link';
|
|
2
2
|
import type { CommonParamsWithCoin, Response } from '../params';
|
|
3
|
-
export
|
|
3
|
+
export type BlockchainSubscribe = CommonParamsWithCoin & {
|
|
4
4
|
accounts?: SubscriptionAccountInfo[];
|
|
5
5
|
};
|
|
6
6
|
export declare function blockchainSubscribe(params: BlockchainSubscribe): Response<BlockchainLinkResponse<'subscribe'>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BlockchainLinkResponse } from '@trezor/blockchain-link';
|
|
2
2
|
import type { CommonParamsWithCoin, Response } from '../params';
|
|
3
|
-
export
|
|
3
|
+
export type BlockchainSubscribeFiatRates = CommonParamsWithCoin & {
|
|
4
4
|
currency?: string;
|
|
5
5
|
};
|
|
6
6
|
export declare function blockchainSubscribeFiatRates(params: BlockchainSubscribeFiatRates): Response<BlockchainLinkResponse<'subscribe'>>;
|
|
@@ -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;
|
|
@@ -137,15 +137,22 @@ export interface CardanoReferenceInput {
|
|
|
137
137
|
prev_hash: string;
|
|
138
138
|
prev_index: number;
|
|
139
139
|
}
|
|
140
|
-
export interface
|
|
140
|
+
export interface CardanoGovernanceRegistrationDelegation {
|
|
141
141
|
votingPublicKey: string;
|
|
142
|
+
weight: number;
|
|
143
|
+
}
|
|
144
|
+
export interface CardanoGovernanceRegistrationParameters {
|
|
145
|
+
votingPublicKey?: string;
|
|
142
146
|
stakingPath: string | number[];
|
|
143
147
|
rewardAddressParameters: CardanoAddressParameters;
|
|
144
148
|
nonce: string;
|
|
149
|
+
format?: PROTO.CardanoGovernanceRegistrationFormat;
|
|
150
|
+
delegations?: CardanoGovernanceRegistrationDelegation[];
|
|
151
|
+
votingPurpose?: number;
|
|
145
152
|
}
|
|
146
153
|
export interface CardanoAuxiliaryData {
|
|
147
154
|
hash?: string;
|
|
148
|
-
|
|
155
|
+
governanceRegistrationParameters?: CardanoGovernanceRegistrationParameters;
|
|
149
156
|
}
|
|
150
157
|
export interface CardanoSignTransaction {
|
|
151
158
|
inputs: CardanoInput[];
|
|
@@ -179,7 +186,7 @@ export interface CardanoSignedTxWitness {
|
|
|
179
186
|
export interface CardanoAuxiliaryDataSupplement {
|
|
180
187
|
type: PROTO.CardanoTxAuxiliaryDataSupplementType;
|
|
181
188
|
auxiliaryDataHash: string;
|
|
182
|
-
|
|
189
|
+
governanceSignature?: string;
|
|
183
190
|
}
|
|
184
191
|
export interface CardanoSignedTxData {
|
|
185
192
|
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 {};
|
package/lib/types/api/index.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ import { requestLogin } from './requestLogin';
|
|
|
60
60
|
import { resetDevice } from './resetDevice';
|
|
61
61
|
import { rippleGetAddress } from './rippleGetAddress';
|
|
62
62
|
import { rippleSignTransaction } from './rippleSignTransaction';
|
|
63
|
+
import { setBusy } from './setBusy';
|
|
63
64
|
import { setProxy } from './setProxy';
|
|
64
65
|
import { signMessage } from './signMessage';
|
|
65
66
|
import { signTransaction } from './signTransaction';
|
|
@@ -136,6 +137,7 @@ export interface TrezorConnect {
|
|
|
136
137
|
resetDevice: typeof resetDevice;
|
|
137
138
|
rippleGetAddress: typeof rippleGetAddress;
|
|
138
139
|
rippleSignTransaction: typeof rippleSignTransaction;
|
|
140
|
+
setBusy: typeof setBusy;
|
|
139
141
|
setProxy: typeof setProxy;
|
|
140
142
|
signMessage: typeof signMessage;
|
|
141
143
|
signTransaction: typeof signTransaction;
|
|
@@ -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, };
|