@trezor/connect 9.1.9 → 9.1.10
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 +7 -0
- package/README.md +1 -1
- package/lib/api/applyFlags.d.ts +4 -2
- package/lib/api/applyFlags.js +3 -2
- package/lib/api/applySettings.d.ts +4 -2
- package/lib/api/applySettings.js +3 -13
- package/lib/api/authenticateDevice.js +3 -11
- package/lib/api/authorizeCoinjoin.d.ts +3 -1
- package/lib/api/authorizeCoinjoin.js +3 -11
- package/lib/api/backupDevice.d.ts +3 -1
- package/lib/api/binance/api/binanceGetAddress.d.ts +4 -2
- package/lib/api/binance/api/binanceGetAddress.js +4 -10
- package/lib/api/binance/api/binanceGetPublicKey.d.ts +9 -1
- package/lib/api/binance/api/binanceGetPublicKey.js +3 -5
- package/lib/api/binance/api/binanceSignTransaction.d.ts +4 -1
- package/lib/api/binance/api/binanceSignTransaction.js +5 -6
- package/lib/api/binance/binanceSignTx.d.ts +84 -3
- package/lib/api/binance/binanceSignTx.js +3 -26
- package/lib/api/bitcoin/Fees.d.ts +14 -2
- package/lib/api/bitcoin/TransactionComposer.d.ts +13 -2
- package/lib/api/bitcoin/refTx.d.ts +2 -2
- package/lib/api/bitcoin/refTx.js +22 -24
- package/lib/api/bitcoin/signtxVerify.d.ts +1 -1
- package/lib/api/blockchainDisconnect.d.ts +1 -1
- package/lib/api/blockchainDisconnect.js +3 -2
- 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/cancelCoinjoinAuthorization.d.ts +3 -1
- package/lib/api/cancelCoinjoinAuthorization.js +3 -0
- package/lib/api/cardano/api/cardanoGetAddress.d.ts +4 -2
- package/lib/api/cardano/api/cardanoGetAddress.js +4 -13
- package/lib/api/cardano/api/cardanoGetNativeScriptHash.d.ts +1 -1
- package/lib/api/cardano/api/cardanoGetNativeScriptHash.js +3 -13
- package/lib/api/cardano/api/cardanoGetPublicKey.d.ts +1 -1
- package/lib/api/cardano/api/cardanoGetPublicKey.js +4 -7
- package/lib/api/cardano/api/cardanoSignTransaction.d.ts +26 -4
- package/lib/api/cardano/api/cardanoSignTransaction.js +15 -46
- package/lib/api/cardano/cardanoAddressParameters.d.ts +1 -1
- package/lib/api/cardano/cardanoAddressParameters.js +3 -14
- package/lib/api/cardano/cardanoAuxiliaryData.d.ts +1 -1
- package/lib/api/cardano/cardanoAuxiliaryData.js +5 -20
- package/lib/api/cardano/cardanoCertificate.d.ts +1 -1
- package/lib/api/cardano/cardanoCertificate.js +20 -59
- package/lib/api/cardano/cardanoInputs.d.ts +20 -8
- package/lib/api/cardano/cardanoInputs.js +18 -14
- package/lib/api/cardano/cardanoOutputs.d.ts +31 -2
- package/lib/api/cardano/cardanoOutputs.js +14 -11
- package/lib/api/cardano/cardanoTokenBundle.d.ts +11 -6
- package/lib/api/cardano/cardanoTokenBundle.js +9 -21
- package/lib/api/changePin.d.ts +4 -2
- package/lib/api/changePin.js +3 -2
- package/lib/api/changeWipeCode.d.ts +3 -1
- package/lib/api/cipherKeyValue.d.ts +5 -1
- package/lib/api/cipherKeyValue.js +13 -21
- package/lib/api/common/paramsValidator.js +5 -4
- package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -1
- package/lib/api/eos/api/eosGetPublicKey.js +3 -6
- package/lib/api/eos/api/eosSignTransaction.js +3 -5
- package/lib/api/eos/eosSignTx.d.ts +160 -2
- package/lib/api/ethereum/api/ethereumGetAddress.js +4 -10
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +21 -1
- package/lib/api/ethereum/api/ethereumGetPublicKey.js +3 -5
- package/lib/api/ethereum/api/ethereumSignMessage.d.ts +6 -3
- package/lib/api/ethereum/api/ethereumSignMessage.js +3 -5
- package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +2 -2
- package/lib/api/ethereum/api/ethereumSignTransaction.js +3 -25
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +83 -3
- package/lib/api/ethereum/api/ethereumSignTypedData.js +20 -12
- package/lib/api/ethereum/api/ethereumVerifyMessage.d.ts +3 -1
- package/lib/api/ethereum/api/ethereumVerifyMessage.js +3 -6
- package/lib/api/ethereum/ethereumDefinitions.d.ts +37 -19
- package/lib/api/ethereum/ethereumDefinitions.js +21 -15
- package/lib/api/ethereum/ethereumSignTx.d.ts +1 -1
- package/lib/api/firmware/getBinary.js +5 -4
- package/lib/api/firmware/modifyFirmware.js +3 -2
- package/lib/api/firmware/uploadFirmware.d.ts +3 -1
- package/lib/api/firmware/verifyAuthenticityProof.js +3 -3
- package/lib/api/firmwareUpdate.js +10 -15
- package/lib/api/getAccountDescriptor.d.ts +2 -2
- package/lib/api/getAccountDescriptor.js +4 -7
- package/lib/api/getAccountInfo.d.ts +8 -8
- package/lib/api/getAddress.d.ts +8 -2
- package/lib/api/getAddress.js +4 -20
- package/lib/api/getCoinInfo.d.ts +117 -2
- package/lib/api/getCoinInfo.js +3 -2
- package/lib/api/getFeatures.d.ts +49 -1
- package/lib/api/getFirmwareHash.d.ts +3 -1
- package/lib/api/getFirmwareHash.js +3 -1
- package/lib/api/getOwnershipId.js +4 -7
- package/lib/api/getOwnershipProof.js +4 -11
- package/lib/api/getPublicKey.d.ts +21 -1
- package/lib/api/getPublicKey.js +4 -18
- package/lib/api/nem/api/nemGetAddress.d.ts +4 -2
- package/lib/api/nem/api/nemGetAddress.js +4 -11
- package/lib/api/nem/api/nemSignTransaction.d.ts +4 -1
- package/lib/api/nem/api/nemSignTransaction.js +3 -5
- package/lib/api/nem/nemSignTx.d.ts +75 -1
- package/lib/api/pushTransaction.js +3 -5
- package/lib/api/rebootToBootloader.d.ts +3 -1
- package/lib/api/recoveryDevice.d.ts +3 -1
- package/lib/api/recoveryDevice.js +3 -12
- package/lib/api/requestLogin.js +7 -9
- package/lib/api/resetDevice.d.ts +3 -1
- package/lib/api/resetDevice.js +3 -12
- package/lib/api/ripple/api/rippleGetAddress.d.ts +4 -2
- package/lib/api/ripple/api/rippleGetAddress.js +4 -10
- package/lib/api/ripple/api/rippleSignTransaction.js +3 -17
- package/lib/api/setBusy.d.ts +3 -1
- package/lib/api/setBusy.js +3 -1
- package/lib/api/showDeviceTutorial.d.ts +3 -1
- package/lib/api/signMessage.d.ts +4 -1
- package/lib/api/signMessage.js +3 -7
- package/lib/api/solana/additionalInfo.js +3 -14
- package/lib/api/solana/api/solanaGetAddress.d.ts +4 -2
- package/lib/api/solana/api/solanaGetAddress.js +4 -7
- package/lib/api/solana/api/solanaGetPublicKey.d.ts +13 -1
- package/lib/api/solana/api/solanaGetPublicKey.js +3 -5
- package/lib/api/solana/api/solanaSignTransaction.js +3 -4
- package/lib/api/stellar/api/stellarGetAddress.d.ts +4 -2
- package/lib/api/stellar/api/stellarGetAddress.js +4 -10
- package/lib/api/stellar/api/stellarSignTransaction.js +3 -5
- package/lib/api/stellar/stellarSignTx.d.ts +5 -3
- package/lib/api/stellar/stellarSignTx.js +3 -15
- package/lib/api/tezos/api/tezosGetAddress.d.ts +4 -2
- package/lib/api/tezos/api/tezosGetAddress.js +4 -10
- package/lib/api/tezos/api/tezosGetPublicKey.d.ts +9 -1
- package/lib/api/tezos/api/tezosGetPublicKey.js +3 -6
- package/lib/api/tezos/api/tezosSignTransaction.d.ts +5 -1
- package/lib/api/tezos/api/tezosSignTransaction.js +3 -5
- package/lib/api/tezos/tezosSignTx.d.ts +70 -2
- package/lib/api/tezos/tezosSignTx.js +3 -44
- package/lib/api/unlockPath.js +3 -4
- package/lib/api/verifyMessage.d.ts +3 -1
- package/lib/api/verifyMessage.js +3 -7
- package/lib/api/wipeDevice.d.ts +3 -1
- package/lib/constants/index.d.ts +1 -1
- package/lib/constants/index.js +1 -1
- package/lib/constants/nem.d.ts +7 -0
- package/lib/constants/nem.js +5 -1
- package/lib/core/AbstractMethod.d.ts +1 -1
- package/lib/core/AbstractMethod.js +4 -3
- package/lib/core/index.js +3 -3
- package/lib/data/coinInfo.d.ts +588 -12
- package/lib/data/coinInfo.js +6 -6
- package/lib/data/config.js +5 -0
- package/lib/data/deviceAuthenticityConfig.d.ts +19 -13
- package/lib/data/deviceAuthenticityConfig.js +23 -1
- package/lib/data/firmwareInfo.js +11 -10
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +2 -6
- package/lib/device/Device.js +8 -27
- package/lib/device/DeviceCommands.d.ts +36 -4
- package/lib/device/DeviceCommands.js +5 -2
- package/lib/device/DeviceList.js +1 -1
- package/lib/events/ui-promise.d.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/types/api/applySettings.d.ts +18 -2
- package/lib/types/api/applySettings.js +9 -0
- package/lib/types/api/authenticateDevice.d.ts +22 -5
- package/lib/types/api/authenticateDevice.js +7 -0
- package/lib/types/api/authorizeCoinjoin.d.ts +15 -13
- package/lib/types/api/authorizeCoinjoin.js +15 -0
- package/lib/types/api/binance/index.d.ts +203 -30
- package/lib/types/api/binance/index.js +48 -0
- package/lib/types/api/bitcoin/index.d.ts +18 -15
- package/lib/types/api/bitcoin/index.js +17 -0
- package/lib/types/api/cancelCoinjoinAuthorization.d.ts +5 -4
- package/lib/types/api/cancelCoinjoinAuthorization.js +5 -0
- package/lib/types/api/cardano/index.d.ts +685 -187
- package/lib/types/api/cardano/index.js +208 -0
- package/lib/types/api/cardanoSignTransaction.d.ts +5 -8
- package/lib/types/api/cipherKeyValue.d.ts +12 -11
- package/lib/types/api/cipherKeyValue.js +12 -0
- package/lib/types/api/eos/index.d.ts +783 -116
- package/lib/types/api/eos/index.js +177 -0
- package/lib/types/api/ethereum/index.d.ts +162 -56
- package/lib/types/api/ethereum/index.js +90 -0
- package/lib/types/api/firmwareUpdate.d.ts +11 -11
- package/lib/types/api/firmwareUpdate.js +15 -0
- package/lib/types/api/getAccountDescriptor.d.ts +10 -8
- package/lib/types/api/getAccountDescriptor.js +10 -0
- package/lib/types/api/getAddress.d.ts +42 -9
- package/lib/types/api/getAddress.js +14 -0
- package/lib/types/api/getOwnershipId.d.ts +33 -8
- package/lib/types/api/getOwnershipId.js +10 -0
- package/lib/types/api/getOwnershipProof.d.ts +37 -12
- package/lib/types/api/getOwnershipProof.js +14 -0
- package/lib/types/api/getPublicKey.d.ts +31 -21
- package/lib/types/api/getPublicKey.js +26 -0
- package/lib/types/api/nem/index.d.ts +841 -91
- package/lib/types/api/nem/index.js +130 -0
- package/lib/types/api/pushTransaction.d.ts +6 -4
- package/lib/types/api/pushTransaction.js +6 -0
- package/lib/types/api/recoveryDevice.d.ts +14 -4
- package/lib/types/api/recoveryDevice.js +9 -0
- package/lib/types/api/requestLogin.d.ts +38 -13
- package/lib/types/api/requestLogin.js +15 -0
- package/lib/types/api/resetDevice.d.ts +15 -13
- package/lib/types/api/resetDevice.js +9 -0
- package/lib/types/api/ripple/index.d.ts +40 -22
- package/lib/types/api/ripple/index.js +24 -0
- package/lib/types/api/solana/index.d.ts +42 -21
- package/lib/types/api/solana/index.js +26 -0
- package/lib/types/api/stellar/index.d.ts +890 -180
- package/lib/types/api/stellar/index.js +249 -0
- package/lib/types/api/tezos/index.d.ts +162 -59
- package/lib/types/api/tezos/index.js +61 -0
- package/lib/types/api/unlockPath.d.ts +7 -5
- package/lib/types/api/unlockPath.js +7 -0
- package/lib/types/coinInfo.d.ts +273 -56
- package/lib/types/coinInfo.js +81 -0
- package/lib/types/device.d.ts +1 -1
- package/lib/types/device.js +2 -2
- package/lib/types/fees.d.ts +29 -25
- package/lib/types/fees.js +36 -0
- package/lib/types/firmware.d.ts +1 -0
- package/lib/types/firmware.js +3 -0
- package/lib/types/params.d.ts +26 -17
- package/lib/types/params.js +23 -0
- package/lib/utils/deviceFeaturesUtils.js +5 -4
- package/lib/utils/firmwareUtils.js +5 -4
- package/lib/utils/hdnodeUtils.d.ts +191 -1
- package/lib/utils/pathUtils.d.ts +191 -1
- package/lib/utils/urlUtils.js +3 -3
- package/package.json +10 -9
|
@@ -4,6 +4,8 @@ export default class RebootToBootloader extends AbstractMethod<'rebootToBootload
|
|
|
4
4
|
init(): void;
|
|
5
5
|
get info(): string;
|
|
6
6
|
confirmation(): Promise<boolean>;
|
|
7
|
-
run(): Promise<
|
|
7
|
+
run(): Promise<{
|
|
8
|
+
message: string;
|
|
9
|
+
}>;
|
|
8
10
|
}
|
|
9
11
|
//# sourceMappingURL=rebootToBootloader.d.ts.map
|
|
@@ -3,6 +3,8 @@ import type { PROTO } from '../constants';
|
|
|
3
3
|
export default class RecoveryDevice extends AbstractMethod<'recoveryDevice', PROTO.RecoveryDevice> {
|
|
4
4
|
init(): void;
|
|
5
5
|
confirmation(): Promise<boolean>;
|
|
6
|
-
run(): Promise<
|
|
6
|
+
run(): Promise<{
|
|
7
|
+
message: string;
|
|
8
|
+
}>;
|
|
7
9
|
}
|
|
8
10
|
//# sourceMappingURL=recoveryDevice.d.ts.map
|
|
@@ -2,23 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
4
|
const events_1 = require("../events");
|
|
5
|
-
const
|
|
5
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
6
|
+
const recoveryDevice_1 = require("../types/api/recoveryDevice");
|
|
6
7
|
class RecoveryDevice extends AbstractMethod_1.AbstractMethod {
|
|
7
8
|
init() {
|
|
8
9
|
this.requiredPermissions = ['management'];
|
|
9
10
|
this.useEmptyPassphrase = true;
|
|
10
11
|
const { payload } = this;
|
|
11
|
-
(0,
|
|
12
|
-
{ name: 'word_count', type: 'number' },
|
|
13
|
-
{ name: 'passphrase_protection', type: 'boolean' },
|
|
14
|
-
{ name: 'pin_protection', type: 'boolean' },
|
|
15
|
-
{ name: 'language', type: 'string' },
|
|
16
|
-
{ name: 'label', type: 'string' },
|
|
17
|
-
{ name: 'enforce_wordlist', type: 'boolean' },
|
|
18
|
-
{ name: 'type', type: 'number' },
|
|
19
|
-
{ name: 'u2f_counter', type: 'number' },
|
|
20
|
-
{ name: 'dry_run', type: 'boolean' },
|
|
21
|
-
]);
|
|
12
|
+
(0, schema_utils_1.Assert)(recoveryDevice_1.RecoveryDevice, payload);
|
|
22
13
|
this.params = {
|
|
23
14
|
word_count: payload.word_count,
|
|
24
15
|
passphrase_protection: payload.passphrase_protection,
|
package/lib/api/requestLogin.js
CHANGED
|
@@ -5,6 +5,8 @@ const paramsValidator_1 = require("./common/paramsValidator");
|
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const events_1 = require("../events");
|
|
7
7
|
const DataManager_1 = require("../data/DataManager");
|
|
8
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
9
|
+
const requestLogin_1 = require("../types/api/requestLogin");
|
|
8
10
|
class RequestLogin extends AbstractMethod_1.AbstractMethod {
|
|
9
11
|
init() {
|
|
10
12
|
this.requiredPermissions = ['read', 'write'];
|
|
@@ -22,11 +24,7 @@ class RequestLogin extends AbstractMethod_1.AbstractMethod {
|
|
|
22
24
|
}
|
|
23
25
|
identity.index = 0;
|
|
24
26
|
}
|
|
25
|
-
(0,
|
|
26
|
-
{ name: 'challengeHidden', type: 'string' },
|
|
27
|
-
{ name: 'challengeVisual', type: 'string' },
|
|
28
|
-
{ name: 'asyncChallenge', type: 'boolean' },
|
|
29
|
-
]);
|
|
27
|
+
(0, schema_utils_1.Assert)(requestLogin_1.RequestLoginSchema, payload);
|
|
30
28
|
this.params = {
|
|
31
29
|
identity,
|
|
32
30
|
challenge_hidden: payload.challengeHidden || '',
|
|
@@ -45,10 +43,10 @@ class RequestLogin extends AbstractMethod_1.AbstractMethod {
|
|
|
45
43
|
if (typeof payload === 'string') {
|
|
46
44
|
throw constants_1.ERRORS.TypedError('Runtime', `TrezorConnect.requestLogin callback error: ${payload}`);
|
|
47
45
|
}
|
|
48
|
-
(0,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
(0, schema_utils_1.Assert)(schema_utils_1.Type.Object({
|
|
47
|
+
challengeHidden: schema_utils_1.Type.String(),
|
|
48
|
+
challengeVisual: schema_utils_1.Type.String(),
|
|
49
|
+
}), payload);
|
|
52
50
|
this.params.challenge_hidden = payload.challengeHidden;
|
|
53
51
|
this.params.challenge_visual = payload.challengeVisual;
|
|
54
52
|
}
|
package/lib/api/resetDevice.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export default class ResetDevice extends AbstractMethod<'resetDevice', PROTO.Res
|
|
|
5
5
|
init(): void;
|
|
6
6
|
get info(): string;
|
|
7
7
|
confirmation(): Promise<boolean>;
|
|
8
|
-
run(): Promise<
|
|
8
|
+
run(): Promise<{
|
|
9
|
+
message: string;
|
|
10
|
+
}>;
|
|
9
11
|
}
|
|
10
12
|
//# sourceMappingURL=resetDevice.d.ts.map
|
package/lib/api/resetDevice.js
CHANGED
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
4
|
const events_1 = require("../events");
|
|
5
5
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
7
|
+
const resetDevice_1 = require("../types/api/resetDevice");
|
|
6
8
|
class ResetDevice extends AbstractMethod_1.AbstractMethod {
|
|
7
9
|
init() {
|
|
8
10
|
this.allowDeviceMode = [events_1.UI.INITIALIZE, events_1.UI.SEEDLESS];
|
|
@@ -10,18 +12,7 @@ class ResetDevice extends AbstractMethod_1.AbstractMethod {
|
|
|
10
12
|
this.requiredPermissions = ['management'];
|
|
11
13
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, null, this.firmwareRange);
|
|
12
14
|
const { payload } = this;
|
|
13
|
-
(0,
|
|
14
|
-
{ name: 'display_random', type: 'boolean' },
|
|
15
|
-
{ name: 'strength', type: 'number' },
|
|
16
|
-
{ name: 'passphrase_protection', type: 'boolean' },
|
|
17
|
-
{ name: 'pin_protection', type: 'boolean' },
|
|
18
|
-
{ name: 'language', type: 'string' },
|
|
19
|
-
{ name: 'label', type: 'string' },
|
|
20
|
-
{ name: 'u2f_counter', type: 'number' },
|
|
21
|
-
{ name: 'skip_backup', type: 'boolean' },
|
|
22
|
-
{ name: 'no_backup', type: 'boolean' },
|
|
23
|
-
{ name: 'backup_type', type: 'number' },
|
|
24
|
-
]);
|
|
15
|
+
(0, schema_utils_1.Assert)(resetDevice_1.ResetDevice, payload);
|
|
25
16
|
this.params = {
|
|
26
17
|
display_random: payload.display_random,
|
|
27
18
|
strength: payload.strength || 256,
|
|
@@ -16,8 +16,10 @@ export default class RippleGetAddress extends AbstractMethod<'rippleGetAddress',
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, show_display, chunkify }: Params): Promise<
|
|
20
|
-
|
|
19
|
+
_call({ address_n, show_display, chunkify }: Params): Promise<{
|
|
20
|
+
address: string;
|
|
21
|
+
}>;
|
|
22
|
+
run(): Promise<import("../../../types").Address | import("../../../types").Address[]>;
|
|
21
23
|
}
|
|
22
24
|
export {};
|
|
23
25
|
//# sourceMappingURL=rippleGetAddress.d.ts.map
|
|
@@ -6,6 +6,9 @@ const coinInfo_1 = require("../../../data/coinInfo");
|
|
|
6
6
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
7
|
const constants_1 = require("../../../constants");
|
|
8
8
|
const events_1 = require("../../../events");
|
|
9
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
|
+
const types_1 = require("../../../types");
|
|
11
|
+
const getAddress_1 = require("../../../types/api/getAddress");
|
|
9
12
|
class RippleGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
10
13
|
constructor() {
|
|
11
14
|
super(...arguments);
|
|
@@ -18,17 +21,8 @@ class RippleGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
18
21
|
const payload = !this.payload.bundle
|
|
19
22
|
? { ...this.payload, bundle: [this.payload] }
|
|
20
23
|
: this.payload;
|
|
21
|
-
(0,
|
|
22
|
-
{ name: 'bundle', type: 'array' },
|
|
23
|
-
{ name: 'useEventListener', type: 'boolean' },
|
|
24
|
-
]);
|
|
24
|
+
(0, schema_utils_1.Assert)((0, types_1.Bundle)(getAddress_1.GetAddress), payload);
|
|
25
25
|
this.params = payload.bundle.map(batch => {
|
|
26
|
-
(0, paramsValidator_1.validateParams)(batch, [
|
|
27
|
-
{ name: 'path', required: true },
|
|
28
|
-
{ name: 'address', type: 'string' },
|
|
29
|
-
{ name: 'showOnTrezor', type: 'boolean' },
|
|
30
|
-
{ name: 'chunkify', type: 'boolean' },
|
|
31
|
-
]);
|
|
32
26
|
const path = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
33
27
|
return {
|
|
34
28
|
address_n: path,
|
|
@@ -4,30 +4,16 @@ const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
|
4
4
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
5
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
6
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
8
|
+
const ripple_1 = require("../../../types/api/ripple");
|
|
7
9
|
class RippleSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
8
10
|
init() {
|
|
9
11
|
this.requiredPermissions = ['read', 'write'];
|
|
10
12
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Ripple'), this.firmwareRange);
|
|
11
13
|
const { payload } = this;
|
|
12
|
-
(0,
|
|
13
|
-
{ name: 'path', required: true },
|
|
14
|
-
{ name: 'transaction', required: true },
|
|
15
|
-
{ name: 'chunkify', type: 'boolean' },
|
|
16
|
-
]);
|
|
14
|
+
(0, schema_utils_1.Assert)(ripple_1.RippleSignTransaction, payload);
|
|
17
15
|
const path = (0, pathUtils_1.validatePath)(payload.path, 5);
|
|
18
16
|
const { transaction, chunkify } = payload;
|
|
19
|
-
(0, paramsValidator_1.validateParams)(transaction, [
|
|
20
|
-
{ name: 'fee', type: 'uint' },
|
|
21
|
-
{ name: 'flags', type: 'number' },
|
|
22
|
-
{ name: 'sequence', type: 'number' },
|
|
23
|
-
{ name: 'maxLedgerVersion', type: 'number' },
|
|
24
|
-
{ name: 'payment', type: 'object' },
|
|
25
|
-
]);
|
|
26
|
-
(0, paramsValidator_1.validateParams)(transaction.payment, [
|
|
27
|
-
{ name: 'amount', type: 'uint', required: true },
|
|
28
|
-
{ name: 'destination', type: 'string', required: true },
|
|
29
|
-
{ name: 'destinationTag', type: 'number' },
|
|
30
|
-
]);
|
|
31
17
|
this.params = {
|
|
32
18
|
address_n: path,
|
|
33
19
|
fee: transaction.fee,
|
package/lib/api/setBusy.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { AbstractMethod } from '../core/AbstractMethod';
|
|
|
2
2
|
import { PROTO } from '../constants';
|
|
3
3
|
export default class SetBusy extends AbstractMethod<'setBusy', PROTO.SetBusy> {
|
|
4
4
|
init(): void;
|
|
5
|
-
run(): Promise<
|
|
5
|
+
run(): Promise<{
|
|
6
|
+
message: string;
|
|
7
|
+
}>;
|
|
6
8
|
}
|
|
7
9
|
//# sourceMappingURL=setBusy.d.ts.map
|
package/lib/api/setBusy.js
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
4
|
const events_1 = require("../events");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
5
6
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
7
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
6
8
|
class SetBusy extends AbstractMethod_1.AbstractMethod {
|
|
7
9
|
init() {
|
|
8
10
|
this.useDeviceState = false;
|
|
9
11
|
this.requiredPermissions = ['management'];
|
|
10
12
|
const { payload } = this;
|
|
11
|
-
(0,
|
|
13
|
+
(0, schema_utils_1.Assert)(constants_1.PROTO.SetBusy, payload);
|
|
12
14
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, undefined, this.firmwareRange);
|
|
13
15
|
this.params = {
|
|
14
16
|
expiry_ms: payload.expiry_ms,
|
|
@@ -3,6 +3,8 @@ import { PROTO } from '../constants';
|
|
|
3
3
|
export default class ShowDeviceTutorial extends AbstractMethod<'showDeviceTutorial', PROTO.ShowDeviceTutorial> {
|
|
4
4
|
init(): void;
|
|
5
5
|
get info(): string;
|
|
6
|
-
run(): Promise<
|
|
6
|
+
run(): Promise<{
|
|
7
|
+
message: string;
|
|
8
|
+
}>;
|
|
7
9
|
}
|
|
8
10
|
//# sourceMappingURL=showDeviceTutorial.d.ts.map
|
package/lib/api/signMessage.d.ts
CHANGED
|
@@ -3,6 +3,9 @@ import type { PROTO } from '../constants';
|
|
|
3
3
|
export default class SignMessage extends AbstractMethod<'signMessage', PROTO.SignMessage> {
|
|
4
4
|
init(): void;
|
|
5
5
|
get info(): string;
|
|
6
|
-
run(): Promise<
|
|
6
|
+
run(): Promise<{
|
|
7
|
+
address: string;
|
|
8
|
+
signature: string;
|
|
9
|
+
}>;
|
|
7
10
|
}
|
|
8
11
|
//# sourceMappingURL=signMessage.d.ts.map
|
package/lib/api/signMessage.js
CHANGED
|
@@ -5,17 +5,13 @@ const paramsValidator_1 = require("./common/paramsValidator");
|
|
|
5
5
|
const pathUtils_1 = require("../utils/pathUtils");
|
|
6
6
|
const coinInfo_1 = require("../data/coinInfo");
|
|
7
7
|
const formatUtils_1 = require("../utils/formatUtils");
|
|
8
|
+
const types_1 = require("../types");
|
|
9
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
8
10
|
class SignMessage extends AbstractMethod_1.AbstractMethod {
|
|
9
11
|
init() {
|
|
10
12
|
this.requiredPermissions = ['read', 'write'];
|
|
11
13
|
const { payload } = this;
|
|
12
|
-
(0,
|
|
13
|
-
{ name: 'path', required: true },
|
|
14
|
-
{ name: 'coin', type: 'string' },
|
|
15
|
-
{ name: 'message', type: 'string', required: true },
|
|
16
|
-
{ name: 'hex', type: 'boolean' },
|
|
17
|
-
{ name: 'no_script_type', type: 'boolean' },
|
|
18
|
-
]);
|
|
14
|
+
(0, schema_utils_1.Assert)(types_1.SignMessage, payload);
|
|
19
15
|
const path = (0, pathUtils_1.validatePath)(payload.path);
|
|
20
16
|
let coinInfo;
|
|
21
17
|
if (payload.coin) {
|
|
@@ -1,25 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformAdditionalInfo = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
var _a;
|
|
7
|
-
(0, paramsValidator_1.validateParams)(additionalInfo, [{ name: 'tokenAccountsInfos', type: 'array' }]);
|
|
8
|
-
(_a = additionalInfo.tokenAccountsInfos) === null || _a === void 0 ? void 0 : _a.forEach(tokenAccountInfo => {
|
|
9
|
-
(0, paramsValidator_1.validateParams)(tokenAccountInfo, [
|
|
10
|
-
{ name: 'baseAddress', type: 'string', required: true },
|
|
11
|
-
{ name: 'tokenProgram', type: 'string', required: true },
|
|
12
|
-
{ name: 'tokenMint', type: 'string', required: true },
|
|
13
|
-
{ name: 'tokenAccount', type: 'string', required: true },
|
|
14
|
-
]);
|
|
15
|
-
});
|
|
16
|
-
};
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
5
|
+
const solana_1 = require("../../types/api/solana");
|
|
17
6
|
const transformAdditionalInfo = (additionalInfo) => {
|
|
18
7
|
var _a;
|
|
19
8
|
if (!additionalInfo) {
|
|
20
9
|
return undefined;
|
|
21
10
|
}
|
|
22
|
-
|
|
11
|
+
(0, schema_utils_1.Assert)(solana_1.SolanaTxAdditionalInfo, additionalInfo);
|
|
23
12
|
return {
|
|
24
13
|
token_accounts_infos: ((_a = additionalInfo.tokenAccountsInfos) === null || _a === void 0 ? void 0 : _a.map(tokenAccountInfo => ({
|
|
25
14
|
base_address: tokenAccountInfo.baseAddress,
|
|
@@ -16,8 +16,10 @@ export default class SolanaGetAddress extends AbstractMethod<'solanaGetAddress',
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, show_display, chunkify }: Params): Promise<
|
|
20
|
-
|
|
19
|
+
_call({ address_n, show_display, chunkify }: Params): Promise<{
|
|
20
|
+
address: string;
|
|
21
|
+
}>;
|
|
22
|
+
run(): Promise<import("../../../types").Address | import("../../../types").Address[]>;
|
|
21
23
|
}
|
|
22
24
|
export {};
|
|
23
25
|
//# sourceMappingURL=solanaGetAddress.d.ts.map
|
|
@@ -6,6 +6,9 @@ const paramsValidator_1 = require("../../common/paramsValidator");
|
|
|
6
6
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
7
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
8
|
const events_1 = require("../../../events");
|
|
9
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
|
+
const types_1 = require("../../../types");
|
|
11
|
+
const getAddress_1 = require("../../../types/api/getAddress");
|
|
9
12
|
class SolanaGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
10
13
|
constructor() {
|
|
11
14
|
super(...arguments);
|
|
@@ -18,14 +21,8 @@ class SolanaGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
18
21
|
const payload = !this.payload.bundle
|
|
19
22
|
? { ...this.payload, bundle: [this.payload] }
|
|
20
23
|
: this.payload;
|
|
21
|
-
(0,
|
|
24
|
+
(0, schema_utils_1.Assert)((0, types_1.Bundle)(getAddress_1.GetAddress), payload);
|
|
22
25
|
this.params = payload.bundle.map(batch => {
|
|
23
|
-
(0, paramsValidator_1.validateParams)(batch, [
|
|
24
|
-
{ name: 'path', required: true },
|
|
25
|
-
{ name: 'address', type: 'string' },
|
|
26
|
-
{ name: 'showOnTrezor', type: 'boolean' },
|
|
27
|
-
{ name: 'chunkify', type: 'boolean' },
|
|
28
|
-
]);
|
|
29
26
|
const path = (0, pathUtils_1.validatePath)(batch.path, 2);
|
|
30
27
|
return {
|
|
31
28
|
address_n: path,
|
|
@@ -7,6 +7,18 @@ export default class SolanaGetPublicKey extends AbstractMethod<'solanaGetPublicK
|
|
|
7
7
|
get info(): string;
|
|
8
8
|
confirmation(): Promise<boolean>;
|
|
9
9
|
noBackupConfirmation(): Promise<boolean>;
|
|
10
|
-
run(): Promise<
|
|
10
|
+
run(): Promise<({
|
|
11
|
+
path: number[];
|
|
12
|
+
publicKey: string;
|
|
13
|
+
serializedPath: string;
|
|
14
|
+
} & {
|
|
15
|
+
publicKey: string;
|
|
16
|
+
}) | ({
|
|
17
|
+
path: number[];
|
|
18
|
+
publicKey: string;
|
|
19
|
+
serializedPath: string;
|
|
20
|
+
} & {
|
|
21
|
+
publicKey: string;
|
|
22
|
+
})[]>;
|
|
11
23
|
}
|
|
12
24
|
//# sourceMappingURL=solanaGetPublicKey.d.ts.map
|
|
@@ -5,6 +5,8 @@ const paramsValidator_1 = require("../../common/paramsValidator");
|
|
|
5
5
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
6
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
7
|
const events_1 = require("../../../events");
|
|
8
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
9
|
+
const types_1 = require("../../../types");
|
|
8
10
|
class SolanaGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
9
11
|
init() {
|
|
10
12
|
this.requiredPermissions = ['read'];
|
|
@@ -13,12 +15,8 @@ class SolanaGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
|
13
15
|
const payload = !this.payload.bundle
|
|
14
16
|
? { ...this.payload, bundle: [this.payload] }
|
|
15
17
|
: this.payload;
|
|
16
|
-
(0,
|
|
18
|
+
(0, schema_utils_1.Assert)((0, types_1.Bundle)(types_1.GetPublicKey), payload);
|
|
17
19
|
this.params = payload.bundle.map(batch => {
|
|
18
|
-
(0, paramsValidator_1.validateParams)(batch, [
|
|
19
|
-
{ name: 'path', required: true },
|
|
20
|
-
{ name: 'showOnTrezor', type: 'boolean' },
|
|
21
|
-
]);
|
|
22
20
|
const path = (0, pathUtils_1.validatePath)(batch.path, 2);
|
|
23
21
|
return {
|
|
24
22
|
address_n: path,
|
|
@@ -5,15 +5,14 @@ const paramsValidator_1 = require("../../common/paramsValidator");
|
|
|
5
5
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
6
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
7
|
const additionalInfo_1 = require("../additionalInfo");
|
|
8
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
9
|
+
const solana_1 = require("../../../types/api/solana");
|
|
8
10
|
class SolanaSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
9
11
|
init() {
|
|
10
12
|
this.requiredPermissions = ['read', 'write'];
|
|
11
13
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Solana'), this.firmwareRange);
|
|
12
14
|
const { payload } = this;
|
|
13
|
-
(0,
|
|
14
|
-
{ name: 'path', required: true },
|
|
15
|
-
{ name: 'serializedTx', type: 'string', required: true },
|
|
16
|
-
]);
|
|
15
|
+
(0, schema_utils_1.Assert)(solana_1.SolanaSignTransaction, payload);
|
|
17
16
|
const path = (0, pathUtils_1.validatePath)(payload.path, 2);
|
|
18
17
|
this.params = {
|
|
19
18
|
address_n: path,
|
|
@@ -16,8 +16,10 @@ export default class StellarGetAddress extends AbstractMethod<'stellarGetAddress
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, show_display, chunkify }: Params): Promise<
|
|
20
|
-
|
|
19
|
+
_call({ address_n, show_display, chunkify }: Params): Promise<{
|
|
20
|
+
address: string;
|
|
21
|
+
}>;
|
|
22
|
+
run(): Promise<import("../../../types").Address | import("../../../types").Address[]>;
|
|
21
23
|
}
|
|
22
24
|
export {};
|
|
23
25
|
//# sourceMappingURL=stellarGetAddress.d.ts.map
|
|
@@ -6,6 +6,9 @@ const coinInfo_1 = require("../../../data/coinInfo");
|
|
|
6
6
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
7
|
const constants_1 = require("../../../constants");
|
|
8
8
|
const events_1 = require("../../../events");
|
|
9
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
|
+
const types_1 = require("../../../types");
|
|
11
|
+
const getAddress_1 = require("../../../types/api/getAddress");
|
|
9
12
|
class StellarGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
10
13
|
constructor() {
|
|
11
14
|
super(...arguments);
|
|
@@ -18,17 +21,8 @@ class StellarGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
18
21
|
const payload = !this.payload.bundle
|
|
19
22
|
? { ...this.payload, bundle: [this.payload] }
|
|
20
23
|
: this.payload;
|
|
21
|
-
(0,
|
|
22
|
-
{ name: 'bundle', type: 'array' },
|
|
23
|
-
{ name: 'useEventListener', type: 'boolean' },
|
|
24
|
-
]);
|
|
24
|
+
(0, schema_utils_1.Assert)((0, types_1.Bundle)(getAddress_1.GetAddress), payload);
|
|
25
25
|
this.params = payload.bundle.map(batch => {
|
|
26
|
-
(0, paramsValidator_1.validateParams)(batch, [
|
|
27
|
-
{ name: 'path', required: true },
|
|
28
|
-
{ name: 'address', type: 'string' },
|
|
29
|
-
{ name: 'showOnTrezor', type: 'boolean' },
|
|
30
|
-
{ name: 'chunkify', type: 'boolean' },
|
|
31
|
-
]);
|
|
32
26
|
const path = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
33
27
|
return {
|
|
34
28
|
address_n: path,
|
|
@@ -7,6 +7,8 @@ const coinInfo_1 = require("../../../data/coinInfo");
|
|
|
7
7
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
8
|
const helper = tslib_1.__importStar(require("../stellarSignTx"));
|
|
9
9
|
const constants_1 = require("../../../constants");
|
|
10
|
+
const stellar_1 = require("../../../types/api/stellar");
|
|
11
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
12
|
const StellarSignTransactionFeatures = Object.freeze({
|
|
11
13
|
manageBuyOffer: ['1.10.4', '2.4.3'],
|
|
12
14
|
pathPaymentStrictSend: ['1.10.4', '2.4.3'],
|
|
@@ -16,11 +18,7 @@ class StellarSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
|
16
18
|
this.requiredPermissions = ['read', 'write'];
|
|
17
19
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Stellar'), this.firmwareRange);
|
|
18
20
|
const { payload } = this;
|
|
19
|
-
(0,
|
|
20
|
-
{ name: 'path', required: true },
|
|
21
|
-
{ name: 'networkPassphrase', type: 'string', required: true },
|
|
22
|
-
{ name: 'transaction', required: true },
|
|
23
|
-
]);
|
|
21
|
+
(0, schema_utils_1.Assert)(stellar_1.StellarSignTransaction, payload);
|
|
24
22
|
const path = (0, pathUtils_1.validatePath)(payload.path, 3);
|
|
25
23
|
const { transaction } = payload;
|
|
26
24
|
this.params = {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { PROTO } from '../../constants';
|
|
2
1
|
import type { TypedCall } from '../../device/DeviceCommands';
|
|
3
|
-
import
|
|
4
|
-
export declare const stellarSignTx: (typedCall: TypedCall, address_n: number[], networkPassphrase: string, tx: StellarTransaction) => Promise<
|
|
2
|
+
import { StellarTransaction } from '../../types/api/stellar';
|
|
3
|
+
export declare const stellarSignTx: (typedCall: TypedCall, address_n: number[], networkPassphrase: string, tx: StellarTransaction) => Promise<{
|
|
4
|
+
signature: string;
|
|
5
|
+
public_key: string;
|
|
6
|
+
}>;
|
|
5
7
|
//# sourceMappingURL=stellarSignTx.d.ts.map
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stellarSignTx = void 0;
|
|
4
4
|
const constants_1 = require("../../constants");
|
|
5
|
-
const
|
|
5
|
+
const stellar_1 = require("../../types/api/stellar");
|
|
6
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
6
7
|
const processTxRequest = async (typedCall, operations, index) => {
|
|
7
8
|
const lastOp = index + 1 >= operations.length;
|
|
8
9
|
const { type, ...op } = operations[index];
|
|
@@ -37,12 +38,9 @@ const transformSignMessage = (tx) => {
|
|
|
37
38
|
return msg;
|
|
38
39
|
};
|
|
39
40
|
const transformOperation = (op) => {
|
|
41
|
+
(0, schema_utils_1.Assert)(stellar_1.StellarOperation, op);
|
|
40
42
|
switch (op.type) {
|
|
41
43
|
case 'createAccount':
|
|
42
|
-
(0, paramsValidator_1.validateParams)(op, [
|
|
43
|
-
{ name: 'destination', type: 'string', required: true },
|
|
44
|
-
{ name: 'startingBalance', type: 'uint', required: true },
|
|
45
|
-
]);
|
|
46
44
|
return {
|
|
47
45
|
type: 'StellarCreateAccountOp',
|
|
48
46
|
source_account: op.source,
|
|
@@ -50,10 +48,6 @@ const transformOperation = (op) => {
|
|
|
50
48
|
starting_balance: op.startingBalance,
|
|
51
49
|
};
|
|
52
50
|
case 'payment':
|
|
53
|
-
(0, paramsValidator_1.validateParams)(op, [
|
|
54
|
-
{ name: 'destination', type: 'string', required: true },
|
|
55
|
-
{ name: 'amount', type: 'uint', required: true },
|
|
56
|
-
]);
|
|
57
51
|
return {
|
|
58
52
|
type: 'StellarPaymentOp',
|
|
59
53
|
source_account: op.source,
|
|
@@ -62,7 +56,6 @@ const transformOperation = (op) => {
|
|
|
62
56
|
amount: op.amount,
|
|
63
57
|
};
|
|
64
58
|
case 'pathPaymentStrictReceive':
|
|
65
|
-
(0, paramsValidator_1.validateParams)(op, [{ name: 'destAmount', type: 'uint', required: true }]);
|
|
66
59
|
return {
|
|
67
60
|
type: 'StellarPathPaymentStrictReceiveOp',
|
|
68
61
|
source_account: op.source,
|
|
@@ -74,7 +67,6 @@ const transformOperation = (op) => {
|
|
|
74
67
|
paths: op.path,
|
|
75
68
|
};
|
|
76
69
|
case 'pathPaymentStrictSend':
|
|
77
|
-
(0, paramsValidator_1.validateParams)(op, [{ name: 'destMin', type: 'uint', required: true }]);
|
|
78
70
|
return {
|
|
79
71
|
type: 'StellarPathPaymentStrictSendOp',
|
|
80
72
|
source_account: op.source,
|
|
@@ -86,7 +78,6 @@ const transformOperation = (op) => {
|
|
|
86
78
|
paths: op.path,
|
|
87
79
|
};
|
|
88
80
|
case 'createPassiveSellOffer':
|
|
89
|
-
(0, paramsValidator_1.validateParams)(op, [{ name: 'amount', type: 'uint', required: true }]);
|
|
90
81
|
return {
|
|
91
82
|
type: 'StellarCreatePassiveSellOfferOp',
|
|
92
83
|
source_account: op.source,
|
|
@@ -97,7 +88,6 @@ const transformOperation = (op) => {
|
|
|
97
88
|
price_d: op.price.d,
|
|
98
89
|
};
|
|
99
90
|
case 'manageSellOffer':
|
|
100
|
-
(0, paramsValidator_1.validateParams)(op, [{ name: 'amount', type: 'uint', required: true }]);
|
|
101
91
|
return {
|
|
102
92
|
type: 'StellarManageSellOfferOp',
|
|
103
93
|
source_account: op.source,
|
|
@@ -109,7 +99,6 @@ const transformOperation = (op) => {
|
|
|
109
99
|
price_d: op.price.d,
|
|
110
100
|
};
|
|
111
101
|
case 'manageBuyOffer':
|
|
112
|
-
(0, paramsValidator_1.validateParams)(op, [{ name: 'amount', type: 'uint', required: true }]);
|
|
113
102
|
return {
|
|
114
103
|
type: 'StellarManageBuyOfferOp',
|
|
115
104
|
source_account: op.source,
|
|
@@ -143,7 +132,6 @@ const transformOperation = (op) => {
|
|
|
143
132
|
};
|
|
144
133
|
}
|
|
145
134
|
case 'changeTrust':
|
|
146
|
-
(0, paramsValidator_1.validateParams)(op, [{ name: 'limit', type: 'uint' }]);
|
|
147
135
|
return {
|
|
148
136
|
type: 'StellarChangeTrustOp',
|
|
149
137
|
source_account: op.source,
|
|
@@ -16,8 +16,10 @@ export default class TezosGetAddress extends AbstractMethod<'tezosGetAddress', P
|
|
|
16
16
|
} | undefined;
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
|
-
_call({ address_n, show_display, chunkify }: Params): Promise<
|
|
20
|
-
|
|
19
|
+
_call({ address_n, show_display, chunkify }: Params): Promise<{
|
|
20
|
+
address: string;
|
|
21
|
+
}>;
|
|
22
|
+
run(): Promise<import("../../../types").Address | import("../../../types").Address[]>;
|
|
21
23
|
}
|
|
22
24
|
export {};
|
|
23
25
|
//# sourceMappingURL=tezosGetAddress.d.ts.map
|
|
@@ -6,6 +6,9 @@ const coinInfo_1 = require("../../../data/coinInfo");
|
|
|
6
6
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
7
|
const constants_1 = require("../../../constants");
|
|
8
8
|
const events_1 = require("../../../events");
|
|
9
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
|
+
const types_1 = require("../../../types");
|
|
11
|
+
const getAddress_1 = require("../../../types/api/getAddress");
|
|
9
12
|
class TezosGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
10
13
|
constructor() {
|
|
11
14
|
super(...arguments);
|
|
@@ -18,17 +21,8 @@ class TezosGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
18
21
|
const payload = !this.payload.bundle
|
|
19
22
|
? { ...this.payload, bundle: [this.payload] }
|
|
20
23
|
: this.payload;
|
|
21
|
-
(0,
|
|
22
|
-
{ name: 'bundle', type: 'array' },
|
|
23
|
-
{ name: 'useEventListener', type: 'boolean' },
|
|
24
|
-
]);
|
|
24
|
+
(0, schema_utils_1.Assert)((0, types_1.Bundle)(getAddress_1.GetAddress), payload);
|
|
25
25
|
this.params = payload.bundle.map(batch => {
|
|
26
|
-
(0, paramsValidator_1.validateParams)(batch, [
|
|
27
|
-
{ name: 'path', required: true },
|
|
28
|
-
{ name: 'address', type: 'string' },
|
|
29
|
-
{ name: 'showOnTrezor', type: 'boolean' },
|
|
30
|
-
{ name: 'chunkify', type: 'boolean' },
|
|
31
|
-
]);
|
|
32
26
|
const path = (0, pathUtils_1.validatePath)(batch.path, 3);
|
|
33
27
|
return {
|
|
34
28
|
address_n: path,
|
|
@@ -6,6 +6,14 @@ export default class TezosGetPublicKey extends AbstractMethod<'tezosGetPublicKey
|
|
|
6
6
|
init(): void;
|
|
7
7
|
get info(): string;
|
|
8
8
|
confirmation(): Promise<boolean>;
|
|
9
|
-
run(): Promise<
|
|
9
|
+
run(): Promise<{
|
|
10
|
+
path: number[];
|
|
11
|
+
publicKey: string;
|
|
12
|
+
serializedPath: string;
|
|
13
|
+
} | {
|
|
14
|
+
path: number[];
|
|
15
|
+
publicKey: string;
|
|
16
|
+
serializedPath: string;
|
|
17
|
+
}[]>;
|
|
10
18
|
}
|
|
11
19
|
//# sourceMappingURL=tezosGetPublicKey.d.ts.map
|