@trezor/connect 9.1.5 → 9.1.6
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 +33 -0
- package/README.md +1 -1
- package/lib/api/{binanceGetAddress.d.ts → binance/api/binanceGetAddress.d.ts} +3 -3
- package/lib/api/{binanceGetAddress.js → binance/api/binanceGetAddress.js} +6 -6
- package/lib/api/{binanceGetPublicKey.d.ts → binance/api/binanceGetPublicKey.d.ts} +3 -3
- package/lib/api/{binanceGetPublicKey.js → binance/api/binanceGetPublicKey.js} +5 -5
- package/lib/api/{binanceSignTransaction.d.ts → binance/api/binanceSignTransaction.d.ts} +2 -2
- package/lib/api/{binanceSignTransaction.js → binance/api/binanceSignTransaction.js} +5 -5
- package/lib/api/binance/api/index.d.ts +4 -0
- package/lib/api/binance/api/index.js +13 -0
- package/lib/api/bitcoin/TransactionComposer.d.ts +4 -4
- package/lib/api/bitcoin/TransactionComposer.js +4 -18
- package/lib/api/bitcoin/inputs.d.ts +2 -2
- package/lib/api/bitcoin/inputs.js +4 -5
- package/lib/api/bitcoin/outputs.d.ts +4 -4
- package/lib/api/bitcoin/outputs.js +14 -23
- package/lib/api/blockchainEstimateFee.d.ts +2 -2
- package/lib/api/cardano/api/cardanoComposeTransaction.d.ts +8 -0
- package/lib/api/cardano/api/cardanoComposeTransaction.js +69 -0
- package/lib/api/{cardanoGetAddress.d.ts → cardano/api/cardanoGetAddress.d.ts} +3 -3
- package/lib/api/{cardanoGetAddress.js → cardano/api/cardanoGetAddress.js} +7 -7
- package/lib/api/{cardanoGetNativeScriptHash.d.ts → cardano/api/cardanoGetNativeScriptHash.d.ts} +3 -3
- package/lib/api/{cardanoGetNativeScriptHash.js → cardano/api/cardanoGetNativeScriptHash.js} +5 -5
- package/lib/api/{cardanoGetPublicKey.d.ts → cardano/api/cardanoGetPublicKey.d.ts} +3 -3
- package/lib/api/{cardanoGetPublicKey.js → cardano/api/cardanoGetPublicKey.js} +6 -6
- package/lib/api/{cardanoSignTransaction.d.ts → cardano/api/cardanoSignTransaction.d.ts} +18 -8
- package/lib/api/{cardanoSignTransaction.js → cardano/api/cardanoSignTransaction.js} +30 -13
- package/lib/api/cardano/api/index.d.ts +6 -0
- package/lib/api/cardano/api/index.js +17 -0
- package/lib/api/cardano/cardanoUtils.d.ts +6 -0
- package/lib/api/cardano/cardanoUtils.js +64 -1
- package/lib/api/composeTransaction.d.ts +5 -5
- package/lib/api/composeTransaction.js +14 -19
- package/lib/api/eos/api/eosGetPublicKey.d.ts +11 -0
- package/lib/api/{eosGetPublicKey.js → eos/api/eosGetPublicKey.js} +5 -5
- package/lib/api/{eosSignTransaction.d.ts → eos/api/eosSignTransaction.d.ts} +2 -2
- package/lib/api/{eosSignTransaction.js → eos/api/eosSignTransaction.js} +5 -5
- package/lib/api/eos/api/index.d.ts +3 -0
- package/lib/api/eos/api/index.js +11 -0
- package/lib/api/{ethereumGetAddress.d.ts → ethereum/api/ethereumGetAddress.d.ts} +4 -4
- package/lib/api/{ethereumGetAddress.js → ethereum/api/ethereumGetAddress.js} +9 -9
- package/lib/api/ethereum/api/ethereumGetPublicKey.d.ts +16 -0
- package/lib/api/{ethereumGetPublicKey.js → ethereum/api/ethereumGetPublicKey.js} +6 -6
- package/lib/api/{ethereumSignMessage.d.ts → ethereum/api/ethereumSignMessage.d.ts} +3 -3
- package/lib/api/{ethereumSignMessage.js → ethereum/api/ethereumSignMessage.js} +7 -7
- package/lib/api/{ethereumSignTransaction.d.ts → ethereum/api/ethereumSignTransaction.d.ts} +11 -9
- package/lib/api/{ethereumSignTransaction.js → ethereum/api/ethereumSignTransaction.js} +36 -43
- package/lib/api/{ethereumSignTypedData.d.ts → ethereum/api/ethereumSignTypedData.d.ts} +3 -3
- package/lib/api/{ethereumSignTypedData.js → ethereum/api/ethereumSignTypedData.js} +10 -10
- package/lib/api/{ethereumVerifyMessage.d.ts → ethereum/api/ethereumVerifyMessage.d.ts} +2 -2
- package/lib/api/{ethereumVerifyMessage.js → ethereum/api/ethereumVerifyMessage.js} +3 -3
- package/lib/api/ethereum/api/index.d.ts +7 -0
- package/lib/api/ethereum/api/index.js +19 -0
- package/lib/api/ethereum/ethereumSignTx.d.ts +2 -0
- package/lib/api/ethereum/ethereumSignTx.js +15 -1
- package/lib/api/firmware/verifyAuthenticityProof.js +1 -1
- package/lib/api/firmware/x509certificate.d.ts +1 -0
- package/lib/api/firmware/x509certificate.js +34 -2
- package/lib/api/getAccountDescriptor.d.ts +20 -0
- package/lib/api/getAccountDescriptor.js +162 -0
- package/lib/api/getAccountInfo.d.ts +2 -0
- package/lib/api/index.d.ts +1 -24
- package/lib/api/index.js +3 -50
- package/lib/api/nem/api/index.d.ts +3 -0
- package/lib/api/nem/api/index.js +11 -0
- package/lib/api/{nemGetAddress.d.ts → nem/api/nemGetAddress.d.ts} +3 -3
- package/lib/api/{nemGetAddress.js → nem/api/nemGetAddress.js} +6 -6
- package/lib/api/{nemSignTransaction.d.ts → nem/api/nemSignTransaction.d.ts} +2 -2
- package/lib/api/{nemSignTransaction.js → nem/api/nemSignTransaction.js} +5 -5
- package/lib/api/ripple/api/index.d.ts +3 -0
- package/lib/api/ripple/api/index.js +11 -0
- package/lib/api/{rippleGetAddress.d.ts → ripple/api/rippleGetAddress.d.ts} +3 -3
- package/lib/api/{rippleGetAddress.js → ripple/api/rippleGetAddress.js} +6 -6
- package/lib/api/{rippleSignTransaction.d.ts → ripple/api/rippleSignTransaction.d.ts} +2 -2
- package/lib/api/{rippleSignTransaction.js → ripple/api/rippleSignTransaction.js} +4 -4
- package/lib/api/solana/api/index.d.ts +4 -0
- package/lib/api/solana/api/index.js +13 -0
- package/lib/api/solana/api/solanaGetAddress.d.ts +23 -0
- package/lib/api/solana/api/solanaGetAddress.js +131 -0
- package/lib/api/solana/api/solanaGetPublicKey.d.ts +12 -0
- package/lib/api/solana/api/solanaGetPublicKey.js +84 -0
- package/lib/api/solana/api/solanaSignTransaction.d.ts +10 -0
- package/lib/api/solana/api/solanaSignTransaction.js +33 -0
- package/lib/api/stellar/api/index.d.ts +3 -0
- package/lib/api/stellar/api/index.js +11 -0
- package/lib/api/{stellarGetAddress.d.ts → stellar/api/stellarGetAddress.d.ts} +3 -3
- package/lib/api/{stellarGetAddress.js → stellar/api/stellarGetAddress.js} +6 -6
- package/lib/api/{stellarSignTransaction.d.ts → stellar/api/stellarSignTransaction.d.ts} +2 -2
- package/lib/api/{stellarSignTransaction.js → stellar/api/stellarSignTransaction.js} +6 -6
- package/lib/api/tezos/api/index.d.ts +4 -0
- package/lib/api/tezos/api/index.js +13 -0
- package/lib/api/{tezosGetAddress.d.ts → tezos/api/tezosGetAddress.d.ts} +3 -3
- package/lib/api/{tezosGetAddress.js → tezos/api/tezosGetAddress.js} +6 -6
- package/lib/api/{tezosGetPublicKey.d.ts → tezos/api/tezosGetPublicKey.d.ts} +3 -3
- package/lib/api/{tezosGetPublicKey.js → tezos/api/tezosGetPublicKey.js} +5 -5
- package/lib/api/{tezosSignTransaction.d.ts → tezos/api/tezosSignTransaction.d.ts} +2 -2
- package/lib/api/{tezosSignTransaction.js → tezos/api/tezosSignTransaction.js} +5 -5
- package/lib/backend/Blockchain.js +2 -0
- package/lib/constants/cardano.js +2 -2
- package/lib/constants/nem.js +3 -3
- package/lib/constants/network.d.ts +3 -0
- package/lib/constants/network.js +13 -1
- package/lib/core/index.d.ts +3 -1
- package/lib/core/index.js +17 -4
- package/lib/core/method.d.ts +2 -2
- package/lib/core/method.js +8 -2
- package/lib/core/method.native.d.ts +5 -0
- package/lib/core/method.native.js +34 -0
- package/lib/data/DataManager.d.ts +11 -0
- package/lib/data/config.d.ts +11 -0
- package/lib/data/config.js +4 -0
- package/lib/data/connectSettings.js +4 -0
- package/lib/data/defaultFeeLevels.js +8 -0
- package/lib/data/version.d.ts +1 -1
- package/lib/data/version.js +1 -1
- package/lib/device/Device.d.ts +1 -1
- package/lib/device/Device.js +11 -2
- package/lib/device/DeviceCommands.js +9 -0
- package/lib/device/DeviceList.js +4 -1
- package/lib/events/popup.d.ts +19 -3
- package/lib/events/popup.js +3 -0
- package/lib/factory.js +5 -0
- package/lib/types/api/cardanoComposeTransaction.d.ts +44 -0
- package/lib/types/api/cardanoComposeTransaction.js +3 -0
- package/lib/types/api/cardanoSignTransaction.d.ts +9 -0
- package/lib/types/api/composeTransaction.d.ts +28 -54
- package/lib/types/api/ethereum/index.d.ts +1 -0
- package/lib/types/api/getAccountDescriptor.d.ts +16 -0
- package/lib/types/api/getAccountDescriptor.js +3 -0
- package/lib/types/api/index.d.ts +10 -0
- package/lib/types/api/solana/index.d.ts +12 -0
- package/lib/types/api/solana/index.js +3 -0
- package/lib/types/api/solanaGetAddress.d.ts +4 -0
- package/lib/types/api/solanaGetAddress.js +3 -0
- package/lib/types/api/solanaGetPublicKey.d.ts +5 -0
- package/lib/types/api/solanaGetPublicKey.js +3 -0
- package/lib/types/api/solanaSignTransaction.d.ts +4 -0
- package/lib/types/api/solanaSignTransaction.js +3 -0
- package/lib/types/coinInfo.d.ts +2 -13
- package/lib/types/device.js +1 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/types/index.js +1 -0
- package/lib/types/settings.d.ts +1 -0
- package/lib/utils/debug.d.ts +1 -2
- package/lib/utils/debug.js +6 -1
- package/lib/utils/deviceFeaturesUtils.js +2 -0
- package/lib/utils/formatUtils.d.ts +2 -0
- package/lib/utils/formatUtils.js +19 -1
- package/lib/workers/workers-browser.d.ts +2 -1
- package/lib/workers/workers-browser.js +3 -1
- package/lib/workers/workers-react-native.d.ts +2 -1
- package/lib/workers/workers-react-native.js +3 -1
- package/lib/workers/workers.d.ts +8 -5
- package/lib/workers/workers.js +34 -10
- package/package.json +22 -18
- package/lib/api/eosGetPublicKey.d.ts +0 -11
- package/lib/api/ethereumGetPublicKey.d.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
# 9.1.6
|
|
2
|
+
|
|
3
|
+
- chore(connect): remove web3-utils (2f683f6)
|
|
4
|
+
- feat(connect): serialize in ethereumSignTransaction (8f62896)
|
|
5
|
+
- feat(connect): add serializeEthereumTx util (a9b21a3)
|
|
6
|
+
- refactor(connect): improve ethereumSignTransaction (788910b)
|
|
7
|
+
- feat(connect-popup): shared worker logger load dynamically only when required (424383e, f5400f8)
|
|
8
|
+
- feat(connect): update solana backend urls, fee info, workers, account descriptor and fw integration (876f609, a3ae0ae, e1058ea, cadffc6, 3d9c703)
|
|
9
|
+
- feat(connect-popup): add new method that allow set to use core (d944e50)
|
|
10
|
+
- feat(core): new events for core in popup (242a169)
|
|
11
|
+
- chore(connect-iframe): suppress subtle crypto warning (1f0e722)
|
|
12
|
+
- feat(connect-iframe): standalone core build (c344c3d)
|
|
13
|
+
- feat(deps): update deps without breaking changes (7e0584c)
|
|
14
|
+
- fix(connect-web, connect-popup): remove trust-issues handle from query param (79036e8, b8640d8, 87b4b84)
|
|
15
|
+
- feat(connect-explorer): settings page to restart connect (33e41f6)
|
|
16
|
+
- feat(connect): update protobuf messages in custom Transports (if not set) (1eb5156)
|
|
17
|
+
- fix(connect): device.run race condition (7d0545c, 7978eab)
|
|
18
|
+
- feat(connect-common): add T2T1 & T2B1 firmware binaries 2.6.3 bootloader 2.1.4 (9cca8b1)
|
|
19
|
+
- fix(mobile): Fix modularized connect in React Native (57fcb9d, ba42388, 1ef62e7)
|
|
20
|
+
- chore(deps): bump @fivebinaries/coin-selection (5e16f60)
|
|
21
|
+
- chore(connect): ethereum api dynamic load (b22d228)
|
|
22
|
+
- chore(connect): cardano api dynamic load (3ef0e77)
|
|
23
|
+
- chore(connect): stellar api dynamic import (473ea94)
|
|
24
|
+
- chore(connect): nem api dynamic import (52e2f99)
|
|
25
|
+
- chore(connect): eos api dynamic import (cf5b3ad)
|
|
26
|
+
- chore(connect): binance api dynamic import (3ccf149)
|
|
27
|
+
- chore(connect): tezos api dynamic import (273a9fe)
|
|
28
|
+
- chore(connect): ripple api dynamic import (9b17e38)
|
|
29
|
+
- chore(connect): prepare for dynamic method import (d4868eb)
|
|
30
|
+
- chore(connect): blockchain link workers dynamic import (74fd083)
|
|
31
|
+
- chore(connect): implement @trezor/utxo-lib 2.0.0 (06a9f7a)
|
|
32
|
+
- feat(connect): add getAccountDescriptor method (0b005ec)
|
|
33
|
+
|
|
1
34
|
# 9.1.5
|
|
2
35
|
|
|
3
36
|
- feat(suite): T2B1 replace Model R name by official Trezor Safe 3 name (7460372ed1)
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @trezor/connect
|
|
2
2
|
|
|
3
|
-
API version 9.1.
|
|
3
|
+
API version 9.1.6
|
|
4
4
|
|
|
5
5
|
[](https://github.com/trezor/trezor-suite/actions/workflows/connect-test.yml)
|
|
6
6
|
[](https://www.npmjs.org/package/@trezor/connect)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '
|
|
2
|
-
import { PROTO } from '
|
|
1
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
|
+
import { PROTO } from '../../../constants';
|
|
3
3
|
type Params = PROTO.BinanceGetAddress & {
|
|
4
4
|
address?: string;
|
|
5
5
|
};
|
|
@@ -17,7 +17,7 @@ export default class BinanceGetAddress extends AbstractMethod<'binanceGetAddress
|
|
|
17
17
|
confirmation(): Promise<boolean>;
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
19
|
_call({ address_n, show_display }: Params): Promise<PROTO.BinanceAddress>;
|
|
20
|
-
run(): Promise<import("
|
|
20
|
+
run(): Promise<import("../../..").Address | import("../../..").Address[]>;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
|
23
23
|
//# sourceMappingURL=binanceGetAddress.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const AbstractMethod_1 = require("
|
|
4
|
-
const paramsValidator_1 = require("
|
|
5
|
-
const coinInfo_1 = require("
|
|
6
|
-
const pathUtils_1 = require("
|
|
7
|
-
const constants_1 = require("
|
|
8
|
-
const events_1 = require("
|
|
3
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
|
+
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
|
+
const constants_1 = require("../../../constants");
|
|
8
|
+
const events_1 = require("../../../events");
|
|
9
9
|
class BinanceGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AbstractMethod } from '
|
|
2
|
-
import type { PROTO } from '
|
|
1
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
|
+
import type { PROTO } from '../../../constants';
|
|
3
3
|
export default class BinanceGetPublicKey extends AbstractMethod<'binanceGetPublicKey', PROTO.BinanceGetPublicKey[]> {
|
|
4
4
|
hasBundle?: boolean;
|
|
5
5
|
confirmed?: boolean;
|
|
6
6
|
init(): void;
|
|
7
7
|
get info(): string;
|
|
8
8
|
confirmation(): Promise<boolean>;
|
|
9
|
-
run(): Promise<import("
|
|
9
|
+
run(): Promise<import("../../..").PublicKey | import("../../..").PublicKey[]>;
|
|
10
10
|
}
|
|
11
11
|
//# sourceMappingURL=binanceGetPublicKey.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const AbstractMethod_1 = require("
|
|
4
|
-
const paramsValidator_1 = require("
|
|
5
|
-
const coinInfo_1 = require("
|
|
6
|
-
const pathUtils_1 = require("
|
|
7
|
-
const events_1 = require("
|
|
3
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
|
+
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
|
+
const events_1 = require("../../../events");
|
|
8
8
|
class BinanceGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
9
9
|
init() {
|
|
10
10
|
this.requiredPermissions = ['read'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '
|
|
2
|
-
import type { BinancePreparedTransaction } from '
|
|
1
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
|
+
import type { BinancePreparedTransaction } from '../../../types/api/binance';
|
|
3
3
|
type Params = {
|
|
4
4
|
path: number[];
|
|
5
5
|
transaction: BinancePreparedTransaction;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const AbstractMethod_1 = require("
|
|
5
|
-
const paramsValidator_1 = require("
|
|
6
|
-
const coinInfo_1 = require("
|
|
7
|
-
const pathUtils_1 = require("
|
|
8
|
-
const helper = tslib_1.__importStar(require("
|
|
4
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
|
+
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
|
+
const helper = tslib_1.__importStar(require("../binanceSignTx"));
|
|
9
9
|
class BinanceSignTransaction extends AbstractMethod_1.AbstractMethod {
|
|
10
10
|
init() {
|
|
11
11
|
this.requiredPermissions = ['read', 'write'];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.binanceSignTransaction = exports.binanceGetPublicKey = exports.binanceGetAddress = void 0;
|
|
7
|
+
var binanceGetAddress_1 = require("./binanceGetAddress");
|
|
8
|
+
Object.defineProperty(exports, "binanceGetAddress", { enumerable: true, get: function () { return __importDefault(binanceGetAddress_1).default; } });
|
|
9
|
+
var binanceGetPublicKey_1 = require("./binanceGetPublicKey");
|
|
10
|
+
Object.defineProperty(exports, "binanceGetPublicKey", { enumerable: true, get: function () { return __importDefault(binanceGetPublicKey_1).default; } });
|
|
11
|
+
var binanceSignTransaction_1 = require("./binanceSignTransaction");
|
|
12
|
+
Object.defineProperty(exports, "binanceSignTransaction", { enumerable: true, get: function () { return __importDefault(binanceSignTransaction_1).default; } });
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComposeOutput } from '@trezor/utxo-lib';
|
|
2
2
|
import { FeeLevels } from './Fees';
|
|
3
3
|
import { Blockchain } from '../../backend/BlockchainLink';
|
|
4
4
|
import type { BitcoinNetworkInfo, DiscoveryAccount, SelectFeeLevel } from '../../types';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ComposeUtxo, ComposedInputs, ComposeResult } from '../../types/api/composeTransaction';
|
|
6
6
|
type Options = {
|
|
7
7
|
account: DiscoveryAccount;
|
|
8
|
-
|
|
8
|
+
utxos: ComposeUtxo[];
|
|
9
9
|
outputs: ComposeOutput[];
|
|
10
10
|
coinInfo: BitcoinNetworkInfo;
|
|
11
11
|
baseFee?: number;
|
|
@@ -13,7 +13,7 @@ type Options = {
|
|
|
13
13
|
};
|
|
14
14
|
export declare class TransactionComposer {
|
|
15
15
|
account: DiscoveryAccount;
|
|
16
|
-
utxos:
|
|
16
|
+
utxos: ComposedInputs[];
|
|
17
17
|
outputs: ComposeOutput[];
|
|
18
18
|
coinInfo: BitcoinNetworkInfo;
|
|
19
19
|
blockHeight: number;
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const bignumber_js_1 = tslib_1.__importDefault(require("bignumber.js"));
|
|
6
6
|
const utxo_lib_1 = require("@trezor/utxo-lib");
|
|
7
7
|
const Fees_1 = require("./Fees");
|
|
8
|
-
const pathUtils_1 = require("../../utils/pathUtils");
|
|
9
8
|
class TransactionComposer {
|
|
10
9
|
constructor(options) {
|
|
11
10
|
this.blockHeight = 0;
|
|
@@ -24,22 +23,13 @@ class TransactionComposer {
|
|
|
24
23
|
.concat(addresses.unused)
|
|
25
24
|
.concat(addresses.change)
|
|
26
25
|
.map(a => a.address);
|
|
27
|
-
this.utxos = options.
|
|
28
|
-
if (!u.required && new bignumber_js_1.default(u.amount).
|
|
26
|
+
this.utxos = options.utxos.flatMap(u => {
|
|
27
|
+
if (!u.required && new bignumber_js_1.default(u.amount).lte(this.coinInfo.dustLimit))
|
|
29
28
|
return [];
|
|
30
|
-
const addressPath = (0, pathUtils_1.getHDPath)(u.path);
|
|
31
|
-
const [chain, index] = addressPath.slice(addressPath.length - 2);
|
|
32
29
|
return {
|
|
33
|
-
|
|
34
|
-
transactionHash: u.txid,
|
|
35
|
-
value: u.amount,
|
|
36
|
-
addressPath: [chain, index],
|
|
37
|
-
height: u.blockHeight,
|
|
38
|
-
tsize: 0,
|
|
39
|
-
vsize: 0,
|
|
30
|
+
...u,
|
|
40
31
|
coinbase: typeof u.coinbase === 'boolean' ? u.coinbase : false,
|
|
41
32
|
own: allAddresses.indexOf(u.address) >= 0,
|
|
42
|
-
required: u.required,
|
|
43
33
|
};
|
|
44
34
|
});
|
|
45
35
|
}
|
|
@@ -120,19 +110,15 @@ class TransactionComposer {
|
|
|
120
110
|
return { type: 'error', error: 'ADDRESSES-NOT-SET' };
|
|
121
111
|
const changeAddress = addresses.change.find(a => !a.transfers) ||
|
|
122
112
|
addresses.change[addresses.change.length - 1];
|
|
123
|
-
const changeId = (0, pathUtils_1.getHDPath)(changeAddress.path).slice(-1)[0];
|
|
124
113
|
return (0, utxo_lib_1.composeTx)({
|
|
125
114
|
txType: account.type,
|
|
126
115
|
utxos: this.utxos,
|
|
127
116
|
outputs: this.outputs,
|
|
128
|
-
height: this.blockHeight,
|
|
129
117
|
feeRate,
|
|
130
118
|
longTermFeeRate: this.feeLevels.longTermFeeRate,
|
|
131
119
|
skipPermutation: this.skipPermutation,
|
|
132
|
-
basePath: account.address_n,
|
|
133
120
|
network: coinInfo.network,
|
|
134
|
-
|
|
135
|
-
changeAddress: changeAddress.address,
|
|
121
|
+
changeAddress,
|
|
136
122
|
dustThreshold: coinInfo.dustLimit,
|
|
137
123
|
baseFee,
|
|
138
124
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ComposedTxInput } from '@trezor/utxo-lib';
|
|
2
1
|
import type { TypedRawTransaction } from '@trezor/blockchain-link';
|
|
3
2
|
import type { BitcoinNetworkInfo, ProtoWithDerivationPath } from '../../types';
|
|
3
|
+
import type { ComposeUtxo } from '../../types/api/composeTransaction';
|
|
4
4
|
import type { PROTO } from '../../constants';
|
|
5
5
|
export declare const validateTrezorInputs: (inputs: ProtoWithDerivationPath<PROTO.TxInputType>[], coinInfo: BitcoinNetworkInfo) => PROTO.TxInputType[];
|
|
6
6
|
export declare const enhanceTrezorInputs: (inputs: PROTO.TxInputType[], rawTxs: TypedRawTransaction[]) => void;
|
|
7
|
-
export declare const inputToTrezor: (input:
|
|
7
|
+
export declare const inputToTrezor: (input: ComposeUtxo, sequence?: number) => PROTO.TxInputType;
|
|
8
8
|
//# sourceMappingURL=inputs.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.inputToTrezor = exports.enhanceTrezorInputs = exports.validateTrezorInputs = void 0;
|
|
4
|
-
const utils_1 = require("@trezor/utils");
|
|
5
4
|
const pathUtils_1 = require("../../utils/pathUtils");
|
|
6
5
|
const hdnodeUtils_1 = require("../../utils/hdnodeUtils");
|
|
7
6
|
const paramsValidator_1 = require("../common/paramsValidator");
|
|
@@ -46,12 +45,12 @@ const enhanceTrezorInputs = (inputs, rawTxs) => {
|
|
|
46
45
|
});
|
|
47
46
|
};
|
|
48
47
|
exports.enhanceTrezorInputs = enhanceTrezorInputs;
|
|
49
|
-
const inputToTrezor = (input, sequence) => {
|
|
50
|
-
const address_n = input.path;
|
|
48
|
+
const inputToTrezor = (input, sequence = 0xffffffff) => {
|
|
49
|
+
const address_n = (0, pathUtils_1.getHDPath)(input.path);
|
|
51
50
|
return {
|
|
52
51
|
address_n,
|
|
53
|
-
prev_index: input.
|
|
54
|
-
prev_hash:
|
|
52
|
+
prev_index: input.vout,
|
|
53
|
+
prev_hash: input.txid,
|
|
55
54
|
script_type: (0, pathUtils_1.getScriptType)(address_n),
|
|
56
55
|
amount: input.amount,
|
|
57
56
|
sequence,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ComposeOutput as ComposeOutputBase } from '@trezor/utxo-lib';
|
|
2
2
|
import { PROTO } from '../../constants';
|
|
3
3
|
import type { BitcoinNetworkInfo, ProtoWithDerivationPath } from '../../types';
|
|
4
|
-
import type { ComposeOutput } from '../../types/api/composeTransaction';
|
|
4
|
+
import type { ComposeOutput, ComposeResultFinal } from '../../types/api/composeTransaction';
|
|
5
5
|
export declare const validateTrezorOutputs: (outputs: ProtoWithDerivationPath<PROTO.TxOutputType>[], coinInfo: BitcoinNetworkInfo) => PROTO.TxOutputType[];
|
|
6
|
-
export declare const validateHDOutput: (output: ComposeOutput, coinInfo: BitcoinNetworkInfo) =>
|
|
7
|
-
export declare const outputToTrezor: (output:
|
|
6
|
+
export declare const validateHDOutput: (output: ComposeOutput, coinInfo: BitcoinNetworkInfo) => ComposeOutputBase;
|
|
7
|
+
export declare const outputToTrezor: (output: ComposeResultFinal['outputs'][number]) => PROTO.TxOutputType;
|
|
8
8
|
//# sourceMappingURL=outputs.d.ts.map
|
|
@@ -45,7 +45,7 @@ const validateHDOutput = (output, coinInfo) => {
|
|
|
45
45
|
(0, paramsValidator_1.validateParams)(output, [{ name: 'dataHex', type: 'string' }]);
|
|
46
46
|
return {
|
|
47
47
|
type: 'opreturn',
|
|
48
|
-
dataHex: output.dataHex
|
|
48
|
+
dataHex: output.dataHex,
|
|
49
49
|
};
|
|
50
50
|
case 'send-max':
|
|
51
51
|
(0, paramsValidator_1.validateParams)(output, [{ name: 'address', type: 'string', required: true }]);
|
|
@@ -54,10 +54,10 @@ const validateHDOutput = (output, coinInfo) => {
|
|
|
54
54
|
type: 'send-max',
|
|
55
55
|
address: output.address,
|
|
56
56
|
};
|
|
57
|
-
case 'noaddress':
|
|
57
|
+
case 'payment-noaddress':
|
|
58
58
|
(0, paramsValidator_1.validateParams)(output, [{ name: 'amount', type: 'uint', required: true }]);
|
|
59
59
|
return {
|
|
60
|
-
type: 'noaddress',
|
|
60
|
+
type: 'payment-noaddress',
|
|
61
61
|
amount: output.amount,
|
|
62
62
|
};
|
|
63
63
|
case 'send-max-noaddress':
|
|
@@ -71,41 +71,32 @@ const validateHDOutput = (output, coinInfo) => {
|
|
|
71
71
|
]);
|
|
72
72
|
validateAddress(output.address);
|
|
73
73
|
return {
|
|
74
|
-
type: '
|
|
74
|
+
type: 'payment',
|
|
75
75
|
address: output.address,
|
|
76
76
|
amount: output.amount,
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
exports.validateHDOutput = validateHDOutput;
|
|
81
|
-
const outputToTrezor = (output
|
|
82
|
-
if (output.
|
|
83
|
-
if (output.value) {
|
|
84
|
-
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', 'opReturn output should not contains value');
|
|
85
|
-
}
|
|
81
|
+
const outputToTrezor = (output) => {
|
|
82
|
+
if (output.type === 'opreturn') {
|
|
86
83
|
return {
|
|
87
84
|
amount: '0',
|
|
88
|
-
op_return_data: output.
|
|
85
|
+
op_return_data: output.dataHex,
|
|
89
86
|
script_type: 'PAYTOOPRETURN',
|
|
90
87
|
};
|
|
91
88
|
}
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
if (output.path) {
|
|
89
|
+
if (output.type === 'change') {
|
|
90
|
+
const address_n = (0, pathUtils_1.getHDPath)(output.path);
|
|
96
91
|
return {
|
|
97
|
-
address_n
|
|
98
|
-
amount: output.
|
|
99
|
-
script_type: (0, pathUtils_1.getOutputScriptType)(
|
|
92
|
+
address_n,
|
|
93
|
+
amount: output.amount,
|
|
94
|
+
script_type: (0, pathUtils_1.getOutputScriptType)(address_n),
|
|
100
95
|
};
|
|
101
96
|
}
|
|
102
|
-
const { address, value } = output;
|
|
103
|
-
if (typeof address !== 'string') {
|
|
104
|
-
throw constants_1.ERRORS.TypedError('Method_InvalidParameter', 'Wrong output address type, should be string');
|
|
105
|
-
}
|
|
106
97
|
return {
|
|
107
|
-
address,
|
|
108
|
-
amount:
|
|
98
|
+
address: output.address,
|
|
99
|
+
amount: output.amount,
|
|
109
100
|
script_type: 'PAYTOADDRESS',
|
|
110
101
|
};
|
|
111
102
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Payload, AbstractMethod } from '../core/AbstractMethod';
|
|
1
|
+
import { Payload, MethodReturnType, AbstractMethod } from '../core/AbstractMethod';
|
|
2
2
|
import type { CoinInfo } from '../types';
|
|
3
3
|
type Params = {
|
|
4
4
|
coinInfo: CoinInfo;
|
|
@@ -6,7 +6,7 @@ type Params = {
|
|
|
6
6
|
};
|
|
7
7
|
export default class BlockchainEstimateFee extends AbstractMethod<'blockchainEstimateFee', Params> {
|
|
8
8
|
init(): void;
|
|
9
|
-
run(): Promise<
|
|
9
|
+
run(): Promise<MethodReturnType<"blockchainEstimateFee">>;
|
|
10
10
|
}
|
|
11
11
|
export {};
|
|
12
12
|
//# sourceMappingURL=blockchainEstimateFee.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
|
+
import type { CardanoComposeTransactionParams, PrecomposedTransactionCardano } from '../../../types/api/cardanoComposeTransaction';
|
|
3
|
+
export default class CardanoComposeTransaction extends AbstractMethod<'cardanoComposeTransaction', CardanoComposeTransactionParams> {
|
|
4
|
+
init(): void;
|
|
5
|
+
get info(): string;
|
|
6
|
+
run(): Promise<PrecomposedTransactionCardano[]>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=cardanoComposeTransaction.d.ts.map
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const coin_selection_1 = require("@fivebinaries/coin-selection");
|
|
4
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
|
+
const cardanoUtils_1 = require("../cardanoUtils");
|
|
7
|
+
class CardanoComposeTransaction extends AbstractMethod_1.AbstractMethod {
|
|
8
|
+
init() {
|
|
9
|
+
const { payload } = this;
|
|
10
|
+
(0, paramsValidator_1.validateParams)(payload, [
|
|
11
|
+
{ name: 'account', type: 'object', required: true },
|
|
12
|
+
{ name: 'feeLevels', type: 'array' },
|
|
13
|
+
{ name: 'outputs', type: 'array' },
|
|
14
|
+
{ name: 'certificates', type: 'array', allowEmpty: true },
|
|
15
|
+
{ name: 'withdrawals', type: 'array', allowEmpty: true },
|
|
16
|
+
{ name: 'changeAddress', type: 'object', required: true },
|
|
17
|
+
{ name: 'addressParameters', type: 'object', required: true },
|
|
18
|
+
{ name: 'testnet', type: 'boolean' },
|
|
19
|
+
]);
|
|
20
|
+
this.useDevice = false;
|
|
21
|
+
this.useDeviceState = false;
|
|
22
|
+
this.useUi = false;
|
|
23
|
+
this.params = payload;
|
|
24
|
+
}
|
|
25
|
+
get info() {
|
|
26
|
+
return 'Compose Cardano transaction';
|
|
27
|
+
}
|
|
28
|
+
run() {
|
|
29
|
+
const { feeLevels = [{}], account, outputs = [], certificates = [], withdrawals = [], changeAddress, addressParameters, testnet, } = this.params;
|
|
30
|
+
const result = feeLevels.map(({ feePerUnit }) => {
|
|
31
|
+
try {
|
|
32
|
+
const txPlan = (0, cardanoUtils_1.composeTxPlan)(account.descriptor, account.utxo, outputs, certificates, withdrawals, changeAddress.address, !!testnet, { feeParams: feePerUnit ? { a: feePerUnit } : undefined });
|
|
33
|
+
return {
|
|
34
|
+
fee: txPlan.fee,
|
|
35
|
+
feePerByte: feePerUnit !== null && feePerUnit !== void 0 ? feePerUnit : '0',
|
|
36
|
+
deposit: txPlan.deposit,
|
|
37
|
+
totalSpent: txPlan.totalSpent,
|
|
38
|
+
max: txPlan.max,
|
|
39
|
+
...(txPlan.type === 'nonfinal'
|
|
40
|
+
? {
|
|
41
|
+
type: txPlan.type,
|
|
42
|
+
bytes: 0,
|
|
43
|
+
}
|
|
44
|
+
: {
|
|
45
|
+
type: txPlan.type,
|
|
46
|
+
bytes: txPlan.tx.size,
|
|
47
|
+
ttl: txPlan.ttl,
|
|
48
|
+
inputs: coin_selection_1.trezorUtils.transformToTrezorInputs(txPlan.inputs, account.utxo),
|
|
49
|
+
outputs: coin_selection_1.trezorUtils.transformToTrezorOutputs(txPlan.outputs, addressParameters),
|
|
50
|
+
unsignedTx: txPlan.tx,
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (error instanceof coin_selection_1.CoinSelectionError &&
|
|
56
|
+
error.code === 'UTXO_BALANCE_INSUFFICIENT') {
|
|
57
|
+
return { type: 'error', error: 'UTXO_BALANCE_INSUFFICIENT' };
|
|
58
|
+
}
|
|
59
|
+
if (error instanceof coin_selection_1.CoinSelectionError && error.code === 'UTXO_VALUE_TOO_SMALL') {
|
|
60
|
+
return { type: 'error', error: 'UTXO_VALUE_TOO_SMALL' };
|
|
61
|
+
}
|
|
62
|
+
return { type: 'error', error: error.message };
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return Promise.resolve(result);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.default = CardanoComposeTransaction;
|
|
69
|
+
//# sourceMappingURL=cardanoComposeTransaction.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractMethod } from '
|
|
2
|
-
import { PROTO } from '
|
|
1
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
|
+
import { PROTO } from '../../../constants';
|
|
3
3
|
type Params = PROTO.CardanoGetAddress & {
|
|
4
4
|
address?: string;
|
|
5
5
|
};
|
|
@@ -18,7 +18,7 @@ export default class CardanoGetAddress extends AbstractMethod<'cardanoGetAddress
|
|
|
18
18
|
noBackupConfirmation(): Promise<boolean>;
|
|
19
19
|
_call({ address_parameters, protocol_magic, network_id, derivation_type, show_display, }: Params): Promise<PROTO.CardanoAddress>;
|
|
20
20
|
_ensureFirmwareSupportsBatch(batch: Params): void;
|
|
21
|
-
run(): Promise<import("
|
|
21
|
+
run(): Promise<import("../../..").CardanoAddress | import("../../..").CardanoAddress[]>;
|
|
22
22
|
}
|
|
23
23
|
export {};
|
|
24
24
|
//# sourceMappingURL=cardanoGetAddress.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const AbstractMethod_1 = require("
|
|
4
|
-
const paramsValidator_1 = require("
|
|
5
|
-
const coinInfo_1 = require("
|
|
6
|
-
const pathUtils_1 = require("
|
|
7
|
-
const cardanoAddressParameters_1 = require("
|
|
8
|
-
const constants_1 = require("
|
|
9
|
-
const events_1 = require("
|
|
3
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
4
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
5
|
+
const coinInfo_1 = require("../../../data/coinInfo");
|
|
6
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
7
|
+
const cardanoAddressParameters_1 = require("../cardanoAddressParameters");
|
|
8
|
+
const constants_1 = require("../../../constants");
|
|
9
|
+
const events_1 = require("../../../events");
|
|
10
10
|
class CardanoGetAddress extends AbstractMethod_1.AbstractMethod {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
package/lib/api/{cardanoGetNativeScriptHash.d.ts → cardano/api/cardanoGetNativeScriptHash.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PROTO } from '
|
|
2
|
-
import { AbstractMethod } from '
|
|
3
|
-
import type { CardanoNativeScript } from '
|
|
1
|
+
import { PROTO } from '../../../constants';
|
|
2
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
3
|
+
import type { CardanoNativeScript } from '../../../types/api/cardano';
|
|
4
4
|
export default class CardanoGetNativeScriptHash extends AbstractMethod<'cardanoGetNativeScriptHash', PROTO.CardanoGetNativeScriptHash> {
|
|
5
5
|
init(): void;
|
|
6
6
|
get info(): string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const constants_1 = require("
|
|
4
|
-
const AbstractMethod_1 = require("
|
|
5
|
-
const paramsValidator_1 = require("
|
|
6
|
-
const coinInfo_1 = require("
|
|
7
|
-
const pathUtils_1 = require("
|
|
3
|
+
const constants_1 = require("../../../constants");
|
|
4
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
|
+
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
8
|
class CardanoGetNativeScriptHash extends AbstractMethod_1.AbstractMethod {
|
|
9
9
|
init() {
|
|
10
10
|
this.requiredPermissions = ['read'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PROTO } from '
|
|
2
|
-
import { AbstractMethod } from '
|
|
1
|
+
import { PROTO } from '../../../constants';
|
|
2
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
3
3
|
interface Params extends PROTO.CardanoGetPublicKey {
|
|
4
4
|
suppressBackupWarning?: boolean;
|
|
5
5
|
}
|
|
@@ -10,7 +10,7 @@ export default class CardanoGetPublicKey extends AbstractMethod<'cardanoGetPubli
|
|
|
10
10
|
get info(): string;
|
|
11
11
|
confirmation(): Promise<boolean>;
|
|
12
12
|
noBackupConfirmation(allowSuppression?: boolean): Promise<boolean>;
|
|
13
|
-
run(): Promise<import("
|
|
13
|
+
run(): Promise<import("../../..").CardanoPublicKey | import("../../..").CardanoPublicKey[]>;
|
|
14
14
|
}
|
|
15
15
|
export {};
|
|
16
16
|
//# sourceMappingURL=cardanoGetPublicKey.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const constants_1 = require("
|
|
4
|
-
const AbstractMethod_1 = require("
|
|
5
|
-
const paramsValidator_1 = require("
|
|
6
|
-
const coinInfo_1 = require("
|
|
7
|
-
const pathUtils_1 = require("
|
|
8
|
-
const events_1 = require("
|
|
3
|
+
const constants_1 = require("../../../constants");
|
|
4
|
+
const AbstractMethod_1 = require("../../../core/AbstractMethod");
|
|
5
|
+
const paramsValidator_1 = require("../../common/paramsValidator");
|
|
6
|
+
const coinInfo_1 = require("../../../data/coinInfo");
|
|
7
|
+
const pathUtils_1 = require("../../../utils/pathUtils");
|
|
8
|
+
const events_1 = require("../../../events");
|
|
9
9
|
class CardanoGetPublicKey extends AbstractMethod_1.AbstractMethod {
|
|
10
10
|
init() {
|
|
11
11
|
this.requiredPermissions = ['read'];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AbstractMethod } from '
|
|
2
|
-
import type { CertificateWithPoolOwnersAndRelays } from '
|
|
3
|
-
import { Path, InputWithPath, CollateralInputWithPath } from '
|
|
4
|
-
import type { OutputWithData } from '
|
|
5
|
-
import { PROTO } from '
|
|
6
|
-
import type { CardanoSignedTxData } from '
|
|
7
|
-
import type { AssetGroupWithTokens } from '
|
|
1
|
+
import { AbstractMethod } from '../../../core/AbstractMethod';
|
|
2
|
+
import type { CertificateWithPoolOwnersAndRelays } from '../cardanoCertificate';
|
|
3
|
+
import { Path, InputWithPath, CollateralInputWithPath } from '../cardanoInputs';
|
|
4
|
+
import type { OutputWithData } from '../cardanoOutputs';
|
|
5
|
+
import { PROTO } from '../../../constants';
|
|
6
|
+
import type { CardanoAuxiliaryDataSupplement, CardanoSignedTxData, CardanoSignedTxWitness } from '../../../types/api/cardano';
|
|
7
|
+
import type { AssetGroupWithTokens } from '../cardanoTokenBundle';
|
|
8
8
|
declare const CardanoSignTransactionFeatures: Readonly<{
|
|
9
9
|
TransactionStreaming: string[];
|
|
10
10
|
TokenMinting: string[];
|
|
@@ -41,6 +41,11 @@ export type CardanoSignTransactionParams = {
|
|
|
41
41
|
additionalWitnessRequests: Path[];
|
|
42
42
|
derivationType: PROTO.CardanoDerivationType;
|
|
43
43
|
includeNetworkId?: boolean;
|
|
44
|
+
unsignedTx?: {
|
|
45
|
+
body: string;
|
|
46
|
+
hash: string;
|
|
47
|
+
};
|
|
48
|
+
testnet?: boolean;
|
|
44
49
|
};
|
|
45
50
|
export default class CardanoSignTransaction extends AbstractMethod<'cardanoSignTransaction', CardanoSignTransactionParams> {
|
|
46
51
|
init(): void;
|
|
@@ -49,7 +54,12 @@ export default class CardanoSignTransaction extends AbstractMethod<'cardanoSignT
|
|
|
49
54
|
_ensureFeatureIsSupported(feature: keyof typeof CardanoSignTransactionFeatures): void;
|
|
50
55
|
_ensureFirmwareSupportsParams(): void;
|
|
51
56
|
_sign_tx(): Promise<CardanoSignedTxData>;
|
|
52
|
-
run(): Promise<CardanoSignedTxData
|
|
57
|
+
run(): Promise<CardanoSignedTxData | {
|
|
58
|
+
serializedTx: string;
|
|
59
|
+
hash: string;
|
|
60
|
+
witnesses: CardanoSignedTxWitness[];
|
|
61
|
+
auxiliaryDataSupplement?: CardanoAuxiliaryDataSupplement | undefined;
|
|
62
|
+
}>;
|
|
53
63
|
}
|
|
54
64
|
export {};
|
|
55
65
|
//# sourceMappingURL=cardanoSignTransaction.d.ts.map
|