Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@onekeyfe/cardano-coin-selection-asmjs

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onekeyfe/cardano-coin-selection-asmjs - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

27

lib/cjs/utils/onekey/txToOneKey.js

@@ -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": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc