@meshsdk/transaction 1.6.13 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +32 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +32 -0
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -323,6 +323,38 @@ var MeshTxBuilderCore = class {
|
|
|
323
323
|
}
|
|
324
324
|
return this;
|
|
325
325
|
};
|
|
326
|
+
/**
|
|
327
|
+
* Set the output embed datum for transaction
|
|
328
|
+
* @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
329
|
+
* @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
330
|
+
* @returns The MeshTxBuilder instance
|
|
331
|
+
*/
|
|
332
|
+
txOutDatumEmbedValue = (datum, type = "Mesh") => {
|
|
333
|
+
let content = datum;
|
|
334
|
+
if (this.txOutput) {
|
|
335
|
+
if (type === "Mesh") {
|
|
336
|
+
this.txOutput.datum = {
|
|
337
|
+
type: "Embedded",
|
|
338
|
+
data: {
|
|
339
|
+
type,
|
|
340
|
+
content
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
return this;
|
|
344
|
+
}
|
|
345
|
+
if (type === "JSON") {
|
|
346
|
+
content = this.castRawDataToJsonString(datum);
|
|
347
|
+
}
|
|
348
|
+
this.txOutput.datum = {
|
|
349
|
+
type: "Embedded",
|
|
350
|
+
data: {
|
|
351
|
+
type,
|
|
352
|
+
content
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
return this;
|
|
357
|
+
};
|
|
326
358
|
/**
|
|
327
359
|
* Set the reference script to be attached with the output
|
|
328
360
|
* @param scriptCbor The CBOR hex of the script to be attached to UTxO as reference script
|
package/dist/index.d.cts
CHANGED
|
@@ -77,6 +77,13 @@ declare class MeshTxBuilderCore {
|
|
|
77
77
|
* @returns The MeshTxBuilder instance
|
|
78
78
|
*/
|
|
79
79
|
txOutInlineDatumValue: (datum: BuilderData["content"], type?: BuilderData["type"]) => this;
|
|
80
|
+
/**
|
|
81
|
+
* Set the output embed datum for transaction
|
|
82
|
+
* @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
83
|
+
* @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
84
|
+
* @returns The MeshTxBuilder instance
|
|
85
|
+
*/
|
|
86
|
+
txOutDatumEmbedValue: (datum: BuilderData["content"], type?: BuilderData["type"]) => this;
|
|
80
87
|
/**
|
|
81
88
|
* Set the reference script to be attached with the output
|
|
82
89
|
* @param scriptCbor The CBOR hex of the script to be attached to UTxO as reference script
|
package/dist/index.d.ts
CHANGED
|
@@ -77,6 +77,13 @@ declare class MeshTxBuilderCore {
|
|
|
77
77
|
* @returns The MeshTxBuilder instance
|
|
78
78
|
*/
|
|
79
79
|
txOutInlineDatumValue: (datum: BuilderData["content"], type?: BuilderData["type"]) => this;
|
|
80
|
+
/**
|
|
81
|
+
* Set the output embed datum for transaction
|
|
82
|
+
* @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
83
|
+
* @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
84
|
+
* @returns The MeshTxBuilder instance
|
|
85
|
+
*/
|
|
86
|
+
txOutDatumEmbedValue: (datum: BuilderData["content"], type?: BuilderData["type"]) => this;
|
|
80
87
|
/**
|
|
81
88
|
* Set the reference script to be attached with the output
|
|
82
89
|
* @param scriptCbor The CBOR hex of the script to be attached to UTxO as reference script
|
package/dist/index.js
CHANGED
|
@@ -289,6 +289,38 @@ var MeshTxBuilderCore = class {
|
|
|
289
289
|
}
|
|
290
290
|
return this;
|
|
291
291
|
};
|
|
292
|
+
/**
|
|
293
|
+
* Set the output embed datum for transaction
|
|
294
|
+
* @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
295
|
+
* @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
296
|
+
* @returns The MeshTxBuilder instance
|
|
297
|
+
*/
|
|
298
|
+
txOutDatumEmbedValue = (datum, type = "Mesh") => {
|
|
299
|
+
let content = datum;
|
|
300
|
+
if (this.txOutput) {
|
|
301
|
+
if (type === "Mesh") {
|
|
302
|
+
this.txOutput.datum = {
|
|
303
|
+
type: "Embedded",
|
|
304
|
+
data: {
|
|
305
|
+
type,
|
|
306
|
+
content
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
return this;
|
|
310
|
+
}
|
|
311
|
+
if (type === "JSON") {
|
|
312
|
+
content = this.castRawDataToJsonString(datum);
|
|
313
|
+
}
|
|
314
|
+
this.txOutput.datum = {
|
|
315
|
+
type: "Embedded",
|
|
316
|
+
data: {
|
|
317
|
+
type,
|
|
318
|
+
content
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
return this;
|
|
323
|
+
};
|
|
292
324
|
/**
|
|
293
325
|
* Set the reference script to be attached with the output
|
|
294
326
|
* @param scriptCbor The CBOR hex of the script to be attached to UTxO as reference script
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshsdk/transaction",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"typescript": "^5.3.3"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@meshsdk/common": "
|
|
38
|
-
"@meshsdk/core-csl": "
|
|
39
|
-
"@meshsdk/core-cst": "
|
|
37
|
+
"@meshsdk/common": "1.7.0",
|
|
38
|
+
"@meshsdk/core-csl": "1.7.0",
|
|
39
|
+
"@meshsdk/core-cst": "1.7.0",
|
|
40
40
|
"json-bigint": "^1.0.0"
|
|
41
41
|
},
|
|
42
42
|
"prettier": "@meshsdk/configs/prettier",
|