Socket
Socket
Sign inDemoInstall

@harmoniclabs/cardano-ledger-ts

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@harmoniclabs/cardano-ledger-ts - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

4

dist/ledger/Address.d.ts

@@ -31,5 +31,5 @@ import { ToCbor, CborObj, CborString, CanBeCborString } from "@harmoniclabs/cbor";

static fromCbor(cbor: CanBeCborString): Address;
toString(): string;
toString(): AddressStr;
static fromString(addr: string): Address;
toJson(): string;
toJson(): `addr1${string}` | `addr_test1${string}`;
}

@@ -25,3 +25,3 @@ "use strict";

(0, obj_utils_1.defineReadOnlyProperty)(this, "type", scriptType);
if (!(0, uint8array_utils_1.isUint8Array)(bytes)) {
if (!(bytes instanceof Uint8Array)) {
if (bytes.type === ScriptType.PlutusV1 ||

@@ -28,0 +28,0 @@ bytes.type === ScriptType.PlutusV2) {

@@ -29,3 +29,3 @@ import { ToCbor, CborString, CborMap, CanBeCborString, CborObj } from "@harmoniclabs/cbor";

toJson(): {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -32,0 +32,0 @@ datum: any;

@@ -25,3 +25,3 @@ import { ToCbor, CborString, CborArray, CanBeCborString, CborObj } from "@harmoniclabs/cbor";

resolved: {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -28,0 +28,0 @@ datum: any;

@@ -65,3 +65,3 @@ import { ToCbor, CborString, CborObj, CanBeCborString } from "@harmoniclabs/cbor";

resolved: {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -77,3 +77,3 @@ datum: any;

outputs: {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -222,3 +222,3 @@ datum: any;

resolved: {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -236,3 +236,3 @@ datum: any;

collateralReturn: {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -250,3 +250,3 @@ datum: any;

resolved: {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -253,0 +253,0 @@ datum: any;

@@ -14,2 +14,11 @@ import { PrivateKey } from "../credentials/index.js";

}
export interface Cip30LikeSignTx {
/**
*
* @param {string} txCbor receives the current transaction (`this`) cbor
* @param {boolean} partial (standard parameter) wheather to throw or not if the wallet can not sign the entire transaction (`true` always passed)
* @returns {string} the cbor of the `TxWitnessSet` (!!! NOT the cbor of the signe transaction !!!)
*/
signTx: (txCbor: string, partial?: boolean) => string;
}
export declare class Tx implements ITx, ToCbor, ToJson {

@@ -36,2 +45,8 @@ readonly body: TxBody;

/**
* signs the transaction using any browser wallet
* that follows the [CIP-0030 standard]
* (https://github.com/cardano-foundation/CIPs/tree/master/CIP-0030#apisigntxtx-cbortransaction-partialsign-bool--false-promisecbortransaction_witness_set)
**/
readonly signWithCip30Wallet: (cip30wallet: Cip30LikeSignTx) => void;
/**
* @returns {boolean}

@@ -62,3 +77,3 @@ * `true` if all the signers needed

resolved: {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -74,3 +89,3 @@ datum: any;

outputs: {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -140,5 +155,3 @@ datum: any;

type: string;
port: number | undefined; /**
* getter
*/
port: number | undefined;
dnsName: string;

@@ -150,5 +163,3 @@ ipv4?: undefined;

dnsName: string;
port?: undefined; /**
* getter
*/
port?: undefined;
ipv4?: undefined;

@@ -225,3 +236,3 @@ ipv6?: undefined;

resolved: {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -239,3 +250,3 @@ datum: any;

collateralReturn: {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -253,3 +264,3 @@ datum: any;

resolved: {
address: string;
address: `addr1${string}` | `addr_test1${string}`;
value: object;

@@ -267,3 +278,7 @@ datum: any;

vkeyWitnesses: {
vkey: string;
vkey: string; /**
* signs the transaction using any browser wallet
* that follows the [CIP-0030 standard]
* (https://github.com/cardano-foundation/CIPs/tree/master/CIP-0030#apisigntxtx-cbortransaction-partialsign-bool--false-promisecbortransaction_witness_set)
**/
signature: string;

@@ -270,0 +285,0 @@ }[] | undefined;

@@ -18,2 +18,13 @@ "use strict";

};
var __values = (this && this.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {

@@ -68,2 +79,21 @@ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {

});
(0, obj_utils_1.defineReadOnlyProperty)(this, "signWithCip30Wallet", function (cip30) {
var e_1, _a;
var wits = TxWitnessSet_1.TxWitnessSet.fromCbor(cip30.signTx(
// signTx expects the entire transaction by standard (not only the body ¯\_(ツ)_/¯)
_this.toCbor().toString(), true));
try {
for (var _b = __values(wits.vkeyWitnesses), _c = _b.next(); !_c.done; _c = _b.next()) {
var wit = _c.value;
_this.addVKeyWitness(wit);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
}
finally { if (e_1) throw e_1.error; }
}
});
Object.defineProperty(this, "isComplete", {

@@ -70,0 +100,0 @@ // calls the `TxWitnessSet` getter

{
"name": "@harmoniclabs/cardano-ledger-ts",
"version": "0.1.1",
"version": "0.1.2",
"description": "",

@@ -47,3 +47,3 @@ "main": "./dist/index.js",

"@harmoniclabs/cardano-costmodels-ts": "^1.0.0",
"@harmoniclabs/plutus-machine": "^1.0.0"
"@harmoniclabs/plutus-machine": "^1.0.2"
},

@@ -50,0 +50,0 @@ "devDependencies": {

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