@emurgo/yoroi-lib
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -39,2 +39,3 @@ "use strict"; | ||
const body = yield tx.body(); | ||
yield (0, ledger_1.assertTagsState)(wasm, body); | ||
const ttl = yield body.ttl() | ||
@@ -100,2 +101,5 @@ .then((n) => n === null || n === void 0 ? void 0 : n.toString()); | ||
additionalWitnessPaths: [], | ||
options: { | ||
tagCborSets: yield (0, ledger_1.doAllSetsHaveTag)(wasm, body) | ||
} | ||
}; | ||
@@ -102,0 +106,0 @@ }); |
import { Addressing, AddressingAddress } from "../models"; | ||
import { Address, Certificates, MultiAsset, TransactionOutputs, Withdrawals } from "@emurgo/cross-csl-core"; | ||
import { Address, Certificates, MultiAsset, TransactionBody, TransactionOutputs, WasmModuleProxy, Withdrawals } from "@emurgo/cross-csl-core"; | ||
import * as WasmContract from '@emurgo/cross-csl-core'; | ||
@@ -24,1 +24,3 @@ import { Certificate as LedgerCertificate, AssetGroup as LedgerAssetGroup, TxOutput as LedgerTxOutput, TxInput as LedgerTxInput, DeviceOwnedAddress as LedgerDeviceOwnedAddress, Withdrawal as LedgerWithdrawal } from '@cardano-foundation/ledgerjs-hw-app-cardano'; | ||
export declare const formatLedgerWithdrawals: (withdrawals: Withdrawals, stakingDerivationPath: number[]) => Promise<Array<LedgerWithdrawal>>; | ||
export declare const assertTagsState: (wasm: WasmModuleProxy, txBody: TransactionBody) => Promise<void>; | ||
export declare const doAllSetsHaveTag: (wasm: WasmModuleProxy, txBody: TransactionBody) => Promise<boolean>; |
@@ -31,3 +31,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.formatLedgerWithdrawals = exports.formatLedgerCertificates = exports.compareCborKey = exports.toLedgerTokenBundle = exports.toLedgerAddressParameters = exports.verifyFromBip44Root = exports.transformToLedgerOutputs = exports.transformToLedgerInputs = void 0; | ||
exports.doAllSetsHaveTag = exports.assertTagsState = exports.formatLedgerWithdrawals = exports.formatLedgerCertificates = exports.compareCborKey = exports.toLedgerTokenBundle = exports.toLedgerAddressParameters = exports.verifyFromBip44Root = exports.transformToLedgerOutputs = exports.transformToLedgerInputs = void 0; | ||
const models_1 = require("../models"); | ||
@@ -409,1 +409,15 @@ const addresses_1 = require("./addresses"); | ||
exports.formatLedgerWithdrawals = formatLedgerWithdrawals; | ||
const assertTagsState = (wasm, txBody) => __awaiter(void 0, void 0, void 0, function* () { | ||
const fixedTransaction = yield wasm.FixedTransaction.newFromBodyBytes(yield txBody.toBytes()); | ||
const tagsState = yield wasm.hasTransactionSetTag(yield fixedTransaction.toBytes()); | ||
if (tagsState === wasm.TransactionSetsState.MixedSets) { | ||
throw new Error('Transaction with mixed sets cannot be signed by Ledger'); | ||
} | ||
}); | ||
exports.assertTagsState = assertTagsState; | ||
const doAllSetsHaveTag = (wasm, txBody) => __awaiter(void 0, void 0, void 0, function* () { | ||
const fixedTransaction = yield wasm.FixedTransaction.newFromBodyBytes(yield txBody.toBytes()); | ||
const tagsState = yield wasm.hasTransactionSetTag(yield fixedTransaction.toBytes()); | ||
return tagsState === wasm.TransactionSetsState.AllSetsHaveTag; | ||
}); | ||
exports.doAllSetsHaveTag = doAllSetsHaveTag; |
{ | ||
"name": "@emurgo/yoroi-lib", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
344902
6281