@trezor/connect 9.4.3-beta.1 → 9.4.3-beta.2
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 +43 -4
- package/README.md +1 -1
- package/lib/api/applyFlags.js +1 -1
- package/lib/api/applySettings.js +1 -1
- package/lib/api/authenticateDevice.js +1 -1
- package/lib/api/authorizeCoinjoin.js +1 -1
- package/lib/api/backupDevice.js +1 -1
- package/lib/api/binance/api/binanceGetAddress.js +2 -1
- package/lib/api/binance/api/binanceGetPublicKey.js +2 -1
- package/lib/api/binance/api/binanceSignTransaction.js +2 -1
- package/lib/api/binance/binanceSignTx.js +1 -1
- package/lib/api/bitcoin/Fees.js +2 -2
- package/lib/api/bitcoin/TransactionComposer.d.ts +3 -3
- package/lib/api/bitcoin/TransactionComposer.js +2 -2
- package/lib/api/bitcoin/refTx.js +1 -1
- package/lib/api/blockchainDisconnect.js +1 -1
- package/lib/api/blockchainEvmRpcCall.d.ts +16 -0
- package/lib/api/blockchainEvmRpcCall.js +45 -0
- package/lib/api/cancelCoinjoinAuthorization.js +1 -1
- package/lib/api/cardano/api/cardanoGetAddress.js +2 -1
- package/lib/api/cardano/api/cardanoGetNativeScriptHash.js +2 -1
- package/lib/api/cardano/api/cardanoGetPublicKey.js +2 -1
- package/lib/api/cardano/api/cardanoSignTransaction.js +2 -1
- 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.d.ts +8 -8
- package/lib/api/cardano/cardanoInputs.js +1 -1
- package/lib/api/cardano/cardanoOutputs.d.ts +22 -22
- package/lib/api/cardano/cardanoOutputs.js +1 -1
- package/lib/api/cardano/cardanoTokenBundle.d.ts +6 -6
- package/lib/api/cardano/cardanoTokenBundle.js +1 -1
- package/lib/api/changeLanguage.js +1 -1
- package/lib/api/changePin.js +1 -1
- package/lib/api/cipherKeyValue.js +1 -1
- package/lib/api/common/paramsValidator.js +1 -1
- package/lib/api/composeTransaction.d.ts +9 -3
- package/lib/api/composeTransaction.js +7 -4
- package/lib/api/eos/api/eosGetPublicKey.js +2 -1
- package/lib/api/eos/api/eosSignTransaction.js +2 -1
- package/lib/api/eos/eosSignTx.d.ts +3 -3
- package/lib/api/ethereum/api/ethereumGetAddress.js +2 -1
- package/lib/api/ethereum/api/ethereumGetPublicKey.js +2 -1
- package/lib/api/ethereum/api/ethereumSignMessage.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumSignMessage.js +2 -1
- package/lib/api/ethereum/api/ethereumSignTransaction.d.ts +1 -1
- package/lib/api/ethereum/api/ethereumSignTransaction.js +13 -7
- package/lib/api/ethereum/api/ethereumSignTypedData.d.ts +58 -57
- package/lib/api/ethereum/api/ethereumSignTypedData.js +3 -2
- package/lib/api/ethereum/api/ethereumVerifyMessage.js +2 -1
- package/lib/api/ethereum/ethereumDefinitions.d.ts +21 -21
- package/lib/api/ethereum/ethereumDefinitions.js +6 -5
- package/lib/api/firmware/getBinary.js +1 -1
- package/lib/api/firmware/x509certificate.js +3 -5
- package/lib/api/getAccountDescriptor.js +1 -1
- package/lib/api/getAddress.js +1 -1
- package/lib/api/getCoinInfo.d.ts +3 -0
- package/lib/api/getCoinInfo.js +1 -1
- package/lib/api/getFirmwareHash.js +1 -1
- package/lib/api/getOwnershipId.js +1 -1
- package/lib/api/getOwnershipProof.js +1 -1
- package/lib/api/getPublicKey.js +1 -1
- package/lib/api/index.d.ts +2 -1
- package/lib/api/index.js +5 -3
- package/lib/api/loadDevice.d.ts +14 -0
- package/lib/api/loadDevice.js +44 -0
- package/lib/api/nem/api/nemGetAddress.js +2 -1
- package/lib/api/nem/api/nemSignTransaction.js +2 -1
- package/lib/api/pushTransaction.js +1 -1
- package/lib/api/rebootToBootloader.js +1 -1
- package/lib/api/recoveryDevice.js +1 -1
- package/lib/api/requestLogin.js +1 -1
- package/lib/api/resetDevice.js +1 -1
- package/lib/api/ripple/api/rippleGetAddress.js +2 -1
- package/lib/api/ripple/api/rippleSignTransaction.js +2 -1
- package/lib/api/setBrightness.js +1 -1
- package/lib/api/setBusy.js +1 -1
- package/lib/api/signMessage.js +1 -1
- package/lib/api/solana/api/solanaGetAddress.js +2 -1
- package/lib/api/solana/api/solanaGetPublicKey.js +2 -1
- package/lib/api/solana/api/solanaSignTransaction.js +2 -1
- package/lib/api/stellar/api/stellarGetAddress.js +2 -1
- package/lib/api/stellar/api/stellarSignTransaction.js +2 -1
- package/lib/api/stellar/stellarSignTx.js +1 -1
- package/lib/api/tezos/api/tezosGetAddress.js +2 -1
- package/lib/api/tezos/api/tezosGetPublicKey.js +2 -1
- package/lib/api/tezos/api/tezosSignTransaction.js +2 -1
- package/lib/api/tezos/tezosSignTx.js +1 -1
- package/lib/api/unlockPath.js +1 -1
- package/lib/api/verifyMessage.js +1 -1
- package/lib/backend/Blockchain.d.ts +3 -0
- package/lib/backend/Blockchain.js +3 -0
- package/lib/constants/errors.d.ts +3 -0
- package/lib/constants/errors.js +3 -0
- package/lib/constants/index.d.ts +1 -0
- package/lib/constants/index.js +3 -1
- package/lib/constants/nem.d.ts +3 -3
- package/lib/constants/utxo.d.ts +3 -0
- package/lib/constants/utxo.js +5 -0
- package/lib/core/AbstractMethod.d.ts +13 -5
- package/lib/core/AbstractMethod.js +50 -24
- package/lib/core/index.js +41 -30
- package/lib/core/onCallFirmwareUpdate.d.ts +2 -2
- package/lib/core/onCallFirmwareUpdate.js +5 -5
- package/lib/data/DataManager.d.ts +0 -181
- package/lib/data/DataManager.js +40 -6
- package/lib/data/analyticsInfo.js +2 -1
- package/lib/data/coinInfo.d.ts +14 -0
- package/lib/data/config.d.ts +20 -22
- package/lib/data/config.js +15 -40
- package/lib/data/connectSettings.js +5 -4
- package/lib/data/deviceAuthenticityConfig.js +17 -0
- package/lib/data/deviceAuthenticityConfigTypes.d.ts +32 -23
- package/lib/data/firmwareInfo.d.ts +1 -1
- package/lib/data/models.d.ts +9 -0
- package/lib/data/models.js +9 -0
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +143 -36
- package/lib/device/Device.js +226 -119
- package/lib/device/DeviceCommands.js +4 -4
- package/lib/device/DeviceList.d.ts +13 -21
- package/lib/device/DeviceList.js +54 -168
- package/lib/device/prompts.js +3 -2
- package/lib/device/resolveDescriptorForTaproot.d.ts +1 -1
- package/lib/events/call.d.ts +5 -5
- package/lib/events/call.js +2 -2
- package/lib/events/device.d.ts +0 -6
- package/lib/events/device.js +0 -6
- package/lib/events/transport.d.ts +1 -1
- package/lib/factory.d.ts +6 -6
- package/lib/factory.js +132 -136
- package/lib/impl/dynamic.d.ts +13 -19
- package/lib/impl/dynamic.js +0 -9
- package/lib/index-browser.d.ts +3 -1
- package/lib/index-browser.js +0 -3
- package/lib/index.d.ts +3 -1
- package/lib/index.js +1 -13
- package/lib/types/api/applySettings.d.ts +13 -13
- package/lib/types/api/authenticateDevice.d.ts +33 -24
- package/lib/types/api/authorizeCoinjoin.d.ts +10 -10
- package/lib/types/api/binance/index.d.ts +143 -143
- package/lib/types/api/binance/index.js +1 -1
- package/lib/types/api/bitcoin/index.d.ts +11 -11
- package/lib/types/api/bitcoin/index.js +1 -1
- package/lib/types/api/blockchainEvmRpcCall.d.ts +4 -0
- package/lib/types/api/{checkFirmwareAuthenticity.js → blockchainEvmRpcCall.js} +1 -1
- package/lib/types/api/cancelCoinjoinAuthorization.d.ts +1 -1
- package/lib/types/api/cardano/index.d.ts +507 -507
- package/lib/types/api/changeLanguage.d.ts +6 -6
- package/lib/types/api/cipherKeyValue.d.ts +8 -8
- package/lib/types/api/cipherKeyValue.js +1 -1
- package/lib/types/api/composeTransaction.d.ts +13 -7
- package/lib/types/api/eos/index.d.ts +525 -525
- package/lib/types/api/eos/index.js +1 -1
- package/lib/types/api/ethereum/index.d.ts +100 -100
- package/lib/types/api/firmwareUpdate.d.ts +5 -5
- package/lib/types/api/getAccountDescriptor.d.ts +4 -4
- package/lib/types/api/getAddress.d.ts +32 -32
- package/lib/types/api/getOwnershipId.d.ts +24 -24
- package/lib/types/api/getOwnershipProof.d.ts +28 -28
- package/lib/types/api/getPublicKey.d.ts +24 -24
- package/lib/types/api/getPublicKey.js +1 -1
- package/lib/types/api/index.d.ts +4 -8
- package/lib/types/api/init.d.ts +4 -2
- package/lib/types/api/loadDevice.d.ts +4 -0
- package/lib/types/api/loadDevice.js +3 -0
- package/lib/types/api/nem/index.d.ts +612 -612
- package/lib/types/api/nem/index.js +1 -1
- package/lib/types/api/nemGetAddress.d.ts +6 -6
- package/lib/types/api/pushTransaction.d.ts +3 -3
- package/lib/types/api/recoveryDevice.d.ts +9 -9
- package/lib/types/api/requestLogin.d.ts +25 -25
- package/lib/types/api/ripple/index.d.ts +21 -21
- package/lib/types/api/ripple/index.js +1 -1
- package/lib/types/api/solana/index.d.ts +23 -23
- package/lib/types/api/solana/index.js +1 -1
- package/lib/types/api/stellar/index.d.ts +582 -582
- package/lib/types/api/stellar/index.js +1 -1
- package/lib/types/api/tezos/index.d.ts +120 -120
- package/lib/types/api/tezos/index.js +1 -1
- package/lib/types/api/unlockPath.d.ts +2 -2
- package/lib/types/coinInfo.d.ts +231 -224
- package/lib/types/device.d.ts +13 -1
- package/lib/types/device.js +3 -1
- package/lib/types/fees.d.ts +19 -19
- package/lib/types/firmware.d.ts +1 -1
- package/lib/types/params.d.ts +21 -18
- package/lib/types/settings.d.ts +15 -9
- package/lib/types/utils.d.ts +1 -0
- package/lib/types/utils.js +3 -0
- package/lib/utils/addressUtils.js +2 -2
- package/lib/utils/assetUtils.js +3 -3
- package/lib/utils/deviceFeaturesUtils.js +1 -1
- package/lib/utils/uiPromiseManager.d.ts +2 -1
- package/lib/utils/uiPromiseManager.js +3 -3
- package/package.json +12 -12
- package/lib/api/checkFirmwareAuthenticity.d.ts +0 -11
- package/lib/api/checkFirmwareAuthenticity.js +0 -63
- package/lib/types/api/checkFirmwareAuthenticity.d.ts +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,54 @@
|
|
|
1
1
|
| Package | Stable | Canary |
|
|
2
2
|
| :------------------------------: | :----: | :----------: |
|
|
3
|
-
| npm @trezor/connect | 9.4.2 | 9.4.3-beta.
|
|
4
|
-
| npm @trezor/connect-web | 9.4.2 | 9.4.3-beta.
|
|
5
|
-
| npm @trezor/connect-webextension | 9.4.2 | 9.4.3-beta.
|
|
3
|
+
| npm @trezor/connect | 9.4.2 | 9.4.3-beta.2 |
|
|
4
|
+
| npm @trezor/connect-web | 9.4.2 | 9.4.3-beta.2 |
|
|
5
|
+
| npm @trezor/connect-webextension | 9.4.2 | 9.4.3-beta.2 |
|
|
6
6
|
|
|
7
7
|
| Deployment | Stable | Canary |
|
|
8
8
|
| :----------------: | :----: | :----------: |
|
|
9
|
-
| connect.trezor.io/ | 9.4.2 | 9.4.3-beta.
|
|
9
|
+
| connect.trezor.io/ | 9.4.2 | 9.4.3-beta.2 |
|
|
10
10
|
|
|
11
11
|
Use the persistent link [connect.trezor.io/9](https://connect.trezor.io/9/) to access the latest stable version of Connect Explorer.
|
|
12
12
|
|
|
13
|
+
# 9.4.3-beta.2
|
|
14
|
+
|
|
15
|
+
## Feature
|
|
16
|
+
|
|
17
|
+
- new (non public) method TrezorConnect.loadDevice (14aec5d5b6, f8a47401ec, 0d5b592ae7, e46c95ef9d, 18b5cbc9d3, 580f3a9325)
|
|
18
|
+
- make TrezorConnect.init transportReconnect implicitly true (19aeb1a0f7)
|
|
19
|
+
- in connect popup improve error handling screen for missing capabilities in FW (d2c8870944)
|
|
20
|
+
- Support for t3w1 support in types (f98990dfa0, 01cdee48f1, e9827eeaa8)
|
|
21
|
+
- remove auto-acquire after device was released elsewhere (dfa070fa2d, cdd2ac1ec7)
|
|
22
|
+
- implement random strategy for utxo sorting (6c3137fdf8)
|
|
23
|
+
- new public method TrezorConnect.blockchainEvmRpcCall (a507d1322a)
|
|
24
|
+
- make `manifest.appUrl` available as part of `Device.transportSessionOwner` (c98f7f8bf4)
|
|
25
|
+
|
|
26
|
+
## Fixes
|
|
27
|
+
|
|
28
|
+
- local url in mobile example (e4365278aa)
|
|
29
|
+
- emit changed event with state change in keepSession (f8bcaf7203)
|
|
30
|
+
- don't trump Cancel with DeviceCommand disposed (d2f876e47c)
|
|
31
|
+
- WebUSB sessions sync in all deployments (13ec59a53d)
|
|
32
|
+
- skip fw hash check when binary too tiny (DX) (584d742ccc)
|
|
33
|
+
- usedElsewhere only for localSession (8fc98762ec)
|
|
34
|
+
- device.unreadableError is always string (aeab689d34)
|
|
35
|
+
- api.dispose on transport.stop (e79130e88e)
|
|
36
|
+
- analytics for core in popup (f08deff345)
|
|
37
|
+
- deeplink core mode from options (3eb7512b89)
|
|
38
|
+
|
|
39
|
+
## Chores and improvements
|
|
40
|
+
|
|
41
|
+
- try to reuse initialized (passphrase) session (422476c9c0)
|
|
42
|
+
- uncouple enableFirmwareHashCheck setting from binFilesBaseUrl (768596bbe5)
|
|
43
|
+
- add sortingStrategy param to connect, deprecate skipPermutation param in composeTransaction (283d3f1eae)
|
|
44
|
+
- Eslint improvements (1ad7b6f9b1, 12b6fb18b9, f1bdc399e5, e22b683733, 5d1104bfeb, 4a3cdc7893, 5e33e3abb5)
|
|
45
|
+
- add recommended checks from eslint-plugin-jest (55d
|
|
46
|
+
|
|
47
|
+
### Dependencies update
|
|
48
|
+
|
|
49
|
+
- chore(connect): update @ethereumjs libs (2d6465f, d6bc8c5020)
|
|
50
|
+
- bump electron,electron-builder and webpack (2b80c45c5f, e7a980bcf3, fc04fea1de)
|
|
51
|
+
|
|
13
52
|
# 9.4.3-beta.1
|
|
14
53
|
|
|
15
54
|
This release introduces `@trezor/connect-mobile`, which allows mobile apps to integrate with Trezor Suite mobile using deeplinks.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @trezor/connect
|
|
2
2
|
|
|
3
|
-
API version 9.4.3-beta.
|
|
3
|
+
API version 9.4.3-beta.2
|
|
4
4
|
|
|
5
5
|
[](https://github.com/trezor/trezor-suite/actions/workflows/test-connect.yml)
|
|
6
6
|
[](https://www.npmjs.org/package/@trezor/connect)
|
package/lib/api/applyFlags.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
5
|
const constants_1 = require("../constants");
|
|
5
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
6
6
|
class ApplyFlags extends AbstractMethod_1.AbstractMethod {
|
|
7
7
|
init() {
|
|
8
8
|
this.requiredPermissions = ['management'];
|
package/lib/api/applySettings.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
3
|
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
5
5
|
const applySettings_1 = require("../types/api/applySettings");
|
|
6
6
|
class ApplySettings extends AbstractMethod_1.AbstractMethod {
|
|
7
7
|
init() {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
5
|
const events_1 = require("../events");
|
|
5
6
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
6
7
|
const deviceAuthenticityConfig_1 = require("../data/deviceAuthenticityConfig");
|
|
7
8
|
const authenticateDevice_1 = require("../types/api/authenticateDevice");
|
|
8
9
|
const verifyAuthenticityProof_1 = require("./firmware/verifyAuthenticityProof");
|
|
9
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
10
|
class AuthenticateDevice extends AbstractMethod_1.AbstractMethod {
|
|
11
11
|
init() {
|
|
12
12
|
this.useEmptyPassphrase = true;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
5
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
5
6
|
const pathUtils_1 = require("../utils/pathUtils");
|
|
6
7
|
const coinInfo_1 = require("../data/coinInfo");
|
|
7
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
8
8
|
const authorizeCoinjoin_1 = require("../types/api/authorizeCoinjoin");
|
|
9
9
|
class AuthorizeCoinjoin extends AbstractMethod_1.AbstractMethod {
|
|
10
10
|
init() {
|
package/lib/api/backupDevice.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
5
|
const constants_1 = require("../constants");
|
|
5
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
6
6
|
class BackupDevice extends AbstractMethod_1.AbstractMethod {
|
|
7
7
|
init() {
|
|
8
8
|
this.requiredPermissions = ['management'];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
5
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
6
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
7
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
8
|
const constants_1 = require("../../../constants");
|
|
8
9
|
const events_1 = require("../../../events");
|
|
9
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
10
|
const types_1 = require("../../../types");
|
|
11
11
|
const getAddress_1 = require("../../../types/api/getAddress");
|
|
12
12
|
class BinanceGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
@@ -17,6 +17,7 @@ class BinanceGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
17
17
|
init() {
|
|
18
18
|
this.noBackupConfirmationMode = 'always';
|
|
19
19
|
this.requiredPermissions = ['read'];
|
|
20
|
+
this.requiredDeviceCapabilities = ['Capability_Binance'];
|
|
20
21
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('BNB'), this.firmwareRange);
|
|
21
22
|
this.hasBundle = !!this.payload.bundle;
|
|
22
23
|
const payload = !this.payload.bundle
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
5
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
6
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
7
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
8
|
const events_1 = require("../../../events");
|
|
8
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
9
9
|
const types_1 = require("../../../types");
|
|
10
10
|
class BinanceGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
11
11
|
init() {
|
|
12
12
|
this.requiredPermissions = ['read'];
|
|
13
|
+
this.requiredDeviceCapabilities = ['Capability_Binance'];
|
|
13
14
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('BNB'), this.firmwareRange);
|
|
14
15
|
this.hasBundle = !!this.payload.bundle;
|
|
15
16
|
const payload = !this.payload.bundle
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
5
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
6
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
7
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
8
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
9
|
const helper = tslib_1.__importStar(require("../binanceSignTx"));
|
|
9
10
|
const binance_1 = require("../../../types/api/binance");
|
|
10
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
11
11
|
class BinanceSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
12
12
|
init() {
|
|
13
13
|
var _a;
|
|
14
14
|
this.requiredPermissions = ['read', 'write'];
|
|
15
|
+
this.requiredDeviceCapabilities = ['Capability_Binance'];
|
|
15
16
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('BNB'), this.firmwareRange);
|
|
16
17
|
const { payload } = this;
|
|
17
18
|
(0, schema_utils_1.AssertWeak)(binance_1.BinanceSignTransaction, payload);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.signTx = exports.validate = void 0;
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
5
|
const constants_1 = require("../../constants");
|
|
5
6
|
const binance_1 = require("../../types/api/binance");
|
|
6
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
7
7
|
const processTxRequest = async (typedCall, messages, index) => {
|
|
8
8
|
const { type, ...params } = messages[index];
|
|
9
9
|
const lastOp = index + 1 >= messages.length;
|
package/lib/api/bitcoin/Fees.js
CHANGED
|
@@ -61,7 +61,7 @@ class FeeLevels {
|
|
|
61
61
|
feePerUnit: Math.min(this.coinInfo.maxFee, Math.max(this.coinInfo.minFee, parseInt(response.feePerUnit, 10))).toString(),
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
catch
|
|
64
|
+
catch {
|
|
65
65
|
}
|
|
66
66
|
return this.levels;
|
|
67
67
|
}
|
|
@@ -98,7 +98,7 @@ class FeeLevels {
|
|
|
98
98
|
});
|
|
99
99
|
this.longTermFeeRate = findLowest(this.blocks);
|
|
100
100
|
}
|
|
101
|
-
catch
|
|
101
|
+
catch {
|
|
102
102
|
}
|
|
103
103
|
return this.levels;
|
|
104
104
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComposeOutput } from '@trezor/utxo-lib';
|
|
1
|
+
import { ComposeOutput, TransactionInputOutputSortingStrategy } from '@trezor/utxo-lib';
|
|
2
2
|
import { FeeLevels } from './Fees';
|
|
3
3
|
import { Blockchain } from '../../backend/BlockchainLink';
|
|
4
4
|
import type { BitcoinNetworkInfo, DiscoveryAccount } from '../../types';
|
|
@@ -9,7 +9,7 @@ type Options = {
|
|
|
9
9
|
outputs: ComposeOutput[];
|
|
10
10
|
coinInfo: BitcoinNetworkInfo;
|
|
11
11
|
baseFee?: number;
|
|
12
|
-
|
|
12
|
+
sortingStrategy: TransactionInputOutputSortingStrategy;
|
|
13
13
|
};
|
|
14
14
|
export declare class TransactionComposer {
|
|
15
15
|
account: DiscoveryAccount;
|
|
@@ -18,7 +18,7 @@ export declare class TransactionComposer {
|
|
|
18
18
|
coinInfo: BitcoinNetworkInfo;
|
|
19
19
|
blockHeight: number;
|
|
20
20
|
baseFee: number;
|
|
21
|
-
|
|
21
|
+
sortingStrategy: TransactionInputOutputSortingStrategy;
|
|
22
22
|
feeLevels: FeeLevels;
|
|
23
23
|
composed: {
|
|
24
24
|
[key: string]: ComposeResult;
|
|
@@ -13,7 +13,7 @@ class TransactionComposer {
|
|
|
13
13
|
this.coinInfo = options.coinInfo;
|
|
14
14
|
this.blockHeight = 0;
|
|
15
15
|
this.baseFee = options.baseFee || 0;
|
|
16
|
-
this.
|
|
16
|
+
this.sortingStrategy = options.sortingStrategy;
|
|
17
17
|
this.feeLevels = new Fees_1.FeeLevels(options.coinInfo);
|
|
18
18
|
const { addresses } = options.account;
|
|
19
19
|
const allAddresses = !addresses
|
|
@@ -115,7 +115,7 @@ class TransactionComposer {
|
|
|
115
115
|
outputs: this.outputs,
|
|
116
116
|
feeRate,
|
|
117
117
|
longTermFeeRate: this.feeLevels.longTermFeeRate,
|
|
118
|
-
|
|
118
|
+
sortingStrategy: this.sortingStrategy,
|
|
119
119
|
network: coinInfo.network,
|
|
120
120
|
changeAddress,
|
|
121
121
|
dustThreshold: coinInfo.dustLimit,
|
package/lib/api/bitcoin/refTx.js
CHANGED
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.validateReferencedTransactions = exports.transformReferencedTransactions = exports.transformReferencedTransaction = exports.transformOrigTransactions = exports.parseTransactionHexes = exports.getOrigTransactions = exports.getReferencedTransactions = exports.requireReferencedTransactions = void 0;
|
|
4
4
|
const utxo_lib_1 = require("@trezor/utxo-lib");
|
|
5
5
|
const utils_1 = require("@trezor/utils");
|
|
6
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
6
7
|
const pathUtils_1 = require("../../utils/pathUtils");
|
|
7
8
|
const errors_1 = require("../../constants/errors");
|
|
8
9
|
const constants_1 = require("../../constants");
|
|
9
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
10
|
const requireReferencedTransactions = (inputs, options = {}, coinInfo) => {
|
|
11
11
|
if ((coinInfo === null || coinInfo === void 0 ? void 0 : coinInfo.shortcut) === 'ZEC' || (coinInfo === null || coinInfo === void 0 ? void 0 : coinInfo.shortcut) === 'TAZ') {
|
|
12
12
|
return !(options.version && options.version >= 5);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
5
|
const constants_1 = require("../constants");
|
|
5
6
|
const BlockchainLink_1 = require("../backend/BlockchainLink");
|
|
6
7
|
const coinInfo_1 = require("../data/coinInfo");
|
|
7
8
|
const types_1 = require("../types");
|
|
8
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
9
9
|
class BlockchainDisconnect extends AbstractMethod_1.AbstractMethod {
|
|
10
10
|
init() {
|
|
11
11
|
this.requiredPermissions = [];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AbstractMethod, Payload } from '../core/AbstractMethod';
|
|
2
|
+
import { CoinInfo } from '../types';
|
|
3
|
+
type Params = {
|
|
4
|
+
coinInfo: CoinInfo;
|
|
5
|
+
identity?: string;
|
|
6
|
+
request: Omit<Payload<'blockchainEvmRpcCall'>, 'method' | 'coin'>;
|
|
7
|
+
};
|
|
8
|
+
export default class BlockchainEvmRpcCall extends AbstractMethod<'blockchainEvmRpcCall', Params> {
|
|
9
|
+
init(): void;
|
|
10
|
+
get info(): string;
|
|
11
|
+
run(): Promise<{
|
|
12
|
+
data: string;
|
|
13
|
+
}>;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=blockchainEvmRpcCall.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("./common/paramsValidator");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
const BlockchainLink_1 = require("../backend/BlockchainLink");
|
|
7
|
+
const coinInfo_1 = require("../data/coinInfo");
|
|
8
|
+
class BlockchainEvmRpcCall extends AbstractMethod_1.AbstractMethod {
|
|
9
|
+
init() {
|
|
10
|
+
this.useDevice = false;
|
|
11
|
+
this.useUi = false;
|
|
12
|
+
const { payload } = this;
|
|
13
|
+
(0, paramsValidator_1.validateParams)(payload, [
|
|
14
|
+
{ name: 'coin', type: 'string', required: true },
|
|
15
|
+
{ name: 'identity', type: 'string' },
|
|
16
|
+
{ name: 'from', type: 'string' },
|
|
17
|
+
{ name: 'to', type: 'string', required: true },
|
|
18
|
+
{ name: 'data', type: 'string', required: true },
|
|
19
|
+
]);
|
|
20
|
+
const coinInfo = (0, coinInfo_1.getCoinInfo)(payload.coin);
|
|
21
|
+
if (!coinInfo) {
|
|
22
|
+
throw constants_1.ERRORS.TypedError('Method_UnknownCoin');
|
|
23
|
+
}
|
|
24
|
+
(0, BlockchainLink_1.isBackendSupported)(coinInfo);
|
|
25
|
+
this.params = {
|
|
26
|
+
coinInfo,
|
|
27
|
+
identity: payload.identity,
|
|
28
|
+
request: {
|
|
29
|
+
from: payload.from,
|
|
30
|
+
to: payload.to,
|
|
31
|
+
data: payload.data,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
get info() {
|
|
36
|
+
return 'Blockchain Evm Rpc Call';
|
|
37
|
+
}
|
|
38
|
+
async run() {
|
|
39
|
+
const backend = await (0, BlockchainLink_1.initBlockchain)(this.params.coinInfo, postMessage, this.params.identity);
|
|
40
|
+
const response = await backend.rpcCall(this.params.request);
|
|
41
|
+
return response;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = BlockchainEvmRpcCall;
|
|
45
|
+
//# sourceMappingURL=blockchainEvmRpcCall.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../core/AbstractMethod");
|
|
4
5
|
const paramsValidator_1 = require("./common/paramsValidator");
|
|
5
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
6
6
|
const cancelCoinjoinAuthorization_1 = require("../types/api/cancelCoinjoinAuthorization");
|
|
7
7
|
class CancelCoinjoinAuthorization extends AbstractMethod_1.AbstractMethod {
|
|
8
8
|
init() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
5
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
6
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
@@ -7,7 +8,6 @@ const pathUtils_1 = require("../../../utils/pathUtils");
|
|
|
7
8
|
const cardanoAddressParameters_1 = require("../cardanoAddressParameters");
|
|
8
9
|
const constants_1 = require("../../../constants");
|
|
9
10
|
const events_1 = require("../../../events");
|
|
10
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
11
11
|
const types_1 = require("../../../types");
|
|
12
12
|
const cardano_1 = require("../../../types/api/cardano");
|
|
13
13
|
class CardanoGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
@@ -18,6 +18,7 @@ class CardanoGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
|
18
18
|
init() {
|
|
19
19
|
this.noBackupConfirmationMode = 'always';
|
|
20
20
|
this.requiredPermissions = ['read'];
|
|
21
|
+
this.requiredDeviceCapabilities = ['Capability_Cardano'];
|
|
21
22
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Cardano'), this.firmwareRange);
|
|
22
23
|
this.hasBundle = !!this.payload.bundle;
|
|
23
24
|
const payload = !this.payload.bundle
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const constants_1 = require("../../../constants");
|
|
4
5
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
6
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
7
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
8
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
9
|
const cardano_1 = require("../../../types/api/cardano");
|
|
9
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
10
|
class CardanoGetNativeScriptHash extends AbstractMethod_1.AbstractMethod {
|
|
11
11
|
init() {
|
|
12
12
|
this.requiredPermissions = ['read'];
|
|
13
|
+
this.requiredDeviceCapabilities = ['Capability_Cardano'];
|
|
13
14
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Cardano'), this.firmwareRange);
|
|
14
15
|
const { payload } = this;
|
|
15
16
|
(0, schema_utils_1.Assert)(cardano_1.CardanoGetNativeScriptHash, payload);
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
3
4
|
const constants_1 = require("../../../constants");
|
|
4
5
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
6
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
7
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
8
|
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
9
|
const events_1 = require("../../../events");
|
|
9
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
10
10
|
const types_1 = require("../../../types");
|
|
11
11
|
const cardano_1 = require("../../../types/api/cardano");
|
|
12
12
|
class CardanoGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
13
13
|
init() {
|
|
14
14
|
this.requiredPermissions = ['read'];
|
|
15
|
+
this.requiredDeviceCapabilities = ['Capability_Cardano'];
|
|
15
16
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Cardano'), this.firmwareRange);
|
|
16
17
|
this.hasBundle = !!this.payload.bundle;
|
|
17
18
|
const payload = !this.payload.bundle
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const coin_selection_1 = require("@fivebinaries/coin-selection");
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
5
|
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
6
|
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
7
|
const coinInfo_1 = require("../../../data/coinInfo");
|
|
@@ -13,13 +14,13 @@ const constants_1 = require("../../../constants");
|
|
|
13
14
|
const cardano_1 = require("../../../types/api/cardano");
|
|
14
15
|
const cardanoWitnesses_1 = require("../cardanoWitnesses");
|
|
15
16
|
const cardanoTokenBundle_1 = require("../cardanoTokenBundle");
|
|
16
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
17
17
|
const CardanoSignTransactionFeatures = Object.freeze({
|
|
18
18
|
Conway: ['0', '2.7.1'],
|
|
19
19
|
});
|
|
20
20
|
class CardanoSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
21
21
|
init() {
|
|
22
22
|
this.requiredPermissions = ['read', 'write'];
|
|
23
|
+
this.requiredDeviceCapabilities = ['Capability_Cardano'];
|
|
23
24
|
this.firmwareRange = (0, paramsValidator_1.getFirmwareRange)(this.name, (0, coinInfo_1.getMiscNetwork)('Cardano'), this.firmwareRange);
|
|
24
25
|
const { payload } = this;
|
|
25
26
|
if (payload.metadata) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addressParametersFromProto = exports.addressParametersToProto = exports.modifyAddressParametersForBackwardsCompatibility = exports.validateAddressParameters = void 0;
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
5
|
const pathUtils_1 = require("../../utils/pathUtils");
|
|
5
6
|
const constants_1 = require("../../constants");
|
|
6
7
|
const cardano_1 = require("../../types/api/cardano");
|
|
7
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
8
8
|
const validateAddressParameters = (addressParameters) => {
|
|
9
9
|
(0, schema_utils_1.Assert)(cardano_1.CardanoAddressParameters, addressParameters);
|
|
10
10
|
if (addressParameters.path) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.modifyAuxiliaryDataForBackwardsCompatibility = exports.transformAuxiliaryData = void 0;
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
5
|
const cardanoAddressParameters_1 = require("./cardanoAddressParameters");
|
|
5
6
|
const pathUtils_1 = require("../../utils/pathUtils");
|
|
6
7
|
const constants_1 = require("../../constants");
|
|
7
8
|
const cardano_1 = require("../../types/api/cardano");
|
|
8
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
9
9
|
const MAX_DELEGATION_COUNT = 32;
|
|
10
10
|
const transformDelegation = (delegation) => {
|
|
11
11
|
if (delegation.votingPublicKey) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformCertificate = void 0;
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
5
|
const pathUtils_1 = require("../../utils/pathUtils");
|
|
5
6
|
const constants_1 = require("../../constants");
|
|
6
7
|
const cardano_1 = require("../../types/api/cardano");
|
|
7
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
8
8
|
const ipv4AddressToHex = (ipv4Address) => Buffer.from(ipv4Address.split('.').map(ipPart => parseInt(ipPart, 10))).toString('hex');
|
|
9
9
|
const ipv6AddressToHex = (ipv6Address) => ipv6Address.split(':').join('');
|
|
10
10
|
const validatePoolRelay = (relay) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PROTO } from '../../constants';
|
|
2
1
|
import { Static } from '@trezor/schema-utils';
|
|
2
|
+
import { PROTO } from '../../constants';
|
|
3
3
|
export type Path = number[];
|
|
4
|
-
export declare const Path: import("@
|
|
4
|
+
export declare const Path: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TNumber>;
|
|
5
5
|
export type CollateralInputWithPath = {
|
|
6
6
|
collateralInput: PROTO.CardanoTxCollateralInput;
|
|
7
7
|
path?: Path;
|
|
@@ -9,16 +9,16 @@ export type CollateralInputWithPath = {
|
|
|
9
9
|
export type InputWithPath = Static<typeof InputWithPath>;
|
|
10
10
|
export declare const InputWithPath: import("@trezor/schema-utils").TObject<{
|
|
11
11
|
input: import("@trezor/schema-utils").TObject<{
|
|
12
|
-
prev_hash: import("@
|
|
13
|
-
prev_index: import("@
|
|
12
|
+
prev_hash: import("@trezor/schema-utils").TString;
|
|
13
|
+
prev_index: import("@trezor/schema-utils").TNumber;
|
|
14
14
|
}>;
|
|
15
|
-
path: import("@
|
|
15
|
+
path: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TNumber>>;
|
|
16
16
|
}>;
|
|
17
17
|
export type InputWithPathParam = Static<typeof InputWithPath>;
|
|
18
18
|
export declare const InputWithPathParam: import("@trezor/schema-utils").TObject<{
|
|
19
|
-
prev_hash: import("@
|
|
20
|
-
prev_index: import("@
|
|
21
|
-
path: import("@
|
|
19
|
+
prev_hash: import("@trezor/schema-utils").TString;
|
|
20
|
+
prev_index: import("@trezor/schema-utils").TNumber;
|
|
21
|
+
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>]>>;
|
|
22
22
|
}>;
|
|
23
23
|
export declare const transformInput: (input: unknown) => InputWithPath;
|
|
24
24
|
export declare const transformCollateralInput: (collateralInput: unknown) => CollateralInputWithPath;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformReferenceInput = exports.transformCollateralInput = exports.transformInput = exports.InputWithPathParam = exports.InputWithPath = exports.Path = void 0;
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
5
|
const pathUtils_1 = require("../../utils/pathUtils");
|
|
5
6
|
const constants_1 = require("../../constants");
|
|
6
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
7
7
|
const exports_1 = require("../../exports");
|
|
8
8
|
exports.Path = schema_utils_1.Type.Array(schema_utils_1.Type.Number());
|
|
9
9
|
exports.InputWithPath = schema_utils_1.Type.Object({
|
|
@@ -7,32 +7,32 @@ export type OutputWithData = {
|
|
|
7
7
|
referenceScript?: string;
|
|
8
8
|
};
|
|
9
9
|
export declare const OutputValidation: import("@trezor/schema-utils").TObject<{
|
|
10
|
-
address: import("@
|
|
10
|
+
address: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
11
11
|
amount: import("@trezor/schema-utils/lib/custom-types/uint").TUint;
|
|
12
|
-
tokenBundle: import("@
|
|
13
|
-
policyId: import("@
|
|
14
|
-
tokenAmounts: import("@
|
|
15
|
-
assetNameBytes: import("@
|
|
16
|
-
amount: import("@
|
|
17
|
-
mintAmount: import("@
|
|
12
|
+
tokenBundle: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
13
|
+
policyId: import("@trezor/schema-utils").TString;
|
|
14
|
+
tokenAmounts: import("@trezor/schema-utils").TArray<import("@trezor/schema-utils").TObject<{
|
|
15
|
+
assetNameBytes: import("@trezor/schema-utils").TString;
|
|
16
|
+
amount: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
17
|
+
mintAmount: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
18
18
|
}>>;
|
|
19
19
|
}>>>;
|
|
20
|
-
datumHash: import("@
|
|
21
|
-
format: import("@
|
|
22
|
-
inlineDatum: import("@
|
|
23
|
-
referenceScript: import("@
|
|
24
|
-
addressParameters: import("@
|
|
25
|
-
addressType: import("@
|
|
26
|
-
path: import("@
|
|
27
|
-
stakingPath: import("@
|
|
28
|
-
stakingKeyHash: import("@
|
|
29
|
-
certificatePointer: import("@
|
|
30
|
-
blockIndex: import("@
|
|
31
|
-
txIndex: import("@
|
|
32
|
-
certificateIndex: import("@
|
|
20
|
+
datumHash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
21
|
+
format: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TNumber>;
|
|
22
|
+
inlineDatum: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
23
|
+
referenceScript: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
24
|
+
addressParameters: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
25
|
+
addressType: import("@trezor/schema-utils").TEnum<typeof PROTO.CardanoAddressType>;
|
|
26
|
+
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>]>>;
|
|
27
|
+
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>]>>;
|
|
28
|
+
stakingKeyHash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
29
|
+
certificatePointer: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TObject<{
|
|
30
|
+
blockIndex: import("@trezor/schema-utils").TNumber;
|
|
31
|
+
txIndex: import("@trezor/schema-utils").TNumber;
|
|
32
|
+
certificateIndex: import("@trezor/schema-utils").TNumber;
|
|
33
33
|
}>>;
|
|
34
|
-
paymentScriptHash: import("@
|
|
35
|
-
stakingScriptHash: import("@
|
|
34
|
+
paymentScriptHash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
35
|
+
stakingScriptHash: import("@trezor/schema-utils").TOptional<import("@trezor/schema-utils").TString>;
|
|
36
36
|
}>>;
|
|
37
37
|
}>;
|
|
38
38
|
export declare const transformOutput: (output: unknown) => OutputWithData;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sendOutput = exports.transformOutput = exports.OutputValidation = void 0;
|
|
4
|
+
const schema_utils_1 = require("@trezor/schema-utils");
|
|
4
5
|
const cardanoAddressParameters_1 = require("./cardanoAddressParameters");
|
|
5
6
|
const cardanoTokenBundle_1 = require("./cardanoTokenBundle");
|
|
6
7
|
const cardanoUtils_1 = require("./cardanoUtils");
|
|
7
8
|
const cardano_1 = require("../../types/api/cardano");
|
|
8
|
-
const schema_utils_1 = require("@trezor/schema-utils");
|
|
9
9
|
exports.OutputValidation = schema_utils_1.Type.Object({
|
|
10
10
|
address: schema_utils_1.Type.Optional(schema_utils_1.Type.String()),
|
|
11
11
|
amount: schema_utils_1.Type.Uint(),
|