@emurgo/yoroi-lib-core
Advanced tools
Comparing version 0.8.1-alpha.43 to 0.8.2-alpha.44
@@ -250,3 +250,5 @@ "use strict"; | ||
const unsignedTx = (yield this.newAdaUnsignedTx([], defaultToken, changeAddr, utxos, absSlotNumber, protocolParams, stakeDelegationCerts, [], undefined, { | ||
neededHashes: new Set(), | ||
neededHashes: new Set([ | ||
Buffer.from(yield this.Wasm.StakeCredential.fromKeyhash(yield stakingKey.hash()).then(x => x.toBytes())).toString('hex') | ||
]), | ||
wits: new Set() | ||
@@ -253,0 +255,0 @@ }, txOptions, false, undefined, stakingKey, valueInAccount, [])); |
@@ -90,6 +90,3 @@ import * as WasmContract from './wasm-contract'; | ||
}, metadata: ReadonlyArray<TxMetadata>, auxiliaryData: WasmContract.AuxiliaryData | undefined, catalystRegistrationData: CatalystRegistrationData | undefined, stakingKey: WasmContract.PublicKey | undefined, valueInAccount: MultiTokenValue | undefined, withdrawalRequests: Array<WithdrawalRequest>): Promise<WasmUnsignedTx>; | ||
sign(keyLevel: number, privateKey: string, stakingKeyWits: Set<string>, stakingKeys?: { | ||
rewardAddress: string; | ||
privateKey: WasmContract.PrivateKey; | ||
}[]): Promise<SignedTx>; | ||
sign(keyLevel: number, privateKey: string, stakingKeyWits: Set<string>, stakingKeys?: WasmContract.PrivateKey[]): Promise<SignedTx>; | ||
private addWitnesses; | ||
@@ -135,6 +132,3 @@ } | ||
readonly withdrawalRequests: Array<WithdrawalRequest>; | ||
sign(keyLevel: number, privateKey: string, stakingKeyWits: Set<string>, stakingKeys?: { | ||
rewardAddress: string; | ||
privateKey: WasmContract.PrivateKey; | ||
}[]): Promise<SignedTx>; | ||
sign(keyLevel: number, privateKey: string, stakingKeyWits: Set<string>, stakingKeys?: WasmContract.PrivateKey[]): Promise<SignedTx>; | ||
} | ||
@@ -141,0 +135,0 @@ export declare function genWasmUnsignedTx(wasm: WasmContract.WasmModuleProxy, defaultToken: Token, txBuilder: WasmContract.TransactionBuilder, senderUtxos: CardanoAddressedUtxo[], allUtxos: CardanoAddressedUtxo[], change: ReadonlyArray<Change>, defaults: Token, networkId: number, neededStakingKeyHashes: { |
@@ -183,3 +183,3 @@ "use strict"; | ||
} | ||
sign(keyLevel, privateKey, stakingKeyWits, stakingKeys = []) { | ||
sign(keyLevel, privateKey, stakingKeyWits, stakingKeys) { | ||
var _a; | ||
@@ -233,9 +233,10 @@ return __awaiter(this, void 0, void 0, function* () { | ||
} | ||
for (const withdrawalRequest of this.withdrawalRequests) { | ||
const stakingKey = stakingKeys.find(s => s.rewardAddress === withdrawalRequest.rewardAddress); | ||
if (stakingKey) { | ||
const vkeyWitness = yield this._wasm.makeVkeyWitness(yield this._wasm.hashTransaction(this.txBody), stakingKey.privateKey); | ||
const witness = Buffer.from(yield vkeyWitness.toBytes()).toString('hex'); | ||
stakingKeySigSet.add(witness); | ||
yield vkeyWits.add(yield this._wasm.Vkeywitness.fromBytes(Buffer.from(witness, 'hex'))); | ||
if (stakingKeys) { | ||
for (const stakingKey of stakingKeys) { | ||
if (stakingKey && stakingKey.hasValue()) { | ||
const vkeyWitness = yield this._wasm.makeVkeyWitness(yield this._wasm.hashTransaction(this.txBody), stakingKey); | ||
const witness = Buffer.from(yield vkeyWitness.toBytes()).toString('hex'); | ||
stakingKeySigSet.add(witness); | ||
yield vkeyWits.add(yield this._wasm.Vkeywitness.fromBytes(Buffer.from(witness, 'hex'))); | ||
} | ||
} | ||
@@ -248,2 +249,3 @@ } | ||
yield witnessSet.setVkeys(vkeyWits); | ||
console.log(yield vkeyWits.len()); | ||
const signedTx = yield this._wasm.Transaction.new(this._txBody, witnessSet, this.auxiliaryData && ((_a = this._auxiliaryData) === null || _a === void 0 ? void 0 : _a.hasValue()) | ||
@@ -250,0 +252,0 @@ ? this.auxiliaryData |
{ | ||
"name": "@emurgo/yoroi-lib-core", | ||
"version": "0.8.1-alpha.43", | ||
"version": "0.8.2-alpha.44", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
291176
5137