@trezor/connect 9.4.7 → 9.4.8-beta.1
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 +55 -8
- package/README.md +1 -1
- package/lib/api/applyFlags.d.ts +1 -1
- package/lib/api/applyFlags.js +1 -1
- package/lib/api/applySettings.d.ts +1 -1
- package/lib/api/authenticateDevice.js +1 -1
- package/lib/api/authorizeCoinjoin.d.ts +1 -1
- package/lib/api/authorizeCoinjoin.js +1 -1
- package/lib/api/backupDevice.d.ts +1 -1
- package/lib/api/backupDevice.js +1 -1
- package/lib/api/binance/api/binanceGetAddress.d.ts +1 -1
- package/lib/api/binance/api/binanceGetAddress.js +3 -3
- package/lib/api/binance/api/binanceGetPublicKey.d.ts +1 -1
- package/lib/api/binance/api/binanceGetPublicKey.js +2 -2
- package/lib/api/binance/api/binanceSignTransaction.js +2 -2
- package/lib/api/binance/binanceSignTx.d.ts +1 -1
- package/lib/api/bitcoin/TransactionComposer.d.ts +1 -1
- package/lib/api/bitcoin/inputs.d.ts +1 -1
- package/lib/api/bitcoin/inputs.js +1 -1
- package/lib/api/bitcoin/outputs.js +2 -2
- package/lib/api/bitcoin/refTx.d.ts +2 -2
- package/lib/api/bitcoin/refTx.js +4 -4
- package/lib/api/bitcoin/signtx.d.ts +2 -2
- package/lib/api/bitcoin/signtxLegacy.d.ts +1 -1
- package/lib/api/bitcoin/signtxVerify.d.ts +1 -1
- package/lib/api/blockchainDisconnect.js +2 -2
- package/lib/api/blockchainEstimateFee.d.ts +1 -1
- package/lib/api/blockchainEstimateFee.js +3 -2
- package/lib/api/blockchainEvmRpcCall.js +2 -2
- package/lib/api/blockchainGetAccountBalanceHistory.d.ts +1 -1
- package/lib/api/blockchainGetAccountBalanceHistory.js +1 -1
- package/lib/api/blockchainGetCurrentFiatRates.d.ts +1 -1
- package/lib/api/blockchainGetCurrentFiatRates.js +1 -1
- package/lib/api/blockchainGetFiatRatesForTimestamps.d.ts +1 -1
- package/lib/api/blockchainGetFiatRatesForTimestamps.js +1 -1
- package/lib/api/blockchainGetInfo.js +1 -1
- package/lib/api/blockchainGetTransactions.js +1 -1
- package/lib/api/blockchainSetCustomBackend.js +1 -1
- package/lib/api/blockchainSubscribe.d.ts +1 -1
- package/lib/api/blockchainSubscribe.js +1 -1
- package/lib/api/blockchainSubscribeFiatRates.d.ts +1 -1
- package/lib/api/blockchainSubscribeFiatRates.js +1 -1
- package/lib/api/blockchainUnsubscribe.d.ts +1 -1
- package/lib/api/blockchainUnsubscribe.js +1 -1
- package/lib/api/blockchainUnsubscribeFiatRates.js +1 -1
- package/lib/api/cancelCoinjoinAuthorization.d.ts +1 -1
- package/lib/api/cardano/api/cardanoComposeTransaction.d.ts +1 -1
- package/lib/api/cardano/api/cardanoComposeTransaction.js +3 -11
- package/lib/api/cardano/api/cardanoGetAddress.d.ts +1 -1
- package/lib/api/cardano/api/cardanoGetAddress.js +4 -4
- package/lib/api/cardano/api/cardanoGetNativeScriptHash.js +2 -2
- package/lib/api/cardano/api/cardanoGetPublicKey.js +2 -2
- package/lib/api/cardano/api/cardanoSignTransaction.d.ts +3 -3
- package/lib/api/cardano/api/cardanoSignTransaction.js +4 -4
- package/lib/api/cardano/cardanoAddressParameters.js +1 -1
- package/lib/api/cardano/cardanoAuxiliaryData.js +1 -1
- package/lib/api/cardano/cardanoCertificate.js +1 -1
- package/lib/api/cardano/cardanoInputs.js +1 -1
- package/lib/api/cardano/cardanoUtils.js +30 -0
- package/lib/api/changePin.d.ts +1 -1
- package/lib/api/changePin.js +1 -1
- package/lib/api/changeWipeCode.d.ts +1 -1
- package/lib/api/cipherKeyValue.d.ts +1 -1
- package/lib/api/cipherKeyValue.js +3 -3
- package/lib/api/common/Discovery.d.ts +2 -2
- package/lib/api/common/paramsValidator.js +1 -1
- package/lib/api/composeTransaction.d.ts +3 -3
- package/lib/api/composeTransaction.js +9 -9
- package/lib/api/eos/api/eosGetPublicKey.d.ts +1 -1
- package/lib/api/eos/api/eosGetPublicKey.js +2 -2
- package/lib/api/eos/api/eosSignTransaction.d.ts +1 -1
- package/lib/api/eos/api/eosSignTransaction.js +2 -2
- package/lib/api/eos/eosSignTx.d.ts +3 -3
- package/lib/api/ethereum/api/ethereumGetAddress.d.ts +3 -3
- package/lib/api/ethereum/api/ethereumGetAddress.js +6 -6
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumGetPublicKey.js +3 -3
- package/lib/api/ethereum/api/ethereumSignMessage.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumSignMessage.js +3 -3
- package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +2 -2
- package/lib/api/ethereum/api/ethereumSignTransaction.js +4 -4
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +2 -1
- package/lib/api/ethereum/api/ethereumSignTypedData.js +6 -6
- package/lib/api/ethereum/api/ethereumVerifyMessage.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumVerifyMessage.js +2 -2
- package/lib/api/ethereum/ethereumDefinitions.d.ts +2 -2
- package/lib/api/ethereum/ethereumDefinitions.js +1 -0
- package/lib/api/firmware/getBinaryForFirmwareUpgrade.js +2 -2
- package/lib/api/firmware/parseFirmwareHeaders.d.ts +2 -1
- package/lib/api/firmware/uploadFirmware.d.ts +1 -1
- package/lib/api/firmware/uploadFirmware.js +1 -1
- package/lib/api/firmware/verifyAuthenticityProof.d.ts +1 -1
- package/lib/api/firmware/verifyEntropy.d.ts +19 -0
- package/lib/api/firmware/verifyEntropy.js +112 -0
- package/lib/api/getAccountDescriptor.js +4 -4
- package/lib/api/getAccountInfo.d.ts +21 -1
- package/lib/api/getAccountInfo.js +7 -7
- package/lib/api/getAddress.d.ts +1 -1
- package/lib/api/getAddress.js +3 -3
- package/lib/api/getCoinInfo.d.ts +3 -0
- package/lib/api/getCoinInfo.js +1 -1
- package/lib/api/getDeviceState.js +1 -1
- package/lib/api/getFirmwareHash.d.ts +1 -1
- package/lib/api/getFirmwareHash.js +1 -1
- package/lib/api/getOwnershipId.d.ts +1 -1
- package/lib/api/getOwnershipId.js +2 -2
- package/lib/api/getOwnershipProof.d.ts +1 -1
- package/lib/api/getOwnershipProof.js +2 -2
- package/lib/api/getPublicKey.d.ts +1 -1
- package/lib/api/getPublicKey.js +4 -4
- package/lib/api/loadDevice.d.ts +1 -1
- package/lib/api/loadDevice.js +1 -1
- package/lib/api/nem/api/nemGetAddress.d.ts +1 -1
- package/lib/api/nem/api/nemGetAddress.js +3 -3
- package/lib/api/nem/api/nemSignTransaction.d.ts +1 -1
- package/lib/api/nem/api/nemSignTransaction.js +2 -2
- package/lib/api/pushTransaction.js +2 -2
- package/lib/api/recoveryDevice.d.ts +1 -1
- package/lib/api/requestLogin.d.ts +1 -1
- package/lib/api/requestLogin.js +2 -2
- package/lib/api/resetDevice.d.ts +3 -1
- package/lib/api/resetDevice.js +58 -3
- package/lib/api/ripple/api/rippleGetAddress.d.ts +1 -1
- package/lib/api/ripple/api/rippleGetAddress.js +3 -3
- package/lib/api/ripple/api/rippleSignTransaction.d.ts +1 -1
- package/lib/api/ripple/api/rippleSignTransaction.js +2 -2
- package/lib/api/setBrightness.d.ts +1 -1
- package/lib/api/setBrightness.js +1 -1
- package/lib/api/setBusy.d.ts +1 -1
- package/lib/api/setBusy.js +1 -1
- package/lib/api/setProxy.js +1 -1
- package/lib/api/showDeviceTutorial.d.ts +1 -1
- package/lib/api/showDeviceTutorial.js +1 -1
- package/lib/api/signMessage.d.ts +1 -1
- package/lib/api/signMessage.js +2 -2
- package/lib/api/signTransaction.d.ts +2 -2
- package/lib/api/signTransaction.js +3 -3
- package/lib/api/solana/api/index.d.ts +1 -0
- package/lib/api/solana/api/index.js +3 -1
- package/lib/api/solana/api/solanaComposeTransaction.d.ts +25 -0
- package/lib/api/solana/api/solanaComposeTransaction.js +61 -0
- package/lib/api/solana/api/solanaGetAddress.js +2 -2
- package/lib/api/solana/api/solanaGetPublicKey.js +2 -2
- package/lib/api/solana/api/solanaSignTransaction.d.ts +9 -1
- package/lib/api/solana/api/solanaSignTransaction.js +20 -2
- package/lib/api/solana/solanaUtils.d.ts +48 -0
- package/lib/api/solana/solanaUtils.js +213 -0
- package/lib/api/stellar/api/stellarGetAddress.d.ts +1 -1
- package/lib/api/stellar/api/stellarGetAddress.js +3 -3
- package/lib/api/stellar/api/stellarSignTransaction.js +3 -3
- package/lib/api/tezos/api/tezosGetAddress.d.ts +1 -1
- package/lib/api/tezos/api/tezosGetAddress.js +3 -3
- package/lib/api/tezos/api/tezosGetPublicKey.d.ts +1 -1
- package/lib/api/tezos/api/tezosGetPublicKey.js +2 -2
- package/lib/api/tezos/api/tezosSignTransaction.d.ts +1 -1
- package/lib/api/tezos/api/tezosSignTransaction.js +2 -2
- package/lib/api/tezos/tezosSignTx.d.ts +17 -17
- package/lib/api/unlockPath.d.ts +1 -1
- package/lib/api/verifyMessage.d.ts +1 -1
- package/lib/api/verifyMessage.js +3 -3
- package/lib/backend/BackendManager.d.ts +1 -1
- package/lib/backend/BackendManager.js +1 -1
- package/lib/backend/Blockchain.d.ts +2 -2
- package/lib/backend/Blockchain.js +4 -7
- package/lib/constants/errors.d.ts +2 -0
- package/lib/constants/errors.js +4 -0
- package/lib/core/AbstractMethod.d.ts +2 -2
- package/lib/core/AbstractMethod.js +2 -1
- package/lib/core/index.d.ts +3 -3
- package/lib/core/index.js +44 -48
- package/lib/core/onCallFirmwareUpdate.d.ts +3 -8
- package/lib/core/onCallFirmwareUpdate.js +63 -21
- package/lib/data/DataManager.js +1 -5
- package/lib/data/coinInfo.d.ts +15 -131
- package/lib/data/coinInfo.js +8 -8
- package/lib/data/config.d.ts +23 -0
- package/lib/data/config.js +4 -0
- package/lib/data/connectSettings.js +1 -1
- package/lib/data/defaultFeeLevels.d.ts +2 -2
- package/lib/data/defaultFeeLevels.js +34 -14
- package/lib/data/deviceAuthenticityConfigTypes.d.ts +1 -0
- package/lib/data/deviceAuthenticityConfigTypes.js +2 -2
- package/lib/data/firmwareInfo.js +1 -1
- package/lib/data/models.js +5 -1
- package/lib/data/transportInfo.d.ts +0 -1
- package/lib/data/transportInfo.js +41 -28
- package/lib/data/udevInfo.d.ts +0 -1
- package/lib/data/udevInfo.js +2 -5
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +11 -10
- package/lib/device/Device.js +39 -17
- package/lib/device/DeviceCommands.d.ts +2 -2
- package/lib/device/DeviceCommands.js +42 -27
- package/lib/device/DeviceList.d.ts +27 -22
- package/lib/device/DeviceList.js +222 -133
- package/lib/device/StateStorage.js +11 -13
- package/lib/device/prompts.js +28 -36
- package/lib/device/resolveDescriptorForTaproot.d.ts +2 -2
- package/lib/device/resolveDescriptorForTaproot.js +5 -13
- package/lib/events/blockchain.d.ts +1 -1
- package/lib/events/call.d.ts +1 -1
- package/lib/events/core.d.ts +3 -3
- package/lib/events/device.d.ts +11 -1
- package/lib/events/device.js +1 -0
- package/lib/events/popup.d.ts +2 -2
- package/lib/events/transport.d.ts +15 -9
- package/lib/events/transport.js +10 -1
- package/lib/events/ui-promise.d.ts +1 -1
- package/lib/events/ui-request.d.ts +3 -3
- package/lib/factory.d.ts +3 -2
- package/lib/factory.js +3 -1
- package/lib/impl/core-in-module.d.ts +4 -2
- package/lib/impl/core-in-module.js +9 -1
- package/lib/impl/dynamic.d.ts +4 -2
- package/lib/impl/dynamic.js +5 -4
- package/lib/index-browser.js +1 -0
- package/lib/index.js +11 -3
- package/lib/types/account.d.ts +1 -1
- package/lib/types/api/authenticateDevice.d.ts +1 -0
- package/lib/types/api/authorizeCoinjoin.d.ts +1 -1
- package/lib/types/api/authorizeCoinjoin.js +1 -1
- package/lib/types/api/binanceGetAddress.d.ts +1 -1
- package/lib/types/api/binanceGetPublicKey.d.ts +1 -1
- package/lib/types/api/blockchainEstimateFee.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/cardanoComposeTransaction.d.ts +112 -6
- package/lib/types/api/cardanoComposeTransaction.js +77 -0
- package/lib/types/api/cardanoGetAddress.d.ts +1 -1
- package/lib/types/api/cardanoGetPublicKey.d.ts +1 -1
- package/lib/types/api/changeLanguage.d.ts +1 -1
- package/lib/types/api/cipherKeyValue.d.ts +1 -1
- package/lib/types/api/composeTransaction.d.ts +1 -1
- package/lib/types/api/eosGetPublicKey.d.ts +1 -1
- package/lib/types/api/ethereumGetAddress.d.ts +1 -1
- package/lib/types/api/ethereumGetPublicKey.d.ts +1 -1
- package/lib/types/api/ethereumSignTypedData.d.ts +1 -1
- package/lib/types/api/firmwareUpdate.d.ts +11 -2
- package/lib/types/api/getAccountDescriptor.d.ts +1 -1
- package/lib/types/api/getAccountInfo.d.ts +1 -1
- package/lib/types/api/getAddress.d.ts +2 -1
- package/lib/types/api/getCoinInfo.d.ts +1 -1
- package/lib/types/api/getDeviceState.d.ts +1 -1
- package/lib/types/api/getFeatures.d.ts +1 -1
- package/lib/types/api/getOwnershipId.d.ts +2 -1
- package/lib/types/api/getOwnershipProof.d.ts +2 -1
- package/lib/types/api/getPublicKey.d.ts +1 -1
- package/lib/types/api/index.d.ts +7 -3
- package/lib/types/api/nem/index.d.ts +1 -1
- package/lib/types/api/nemGetAddress.d.ts +1 -1
- package/lib/types/api/on.d.ts +1 -1
- package/lib/types/api/recoveryDevice.d.ts +1 -1
- package/lib/types/api/rippleGetAddress.d.ts +1 -1
- package/lib/types/api/setTransports.d.ts +4 -0
- package/lib/types/api/setTransports.js +3 -0
- package/lib/types/api/solana/index.d.ts +41 -0
- package/lib/types/api/solana/index.js +31 -1
- package/lib/types/api/solanaComposeTransaction.d.ts +4 -0
- package/lib/types/api/solanaComposeTransaction.js +3 -0
- package/lib/types/api/solanaGetAddress.d.ts +1 -1
- package/lib/types/api/solanaGetPublicKey.d.ts +1 -1
- package/lib/types/api/stellarGetAddress.d.ts +1 -1
- package/lib/types/api/tezosGetAddress.d.ts +1 -1
- package/lib/types/api/tezosGetPublicKey.d.ts +1 -1
- package/lib/types/api/unlockPath.d.ts +1 -1
- package/lib/types/coinInfo.d.ts +33 -0
- package/lib/types/coinInfo.js +8 -2
- package/lib/types/params.d.ts +1 -1
- package/lib/utils/abortablePromise.d.ts +5 -0
- package/lib/utils/abortablePromise.js +17 -0
- package/lib/utils/accountUtils.d.ts +1 -1
- package/lib/utils/accountUtils.js +1 -1
- package/lib/utils/assetUtils.js +1 -2
- package/lib/utils/assets-browser.d.ts +1 -1
- package/lib/utils/assets.js +1 -1
- package/lib/utils/assets.native.d.ts +1 -1
- package/lib/utils/deviceFeaturesUtils.d.ts +1 -1
- package/lib/utils/deviceFeaturesUtils.js +6 -12
- package/lib/utils/ethereumUtils.d.ts +3 -2
- package/lib/utils/firmwareUtils.d.ts +1 -1
- package/lib/utils/firmwareUtils.js +11 -4
- package/lib/utils/pathUtils.d.ts +1 -1
- package/lib/utils/urlUtils.js +2 -0
- package/lib/workers/workers-browser.d.ts +2 -2
- package/lib/workers/workers-browser.js +2 -2
- package/lib/workers/workers.native.d.ts +1 -1
- package/lib/workers/workers.native.js +2 -2
- package/package.json +22 -12
- package/lib/utils/promiseUtils.d.ts +0 -5
- package/lib/utils/promiseUtils.js +0 -14
package/lib/events/core.d.ts
CHANGED
|
@@ -3,13 +3,13 @@ import type { IFrameCallMessage, MethodResponseMessage } from './call';
|
|
|
3
3
|
import type { DeviceEventMessage } from './device';
|
|
4
4
|
import type { IFrameEventMessage, IFrameInit, IFrameLogRequest } from './iframe';
|
|
5
5
|
import type { PopupAnalyticsResponse, PopupClosedMessage, PopupEventMessage } from './popup';
|
|
6
|
-
import type { TransportEventMessage,
|
|
6
|
+
import type { TransportDisableWebUSB, TransportEventMessage, TransportGetInfo, TransportRequestWebUSBDevice, TransportSetTransports } from './transport';
|
|
7
7
|
import type { UiEventMessage } from './ui-request';
|
|
8
8
|
import type { UiResponseEvent } from './ui-response';
|
|
9
|
-
import type { Unsuccessful } from '../types/params';
|
|
10
9
|
import { ErrorCode, TrezorError } from '../constants/errors';
|
|
10
|
+
import type { Unsuccessful } from '../types/params';
|
|
11
11
|
export declare const CORE_EVENT = "CORE_EVENT";
|
|
12
|
-
export type CoreRequestMessage = PopupClosedMessage | PopupAnalyticsResponse | TransportDisableWebUSB | TransportRequestWebUSBDevice | TransportGetInfo | UiResponseEvent | IFrameInit | IFrameCallMessage | IFrameLogRequest;
|
|
12
|
+
export type CoreRequestMessage = PopupClosedMessage | PopupAnalyticsResponse | TransportDisableWebUSB | TransportSetTransports | TransportRequestWebUSBDevice | TransportGetInfo | UiResponseEvent | IFrameInit | IFrameCallMessage | IFrameLogRequest;
|
|
13
13
|
export type CoreEventMessage = {
|
|
14
14
|
success?: boolean;
|
|
15
15
|
channel?: {
|
package/lib/events/device.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PROTO } from '../constants';
|
|
2
2
|
import type { Device } from '../types/device';
|
|
3
|
+
import type { VersionArray } from '../types/firmware';
|
|
3
4
|
import type { MessageFactoryFn } from '../types/utils';
|
|
4
5
|
export declare const DEVICE_EVENT = "DEVICE_EVENT";
|
|
5
6
|
export declare const DEVICE: {
|
|
@@ -7,6 +8,7 @@ export declare const DEVICE: {
|
|
|
7
8
|
readonly CONNECT_UNACQUIRED: "device-connect_unacquired";
|
|
8
9
|
readonly DISCONNECT: "device-disconnect";
|
|
9
10
|
readonly CHANGED: "device-changed";
|
|
11
|
+
readonly FIRMWARE_VERSION_CHANGED: "device-firmware_version_changed";
|
|
10
12
|
readonly BUTTON: "button";
|
|
11
13
|
readonly PIN: "pin";
|
|
12
14
|
readonly PASSPHRASE: "passphrase";
|
|
@@ -22,10 +24,18 @@ export interface DeviceButtonRequest {
|
|
|
22
24
|
device: Device;
|
|
23
25
|
};
|
|
24
26
|
}
|
|
27
|
+
export interface DeviceVersionChanged {
|
|
28
|
+
type: typeof DEVICE.FIRMWARE_VERSION_CHANGED;
|
|
29
|
+
payload: {
|
|
30
|
+
device: Device;
|
|
31
|
+
oldVersion: VersionArray;
|
|
32
|
+
newVersion: VersionArray;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
25
35
|
export type DeviceEvent = {
|
|
26
36
|
type: typeof DEVICE.CONNECT | typeof DEVICE.CONNECT_UNACQUIRED | typeof DEVICE.CHANGED | typeof DEVICE.DISCONNECT;
|
|
27
37
|
payload: Device;
|
|
28
|
-
} | DeviceButtonRequest;
|
|
38
|
+
} | DeviceButtonRequest | DeviceVersionChanged;
|
|
29
39
|
export type DeviceEventMessage = DeviceEvent & {
|
|
30
40
|
event: typeof DEVICE_EVENT;
|
|
31
41
|
};
|
package/lib/events/device.js
CHANGED
package/lib/events/popup.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UI_EVENT } from './ui-request';
|
|
2
1
|
import type { TransportInfo } from './transport';
|
|
2
|
+
import { UI_EVENT } from './ui-request';
|
|
3
3
|
import type { ConnectSettings, SystemInfo } from '../types';
|
|
4
4
|
import type { MessageFactoryFn } from '../types/utils';
|
|
5
5
|
export declare const POPUP: {
|
|
@@ -30,7 +30,7 @@ export interface PopupHandshake {
|
|
|
30
30
|
type: typeof POPUP.HANDSHAKE;
|
|
31
31
|
payload: {
|
|
32
32
|
settings: ConnectSettings;
|
|
33
|
-
|
|
33
|
+
transports?: TransportInfo[];
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
export interface PopupError {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Transport } from '@trezor/transport';
|
|
2
2
|
import { TRANSPORT } from '@trezor/transport/lib/constants';
|
|
3
|
+
import { ConnectSettings } from '../exports';
|
|
3
4
|
import type { MessageFactoryFn } from '../types/utils';
|
|
4
5
|
export { TRANSPORT } from '@trezor/transport/lib/constants';
|
|
5
6
|
export declare const TRANSPORT_EVENT = "TRANSPORT_EVENT";
|
|
6
7
|
export interface BridgeInfo {
|
|
7
8
|
version: number[];
|
|
8
|
-
directory: string;
|
|
9
9
|
packages: {
|
|
10
10
|
name: string;
|
|
11
11
|
platform: string[];
|
|
@@ -16,7 +16,6 @@ export interface BridgeInfo {
|
|
|
16
16
|
changelog: string;
|
|
17
17
|
}
|
|
18
18
|
export interface UdevInfo {
|
|
19
|
-
directory: string;
|
|
20
19
|
packages: {
|
|
21
20
|
name: string;
|
|
22
21
|
platform: string[];
|
|
@@ -26,24 +25,31 @@ export interface UdevInfo {
|
|
|
26
25
|
}[];
|
|
27
26
|
}
|
|
28
27
|
export interface TransportInfo {
|
|
28
|
+
apiType: Transport['apiType'];
|
|
29
29
|
type: Transport['name'];
|
|
30
30
|
version: string;
|
|
31
31
|
outdated: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface TransportError {
|
|
34
|
+
apiType?: Transport['apiType'];
|
|
35
|
+
error: string;
|
|
36
|
+
code?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface InstallerInfo {
|
|
32
39
|
bridge?: BridgeInfo;
|
|
33
40
|
udev?: UdevInfo;
|
|
34
41
|
}
|
|
35
42
|
export type TransportEvent = {
|
|
36
43
|
type: typeof TRANSPORT.START;
|
|
37
|
-
payload: TransportInfo;
|
|
44
|
+
payload: TransportInfo & InstallerInfo;
|
|
38
45
|
} | {
|
|
39
46
|
type: typeof TRANSPORT.ERROR;
|
|
40
|
-
payload:
|
|
41
|
-
error: string;
|
|
42
|
-
code?: string;
|
|
43
|
-
bridge?: BridgeInfo;
|
|
44
|
-
udev?: UdevInfo;
|
|
45
|
-
};
|
|
47
|
+
payload: TransportError & InstallerInfo;
|
|
46
48
|
};
|
|
49
|
+
export interface TransportSetTransports {
|
|
50
|
+
type: typeof TRANSPORT.SET_TRANSPORTS;
|
|
51
|
+
payload: Pick<ConnectSettings, 'transports'>;
|
|
52
|
+
}
|
|
47
53
|
export interface TransportDisableWebUSB {
|
|
48
54
|
type: typeof TRANSPORT.DISABLE_WEBUSB;
|
|
49
55
|
payload?: undefined;
|
package/lib/events/transport.js
CHANGED
|
@@ -2,13 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createTransportMessage = exports.TRANSPORT_EVENT = exports.TRANSPORT = void 0;
|
|
4
4
|
const errors_1 = require("../constants/errors");
|
|
5
|
+
const transportInfo_1 = require("../data/transportInfo");
|
|
6
|
+
const udevInfo_1 = require("../data/udevInfo");
|
|
5
7
|
var constants_1 = require("@trezor/transport/lib/constants");
|
|
6
8
|
Object.defineProperty(exports, "TRANSPORT", { enumerable: true, get: function () { return constants_1.TRANSPORT; } });
|
|
7
9
|
exports.TRANSPORT_EVENT = 'TRANSPORT_EVENT';
|
|
8
10
|
const createTransportMessage = (type, payload) => ({
|
|
9
11
|
event: exports.TRANSPORT_EVENT,
|
|
10
12
|
type,
|
|
11
|
-
payload: 'error' in payload
|
|
13
|
+
payload: 'error' in payload
|
|
14
|
+
? (0, errors_1.serializeError)(payload)
|
|
15
|
+
:
|
|
16
|
+
{
|
|
17
|
+
...payload,
|
|
18
|
+
udev: (0, udevInfo_1.suggestUdevInstaller)(),
|
|
19
|
+
bridge: (0, transportInfo_1.suggestBridgeInstaller)(),
|
|
20
|
+
},
|
|
12
21
|
});
|
|
13
22
|
exports.createTransportMessage = createTransportMessage;
|
|
14
23
|
//# sourceMappingURL=transport.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Deferred } from '@trezor/utils';
|
|
2
2
|
import type { DEVICE } from './device';
|
|
3
|
-
import type { Device } from '../device/Device';
|
|
4
3
|
import type { UiResponseEvent } from './ui-response';
|
|
4
|
+
import type { Device } from '../device/Device';
|
|
5
5
|
export type UiPromiseResponse = UiResponseEvent | {
|
|
6
6
|
type: typeof DEVICE.DISCONNECT;
|
|
7
7
|
payload?: undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { EventTypeDeviceSelected } from '@trezor/connect-analytics';
|
|
2
2
|
import type { PROTO } from '../constants';
|
|
3
|
-
import type {
|
|
4
|
-
import type { DiscoveryAccountType, DiscoveryAccount } from '../types/account';
|
|
5
|
-
import type { MessageFactoryFn } from '../types/utils';
|
|
3
|
+
import type { BitcoinNetworkInfo, CoinInfo, Device, SelectFeeLevel } from '../types';
|
|
6
4
|
import type { DeviceButtonRequest } from './device';
|
|
7
5
|
import { MethodPermission } from '../core/AbstractMethod';
|
|
6
|
+
import type { DiscoveryAccount, DiscoveryAccountType } from '../types/account';
|
|
7
|
+
import type { MessageFactoryFn } from '../types/utils';
|
|
8
8
|
export declare const UI_EVENT = "UI_EVENT";
|
|
9
9
|
export declare const UI_REQUEST: {
|
|
10
10
|
readonly TRANSPORT: "ui-no_transport";
|
package/lib/factory.d.ts
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import type { EventEmitter } from 'events';
|
|
2
|
-
import type { TrezorConnect } from './types';
|
|
3
2
|
import type { CallMethod } from './events/call';
|
|
3
|
+
import type { TrezorConnect } from './types';
|
|
4
4
|
import type { InitType } from './types/api/init';
|
|
5
5
|
export interface ConnectFactoryDependencies<SettingsType extends Record<string, any>> {
|
|
6
6
|
init: InitType<SettingsType>;
|
|
7
7
|
call: CallMethod;
|
|
8
8
|
eventEmitter: EventEmitter;
|
|
9
9
|
manifest: TrezorConnect['manifest'];
|
|
10
|
+
setTransports: TrezorConnect['setTransports'];
|
|
10
11
|
requestLogin: TrezorConnect['requestLogin'];
|
|
11
12
|
uiResponse: TrezorConnect['uiResponse'];
|
|
12
13
|
cancel: TrezorConnect['cancel'];
|
|
13
14
|
dispose: TrezorConnect['dispose'];
|
|
14
15
|
}
|
|
15
|
-
export declare const factory: <SettingsType extends Record<string, any>, ExtraMethodsType extends Record<string, any>>({ eventEmitter, manifest, init, call, requestLogin, uiResponse, cancel, dispose, }: ConnectFactoryDependencies<SettingsType>, extraMethods?: ExtraMethodsType) => Omit<TrezorConnect, "init"> & {
|
|
16
|
+
export declare const factory: <SettingsType extends Record<string, any>, ExtraMethodsType extends Record<string, any>>({ eventEmitter, manifest, init, call, setTransports, requestLogin, uiResponse, cancel, dispose, }: ConnectFactoryDependencies<SettingsType>, extraMethods?: ExtraMethodsType) => Omit<TrezorConnect, "init"> & {
|
|
16
17
|
init: InitType<SettingsType>;
|
|
17
18
|
} & ExtraMethodsType;
|
|
18
19
|
//# sourceMappingURL=factory.d.ts.map
|
package/lib/factory.js
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.factory = void 0;
|
|
4
4
|
const events_1 = require("./events");
|
|
5
|
-
const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse, cancel, dispose, }, extraMethods = {}) => ({
|
|
5
|
+
const factory = ({ eventEmitter, manifest, init, call, setTransports, requestLogin, uiResponse, cancel, dispose, }, extraMethods = {}) => ({
|
|
6
6
|
manifest,
|
|
7
7
|
init,
|
|
8
|
+
setTransports,
|
|
8
9
|
on: (type, fn) => {
|
|
9
10
|
eventEmitter.on(type, fn);
|
|
10
11
|
},
|
|
@@ -83,6 +84,7 @@ const factory = ({ eventEmitter, manifest, init, call, requestLogin, uiResponse,
|
|
|
83
84
|
rippleSignTransaction: params => call({ ...params, method: 'rippleSignTransaction' }),
|
|
84
85
|
signMessage: params => call({ ...params, method: 'signMessage' }),
|
|
85
86
|
signTransaction: params => call({ ...params, method: 'signTransaction' }),
|
|
87
|
+
solanaComposeTransaction: params => call({ ...params, method: 'solanaComposeTransaction' }),
|
|
86
88
|
solanaGetPublicKey: params => call({ ...params, method: 'solanaGetPublicKey' }),
|
|
87
89
|
solanaGetAddress: params => call({ ...params, method: 'solanaGetAddress' }),
|
|
88
90
|
solanaSignTransaction: params => call({ ...params, method: 'solanaSignTransaction' }),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import EventEmitter from 'events';
|
|
2
|
-
import {
|
|
3
|
-
import type { ConnectSettings, ConnectSettingsPublic, DeviceIdentity, Manifest } from '../types';
|
|
2
|
+
import { CallMethodPayload, CoreEventMessage, CoreRequestMessage, UiResponseEvent } from '../events';
|
|
4
3
|
import { ConnectFactoryDependencies } from '../factory';
|
|
4
|
+
import type { ConnectSettings, ConnectSettingsPublic, DeviceIdentity, Manifest } from '../types';
|
|
5
|
+
import type { SetTransports } from '../types/api/setTransports';
|
|
5
6
|
export declare class CoreInModule implements ConnectFactoryDependencies<ConnectSettingsPublic> {
|
|
6
7
|
eventEmitter: EventEmitter<[never]>;
|
|
7
8
|
_settings: ConnectSettings;
|
|
@@ -18,6 +19,7 @@ export declare class CoreInModule implements ConnectFactoryDependencies<ConnectS
|
|
|
18
19
|
handleCoreMessage(message: CoreRequestMessage): void;
|
|
19
20
|
private onCoreEvent;
|
|
20
21
|
init(settings?: Partial<ConnectSettings>): Promise<void>;
|
|
22
|
+
setTransports({ transports }: SetTransports): void;
|
|
21
23
|
private initSettings;
|
|
22
24
|
initCore(): any;
|
|
23
25
|
call(params: CallMethodPayload): Promise<import("../types").Unsuccessful | {
|
|
@@ -5,10 +5,10 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const events_1 = tslib_1.__importDefault(require("events"));
|
|
6
6
|
const utils_1 = require("@trezor/utils");
|
|
7
7
|
const ERRORS = tslib_1.__importStar(require("../constants/errors"));
|
|
8
|
+
const connectSettings_1 = require("../data/connectSettings");
|
|
8
9
|
const events_2 = require("../events");
|
|
9
10
|
const factory_1 = require("../factory");
|
|
10
11
|
const debug_1 = require("../utils/debug");
|
|
11
|
-
const connectSettings_1 = require("../data/connectSettings");
|
|
12
12
|
class CoreInModule {
|
|
13
13
|
constructor(onCoreHook) {
|
|
14
14
|
this.eventEmitter = new events_1.default();
|
|
@@ -144,6 +144,13 @@ class CoreInModule {
|
|
|
144
144
|
}
|
|
145
145
|
this._log.enabled = !!this._settings.debug;
|
|
146
146
|
}
|
|
147
|
+
setTransports({ transports }) {
|
|
148
|
+
this._settings = (0, connectSettings_1.parseConnectSettings)({ ...this._settings, transports });
|
|
149
|
+
this.handleCoreMessage({
|
|
150
|
+
type: events_2.TRANSPORT.SET_TRANSPORTS,
|
|
151
|
+
payload: { transports },
|
|
152
|
+
});
|
|
153
|
+
}
|
|
147
154
|
initCore() {
|
|
148
155
|
this.initSettings({ lazyLoad: false });
|
|
149
156
|
return this._coreManager.getOrInit(this._settings, this.boundOnCoreEvent);
|
|
@@ -214,6 +221,7 @@ exports.TrezorConnect = (0, factory_1.factory)({
|
|
|
214
221
|
manifest: impl.manifest.bind(impl),
|
|
215
222
|
init: impl.init.bind(impl),
|
|
216
223
|
call: impl.call.bind(impl),
|
|
224
|
+
setTransports: impl.setTransports.bind(impl),
|
|
217
225
|
requestLogin: impl.requestLogin.bind(impl),
|
|
218
226
|
uiResponse: impl.uiResponse.bind(impl),
|
|
219
227
|
cancel: impl.cancel.bind(impl),
|
package/lib/impl/dynamic.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import EventEmitter from 'events';
|
|
2
|
-
import { ConnectFactoryDependencies } from '../factory';
|
|
3
|
-
import type { Manifest } from '../types/settings';
|
|
4
2
|
import { CallMethodPayload } from '../events';
|
|
3
|
+
import { ConnectFactoryDependencies } from '../factory';
|
|
5
4
|
import { InitFullSettings } from '../types/api/init';
|
|
5
|
+
import type { SetTransports } from '../types/api/setTransports';
|
|
6
|
+
import type { Manifest } from '../types/settings';
|
|
6
7
|
type TrezorConnectDynamicParams<ImplType, SettingsType extends Record<string, any>, ImplInterface extends ConnectFactoryDependencies<SettingsType>> = {
|
|
7
8
|
implementations: {
|
|
8
9
|
type: ImplType;
|
|
@@ -23,6 +24,7 @@ export declare class TrezorConnectDynamic<ImplType, SettingsType extends Record<
|
|
|
23
24
|
switchTarget(target: ImplType): Promise<void>;
|
|
24
25
|
manifest(manifest: Manifest): void;
|
|
25
26
|
init(settings: InitFullSettings<SettingsType>): Promise<void>;
|
|
27
|
+
setTransports({ transports }: SetTransports): void;
|
|
26
28
|
call(params: CallMethodPayload): Promise<any>;
|
|
27
29
|
requestLogin(params: any): import("..").Response<import("../types/api/requestLogin").Login>;
|
|
28
30
|
uiResponse(params: any): void;
|
package/lib/impl/dynamic.js
CHANGED
|
@@ -26,10 +26,7 @@ class TrezorConnectDynamic {
|
|
|
26
26
|
await this.getTarget().init(this.lastSettings);
|
|
27
27
|
}
|
|
28
28
|
manifest(manifest) {
|
|
29
|
-
this.lastSettings = {
|
|
30
|
-
...this.lastSettings,
|
|
31
|
-
manifest,
|
|
32
|
-
};
|
|
29
|
+
this.lastSettings = { ...this.lastSettings, manifest };
|
|
33
30
|
this.getTarget().manifest(manifest);
|
|
34
31
|
}
|
|
35
32
|
async init(settings) {
|
|
@@ -48,6 +45,10 @@ class TrezorConnectDynamic {
|
|
|
48
45
|
throw error;
|
|
49
46
|
}
|
|
50
47
|
}
|
|
48
|
+
setTransports({ transports }) {
|
|
49
|
+
this.lastSettings = { ...this.lastSettings, transports };
|
|
50
|
+
this.getTarget().setTransports({ transports });
|
|
51
|
+
}
|
|
51
52
|
async call(params) {
|
|
52
53
|
const response = await this.getTarget().call(params);
|
|
53
54
|
if (!response.success) {
|
package/lib/index-browser.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -4,12 +4,12 @@ exports.eventEmitter = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const events_1 = tslib_1.__importDefault(require("events"));
|
|
6
6
|
const utils_1 = require("@trezor/utils");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
7
8
|
const core_1 = require("./core");
|
|
8
|
-
const factory_1 = require("./factory");
|
|
9
9
|
const connectSettings_1 = require("./data/connectSettings");
|
|
10
|
-
const debug_1 = require("./utils/debug");
|
|
11
10
|
const events_2 = require("./events");
|
|
12
|
-
const
|
|
11
|
+
const factory_1 = require("./factory");
|
|
12
|
+
const debug_1 = require("./utils/debug");
|
|
13
13
|
exports.eventEmitter = new events_1.default();
|
|
14
14
|
const _log = (0, debug_1.initLog)('@trezor/connect');
|
|
15
15
|
let _settings = (0, connectSettings_1.parseConnectSettings)();
|
|
@@ -111,6 +111,13 @@ const call = async (params) => {
|
|
|
111
111
|
return (0, events_2.createErrorMessage)(error);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
|
+
const setTransports = (payload) => {
|
|
115
|
+
const core = coreManager.get();
|
|
116
|
+
if (!core) {
|
|
117
|
+
throw constants_1.ERRORS.TypedError('Init_NotInitialized');
|
|
118
|
+
}
|
|
119
|
+
core.handleMessage({ type: events_2.TRANSPORT.SET_TRANSPORTS, payload });
|
|
120
|
+
};
|
|
114
121
|
const uiResponse = (response) => {
|
|
115
122
|
const core = coreManager.get();
|
|
116
123
|
if (!core) {
|
|
@@ -167,6 +174,7 @@ const TrezorConnect = (0, factory_1.factory)({
|
|
|
167
174
|
manifest,
|
|
168
175
|
init,
|
|
169
176
|
call,
|
|
177
|
+
setTransports,
|
|
170
178
|
requestLogin,
|
|
171
179
|
uiResponse,
|
|
172
180
|
cancel,
|
package/lib/types/account.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccountInfo as AccountInfoBase,
|
|
1
|
+
import type { AccountAddresses, AccountInfo as AccountInfoBase, Utxo as AccountUtxo } from '@trezor/blockchain-link';
|
|
2
2
|
export type { AccountAddresses, Utxo as AccountUtxo, Address as AccountAddress, Transaction as AccountTransaction, } from '@trezor/blockchain-link';
|
|
3
3
|
export type DiscoveryAccountType = 'p2pkh' | 'p2sh' | 'p2tr' | 'p2wpkh';
|
|
4
4
|
export interface AccountInfo extends AccountInfoBase {
|
|
@@ -42,6 +42,7 @@ export declare const AuthenticateDeviceParams: import("@trezor/schema-utils").TO
|
|
|
42
42
|
}>, import("@trezor/schema-utils").TObject<{
|
|
43
43
|
T1B1: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
|
|
44
44
|
T2T1: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
|
|
45
|
+
UNKNOWN: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUndefined>;
|
|
45
46
|
}>]>, import("@trezor/schema-utils").TObject<{
|
|
46
47
|
version: import("@trezor/schema-utils").TNumber;
|
|
47
48
|
timestamp: import("@trezor/schema-utils").TString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Static } from '@trezor/schema-utils';
|
|
2
|
-
import type { Params, Response } from '../params';
|
|
3
2
|
import { PROTO } from '../../constants';
|
|
3
|
+
import type { Params, Response } from '../params';
|
|
4
4
|
export type AuthorizeCoinjoin = Static<typeof AuthorizeCoinjoin>;
|
|
5
5
|
export declare const AuthorizeCoinjoin: import("@trezor/schema-utils").TObject<{
|
|
6
6
|
path: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TNumber>]>;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AuthorizeCoinjoin = void 0;
|
|
4
4
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
5
|
-
const params_1 = require("../params");
|
|
6
5
|
const constants_1 = require("../../constants");
|
|
6
|
+
const params_1 = require("../params");
|
|
7
7
|
exports.AuthorizeCoinjoin = schema_utils_1.Type.Object({
|
|
8
8
|
path: params_1.DerivationPath,
|
|
9
9
|
coordinator: schema_utils_1.Type.String(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Address, BundledParams, GetAddress, Params, Response } from '../params';
|
|
2
2
|
export declare function binanceGetAddress(params: Params<GetAddress>): Response<Address>;
|
|
3
3
|
export declare function binanceGetAddress(params: BundledParams<GetAddress>): Response<Address[]>;
|
|
4
4
|
//# sourceMappingURL=binanceGetAddress.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundledParams, GetPublicKey, Params, PublicKey, Response } from '../params';
|
|
2
2
|
export declare function binanceGetPublicKey(params: Params<GetPublicKey>): Response<PublicKey>;
|
|
3
3
|
export declare function binanceGetPublicKey(params: BundledParams<GetPublicKey>): Response<PublicKey[]>;
|
|
4
4
|
//# sourceMappingURL=binanceGetPublicKey.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BlockchainLinkParams, BlockchainLinkResponse } from '@trezor/blockchain-link';
|
|
2
|
-
import type {
|
|
2
|
+
import type { FeeInfo, FeeLevel } from '../fees';
|
|
3
3
|
import type { CommonParamsWithCoin, Response } from '../params';
|
|
4
4
|
export interface BlockchainEstimateFee {
|
|
5
5
|
request?: BlockchainLinkParams<'estimateFee'> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CommonParams, Response } from '../params';
|
|
2
1
|
import type { BlockchainLink } from '../coinInfo';
|
|
2
|
+
import type { CommonParams, Response } from '../params';
|
|
3
3
|
export type BlockchainSetCustomBackend = CommonParams & {
|
|
4
4
|
coin: string;
|
|
5
5
|
blockchainLink?: BlockchainLink;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BlockchainLinkResponse, SubscriptionAccountInfo } from '@trezor/blockchain-link';
|
|
2
2
|
import type { CommonParamsWithCoin, Response } from '../params';
|
|
3
3
|
export type BlockchainSubscribe = CommonParamsWithCoin & {
|
|
4
4
|
blocks?: boolean;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import type {
|
|
5
|
-
import
|
|
1
|
+
import type { trezorUtils, types } from '@fivebinaries/coin-selection';
|
|
2
|
+
import { Static } from '@trezor/schema-utils';
|
|
3
|
+
import { PROTO } from '../../exports';
|
|
4
|
+
import type { AccountUtxo } from '../../exports';
|
|
5
|
+
import { type Params, type Response } from '../params';
|
|
6
|
+
import { CardanoCertificate } from './cardano';
|
|
7
|
+
import type { CardanoInput, CardanoOutput } from './cardano';
|
|
8
|
+
import type { PrecomposeResultError, PrecomposeResultFinal, PrecomposeResultNonFinal } from './composeTransaction';
|
|
6
9
|
export type PrecomposedTransactionFinalCardano = Omit<PrecomposeResultFinal, 'inputs' | 'outputs' | 'outputsPermutation'> & {
|
|
7
10
|
deposit?: string;
|
|
8
11
|
ttl?: number;
|
|
@@ -21,10 +24,17 @@ export type PrecomposedTransactionErrorCardano = PrecomposeResultError | {
|
|
|
21
24
|
error: 'UTXO_BALANCE_INSUFFICIENT' | 'UTXO_VALUE_TOO_SMALL';
|
|
22
25
|
};
|
|
23
26
|
export type PrecomposedTransactionCardano = PrecomposedTransactionFinalCardano | PrecomposedTransactionNonFinalCardano | PrecomposedTransactionErrorCardano;
|
|
27
|
+
export declare const AccountAddress: import("@trezor/schema-utils").TObject<{
|
|
28
|
+
address: import("@trezor/schema-utils").TString;
|
|
29
|
+
path: import("@trezor/schema-utils").TString;
|
|
30
|
+
transfers: import("@trezor/schema-utils").TNumber;
|
|
31
|
+
balance: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
32
|
+
sent: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
33
|
+
received: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
34
|
+
}>;
|
|
24
35
|
export type CardanoComposeTransactionParams = {
|
|
25
36
|
account: {
|
|
26
37
|
descriptor: string;
|
|
27
|
-
addresses: AccountAddresses;
|
|
28
38
|
utxo: AccountUtxo[];
|
|
29
39
|
};
|
|
30
40
|
feeLevels?: {
|
|
@@ -40,5 +50,101 @@ export type CardanoComposeTransactionParams = {
|
|
|
40
50
|
addressParameters: Parameters<(typeof trezorUtils)['transformToTrezorOutputs']>[1];
|
|
41
51
|
testnet?: boolean;
|
|
42
52
|
};
|
|
53
|
+
export type CardanoComposeTransactionParamsSchema = Static<typeof CardanoComposeTransactionParamsSchema>;
|
|
54
|
+
export declare const CardanoComposeTransactionParamsSchema: import("@trezor/schema-utils").TObject<{
|
|
55
|
+
account: import("@trezor/schema-utils").TObject<{
|
|
56
|
+
descriptor: import("@trezor/schema-utils").TString;
|
|
57
|
+
utxo: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
58
|
+
txid: import("@trezor/schema-utils").TString;
|
|
59
|
+
vout: import("@trezor/schema-utils").TNumber;
|
|
60
|
+
amount: import("@trezor/schema-utils").TString;
|
|
61
|
+
blockHeight: import("@trezor/schema-utils").TNumber;
|
|
62
|
+
address: import("@trezor/schema-utils").TString;
|
|
63
|
+
path: import("@trezor/schema-utils").TString;
|
|
64
|
+
confirmations: import("@trezor/schema-utils").TNumber;
|
|
65
|
+
coinbase: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
|
|
66
|
+
cardanoSpecific: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
67
|
+
unit: import("@trezor/schema-utils").TString;
|
|
68
|
+
}>>;
|
|
69
|
+
}>>;
|
|
70
|
+
}>;
|
|
71
|
+
feeLevels: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
72
|
+
feePerUnit: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
73
|
+
}>>>;
|
|
74
|
+
outputs: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TIntersect<[import("@trezor/schema-utils").TObject<{
|
|
75
|
+
isChange: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
|
|
76
|
+
assets: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
77
|
+
unit: import("@trezor/schema-utils").TString;
|
|
78
|
+
quantity: import("@trezor/schema-utils").TString;
|
|
79
|
+
}>>;
|
|
80
|
+
}>, import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TObject<{
|
|
81
|
+
address: import("@trezor/schema-utils").TString;
|
|
82
|
+
amount: import("@trezor/schema-utils").TString;
|
|
83
|
+
setMax: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TLiteral<false>>;
|
|
84
|
+
}>, import("@trezor/schema-utils").TObject<{
|
|
85
|
+
address: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
86
|
+
amount: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
87
|
+
setMax: import("@trezor/schema-utils").TBoolean;
|
|
88
|
+
}>]>]>>>;
|
|
89
|
+
certificates: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
90
|
+
type: import("@trezor/schema-utils").TEnum<typeof PROTO.CardanoCertificateType>;
|
|
91
|
+
path: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TNumber>]>>;
|
|
92
|
+
pool: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
93
|
+
poolParameters: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
94
|
+
poolId: import("@trezor/schema-utils").TString;
|
|
95
|
+
vrfKeyHash: import("@trezor/schema-utils").TString;
|
|
96
|
+
pledge: import("@trezor/schema-utils").TString;
|
|
97
|
+
cost: import("@trezor/schema-utils").TString;
|
|
98
|
+
margin: import("@trezor/schema-utils").TObject<{
|
|
99
|
+
numerator: import("@trezor/schema-utils").TString;
|
|
100
|
+
denominator: import("@trezor/schema-utils").TString;
|
|
101
|
+
}>;
|
|
102
|
+
rewardAccount: import("@trezor/schema-utils").TString;
|
|
103
|
+
owners: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
104
|
+
stakingKeyPath: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TNumber>]>>;
|
|
105
|
+
stakingKeyHash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
106
|
+
}>>;
|
|
107
|
+
relays: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
108
|
+
type: import("@trezor/schema-utils").TEnum<typeof PROTO.CardanoPoolRelayType>;
|
|
109
|
+
ipv4Address: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
110
|
+
ipv6Address: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
111
|
+
port: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TNumber>;
|
|
112
|
+
hostName: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
113
|
+
}>>;
|
|
114
|
+
metadata: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
115
|
+
url: import("@trezor/schema-utils").TString;
|
|
116
|
+
hash: import("@trezor/schema-utils").TString;
|
|
117
|
+
}>>;
|
|
118
|
+
}>>;
|
|
119
|
+
scriptHash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
120
|
+
keyHash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
121
|
+
deposit: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
122
|
+
dRep: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
123
|
+
type: import("@trezor/schema-utils").TEnum<typeof PROTO.CardanoDRepType>;
|
|
124
|
+
keyHash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
125
|
+
scriptHash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
126
|
+
}>>;
|
|
127
|
+
}>>>;
|
|
128
|
+
withdrawals: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
129
|
+
stakeAddress: import("@trezor/schema-utils").TString;
|
|
130
|
+
amount: import("@trezor/schema-utils").TString;
|
|
131
|
+
}>>>;
|
|
132
|
+
changeAddress: import("@trezor/schema-utils").TObject<{
|
|
133
|
+
address: import("@trezor/schema-utils").TString;
|
|
134
|
+
path: import("@trezor/schema-utils").TString;
|
|
135
|
+
}>;
|
|
136
|
+
addressParameters: import("@trezor/schema-utils").TObject<{
|
|
137
|
+
addressType: import("@trezor/schema-utils").TEnum<typeof PROTO.CardanoAddressType>;
|
|
138
|
+
path: import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TNumber>]>;
|
|
139
|
+
stakingPath: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TUnion<[import("@trezor/schema-utils").TString, import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TNumber>]>>;
|
|
140
|
+
stakingKeyHash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
141
|
+
certificatePointer: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
142
|
+
blockIndex: import("@trezor/schema-utils").TNumber;
|
|
143
|
+
txIndex: import("@trezor/schema-utils").TNumber;
|
|
144
|
+
certificateIndex: import("@trezor/schema-utils").TNumber;
|
|
145
|
+
}>>;
|
|
146
|
+
}>;
|
|
147
|
+
testnet: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TBoolean>;
|
|
148
|
+
}>;
|
|
43
149
|
export declare function cardanoComposeTransaction(params: Params<CardanoComposeTransactionParams>): Response<PrecomposedTransactionCardano[]>;
|
|
44
150
|
//# sourceMappingURL=cardanoComposeTransaction.d.ts.map
|