@onekeyfe/cardano-coin-selection-asmjs
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -75,3 +75,2 @@ "use strict"; | ||
const outputsToOneKey = (outputs, changeAddress) => { | ||
var _a, _b; | ||
const onekeyOutputs = []; | ||
@@ -151,11 +150,11 @@ for (let i = 0; i < outputs.len(); i++) { | ||
}; | ||
const datumHash = (!output.has_plutus_data() || | ||
(output.has_plutus_data() && ((_a = output.plutus_data()) === null || _a === void 0 ? void 0 : _a.kind()) === 0)) && | ||
output.has_data_hash() | ||
// https://github.com/dcSpark/cardano-multiplatform-lib/blob/c6a6d110065e98ed50640c7380d12748856608cf/chain/rust/src/transaction/mod.rs#L87 | ||
// https://github.com/dcSpark/cardano-multiplatform-lib/blob/c6a6d110065e98ed50640c7380d12748856608cf/chain/rust/src/transaction/mod.rs#L117-L136 | ||
// data_hash : kind = 0 | ||
// plutus_data : kind = 1 | ||
const datumHash = output.has_data_hash() | ||
? output.data_hash().to_hex() | ||
: null; | ||
const inlineDatum = output.has_data_hash() && | ||
output.has_plutus_data() && | ||
((_b = output.plutus_data()) === null || _b === void 0 ? void 0 : _b.kind()) === 1 | ||
? output.data_hash().to_hex() | ||
const inlineDatum = output.has_plutus_data() | ||
? output.plutus_data().to_hex() | ||
: null; | ||
@@ -174,3 +173,7 @@ // const datumHash = | ||
const outputRes = Object.assign({ amount: output.amount().coin().to_str(), tokenBundle, | ||
datumHash, format: inlineDatum || referenceScript ? 1 : 0, inlineDatum, | ||
datumHash, | ||
// https://github.com/input-output-hk/nami/commit/a5f5a9357da81307bff9bc77ef2476f1746c134a#diff-1c7110974e24c349d96acac1989fe76c94b0031ab0f5a114e10823e5d74549deR421-R423 | ||
format: Buffer.from(output.to_bytes()).toString('hex').startsWith('a') | ||
? 1 | ||
: 0, inlineDatum, | ||
referenceScript }, destination); | ||
@@ -433,2 +436,8 @@ if (!tokenBundle) | ||
} | ||
else if (signer === keys.stake.hash) { | ||
// https://github.com/input-output-hk/nami/commit/a5f5a9357da81307bff9bc77ef2476f1746c134a#diff-1c7110974e24c349d96acac1989fe76c94b0031ab0f5a114e10823e5d74549deR421-R423 | ||
requiredSigners.push({ | ||
keyPath: keys.stake.path, | ||
}); | ||
} | ||
else { | ||
@@ -435,0 +444,0 @@ requiredSigners.push({ |
@@ -49,3 +49,2 @@ // @ts-nocheck | ||
const outputsToOneKey = (outputs, changeAddress) => { | ||
var _a, _b; | ||
const onekeyOutputs = []; | ||
@@ -125,11 +124,11 @@ for (let i = 0; i < outputs.len(); i++) { | ||
}; | ||
const datumHash = (!output.has_plutus_data() || | ||
(output.has_plutus_data() && ((_a = output.plutus_data()) === null || _a === void 0 ? void 0 : _a.kind()) === 0)) && | ||
output.has_data_hash() | ||
// https://github.com/dcSpark/cardano-multiplatform-lib/blob/c6a6d110065e98ed50640c7380d12748856608cf/chain/rust/src/transaction/mod.rs#L87 | ||
// https://github.com/dcSpark/cardano-multiplatform-lib/blob/c6a6d110065e98ed50640c7380d12748856608cf/chain/rust/src/transaction/mod.rs#L117-L136 | ||
// data_hash : kind = 0 | ||
// plutus_data : kind = 1 | ||
const datumHash = output.has_data_hash() | ||
? output.data_hash().to_hex() | ||
: null; | ||
const inlineDatum = output.has_data_hash() && | ||
output.has_plutus_data() && | ||
((_b = output.plutus_data()) === null || _b === void 0 ? void 0 : _b.kind()) === 1 | ||
? output.data_hash().to_hex() | ||
const inlineDatum = output.has_plutus_data() | ||
? output.plutus_data().to_hex() | ||
: null; | ||
@@ -148,3 +147,7 @@ // const datumHash = | ||
const outputRes = Object.assign({ amount: output.amount().coin().to_str(), tokenBundle, | ||
datumHash, format: inlineDatum || referenceScript ? 1 : 0, inlineDatum, | ||
datumHash, | ||
// https://github.com/input-output-hk/nami/commit/a5f5a9357da81307bff9bc77ef2476f1746c134a#diff-1c7110974e24c349d96acac1989fe76c94b0031ab0f5a114e10823e5d74549deR421-R423 | ||
format: Buffer.from(output.to_bytes()).toString('hex').startsWith('a') | ||
? 1 | ||
: 0, inlineDatum, | ||
referenceScript }, destination); | ||
@@ -407,2 +410,8 @@ if (!tokenBundle) | ||
} | ||
else if (signer === keys.stake.hash) { | ||
// https://github.com/input-output-hk/nami/commit/a5f5a9357da81307bff9bc77ef2476f1746c134a#diff-1c7110974e24c349d96acac1989fe76c94b0031ab0f5a114e10823e5d74549deR421-R423 | ||
requiredSigners.push({ | ||
keyPath: keys.stake.path, | ||
}); | ||
} | ||
else { | ||
@@ -409,0 +418,0 @@ requiredSigners.push({ |
{ | ||
"name": "@onekeyfe/cardano-coin-selection-asmjs", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
267260
5700