@emurgo/yoroi-lib-core
Advanced tools
Comparing version 0.2.1-alpha.22 to 0.2.2-alpha.23
@@ -12,2 +12,3 @@ import * as WasmContract from './wasm-contract'; | ||
private _withdrawals; | ||
private _deregistrations; | ||
private _ttl; | ||
@@ -44,2 +45,3 @@ private _neededStakingKeyHashes; | ||
get withdrawals(): WasmContract.Withdrawals; | ||
get deregistrations(): ReadonlyArray<WasmContract.StakeDeregistration>; | ||
get ttl(): number | undefined; | ||
@@ -62,3 +64,3 @@ get neededStakingKeyHashes(): { | ||
value: MultiTokenValue; | ||
}>, totalOutput: MultiTokenValue, fee: MultiTokenValue, change: ReadonlyArray<Change>, metadata: ReadonlyArray<TxMetadata>, certificates: WasmContract.Certificates, withdrawals: WasmContract.Withdrawals, ttl: number | undefined, neededStakingKeyHashes: { | ||
}>, totalOutput: MultiTokenValue, fee: MultiTokenValue, change: ReadonlyArray<Change>, metadata: ReadonlyArray<TxMetadata>, certificates: WasmContract.Certificates, withdrawals: WasmContract.Withdrawals, deregistrations: WasmContract.StakeDeregistration[], ttl: number | undefined, neededStakingKeyHashes: { | ||
neededHashes: Set<string>; | ||
@@ -97,2 +99,3 @@ wits: Set<string>; | ||
readonly withdrawals: WasmContract.Withdrawals; | ||
readonly deregistrations: ReadonlyArray<WasmContract.StakeDeregistration>; | ||
readonly ttl: number | undefined; | ||
@@ -107,8 +110,2 @@ readonly neededStakingKeyHashes: { | ||
} | ||
export interface UnsignedWithdrawalTx extends UnsignedTx { | ||
neededStakingKeyHashes: { | ||
neededHashes: Set<string>; | ||
wits: Set<string>; | ||
}; | ||
} | ||
export declare function genWasmUnsignedTx(wasm: WasmContract.WasmModuleProxy, txBuilder: WasmContract.TransactionBuilder, senderUtxos: CardanoAddressedUtxo[], change: ReadonlyArray<Change>, defaults: Token, networkId: number, neededStakingKeyHashes: { | ||
@@ -115,0 +112,0 @@ neededHashes: Set<string>; |
@@ -46,3 +46,3 @@ "use strict"; | ||
*/ | ||
constructor(wasm, txBody, senderUtxos, inputs, totalInput, outputs, totalOutput, fee, change, metadata, certificates, withdrawals, ttl, neededStakingKeyHashes, encodedTx, hash) { | ||
constructor(wasm, txBody, senderUtxos, inputs, totalInput, outputs, totalOutput, fee, change, metadata, certificates, withdrawals, deregistrations, ttl, neededStakingKeyHashes, encodedTx, hash) { | ||
this._wasm = wasm; | ||
@@ -60,2 +60,3 @@ this._txBody = txBody; | ||
this._withdrawals = withdrawals; | ||
this._deregistrations = deregistrations; | ||
this._ttl = ttl; | ||
@@ -105,2 +106,5 @@ this._neededStakingKeyHashes = neededStakingKeyHashes; | ||
} | ||
get deregistrations() { | ||
return this._deregistrations; | ||
} | ||
get ttl() { | ||
@@ -123,3 +127,15 @@ return this._ttl; | ||
const hash = yield wasm.hashTransaction(txBody); | ||
return new WasmUnsignedTx(wasm, txBody, senderUtxos, inputs, totalInput, outputs, totalOutput, fee, change, metadata, certs, withdrawals, ttl, neededStakingKeyHashes, Buffer.from(txBytes).toString('hex'), hash); | ||
const deregistrations = []; | ||
if (certs.hasValue()) { | ||
for (let i = 0; i < (yield certs.len()); i++) { | ||
const cert = yield certs.get(i); | ||
try { | ||
deregistrations.push(yield cert.asStakeDeregistration()); | ||
} | ||
catch (_a) { | ||
// not a deregistration, ignore | ||
} | ||
} | ||
} | ||
return new WasmUnsignedTx(wasm, txBody, senderUtxos, inputs, totalInput, outputs, totalOutput, fee, change, metadata, certs, withdrawals, deregistrations, ttl, neededStakingKeyHashes, Buffer.from(txBytes).toString('hex'), hash); | ||
}); | ||
@@ -126,0 +142,0 @@ } |
{ | ||
"name": "@emurgo/yoroi-lib-core", | ||
"version": "0.2.1-alpha.22", | ||
"version": "0.2.2-alpha.23", | ||
"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
240004
4332