@meshsdk/transaction 1.7.1 → 1.7.3
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 +34 -2
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +34 -2
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -376,6 +376,16 @@ var MeshTxBuilderCore = class {
|
|
|
376
376
|
}
|
|
377
377
|
return this;
|
|
378
378
|
};
|
|
379
|
+
/**
|
|
380
|
+
* Set the reference script to be attached with the output
|
|
381
|
+
* @param languageVersion The Plutus script version
|
|
382
|
+
* @returns The MeshTxBuilder instance
|
|
383
|
+
*/
|
|
384
|
+
spendingPlutusScript = (languageVersion) => {
|
|
385
|
+
this.addingPlutusScriptInput = true;
|
|
386
|
+
this.plutusSpendingScriptVersion = languageVersion;
|
|
387
|
+
return this;
|
|
388
|
+
};
|
|
379
389
|
/**
|
|
380
390
|
* Set the instruction that it is currently using V1 Plutus spending scripts
|
|
381
391
|
* @returns The MeshTxBuilder instance
|
|
@@ -462,6 +472,16 @@ var MeshTxBuilderCore = class {
|
|
|
462
472
|
this.meshTxBuilderBody.referenceInputs.push({ txHash, txIndex });
|
|
463
473
|
return this;
|
|
464
474
|
};
|
|
475
|
+
/**
|
|
476
|
+
* Set the minting script for the current mint
|
|
477
|
+
* @param languageVersion The Plutus script version
|
|
478
|
+
* @returns The MeshTxBuilder instance
|
|
479
|
+
*/
|
|
480
|
+
mintPlutusScript = (languageVersion) => {
|
|
481
|
+
this.addingPlutusMint = true;
|
|
482
|
+
this.plutusMintingScriptVersion = languageVersion;
|
|
483
|
+
return this;
|
|
484
|
+
};
|
|
465
485
|
/**
|
|
466
486
|
* Set the instruction that it is currently using V1 Plutus minting scripts
|
|
467
487
|
* @returns The MeshTxBuilder instance
|
|
@@ -630,6 +650,16 @@ var MeshTxBuilderCore = class {
|
|
|
630
650
|
};
|
|
631
651
|
return this;
|
|
632
652
|
};
|
|
653
|
+
/**
|
|
654
|
+
* Set the instruction that it is currently using V1 Plutus withdrawal scripts
|
|
655
|
+
* @param languageVersion The Plutus script version
|
|
656
|
+
* @returns The MeshTxBuilder instance
|
|
657
|
+
*/
|
|
658
|
+
withdrawalPlutusScript = (languageVersion) => {
|
|
659
|
+
this.addingPlutusWithdrawal = true;
|
|
660
|
+
this.plutusWithdrawalScriptVersion = languageVersion;
|
|
661
|
+
return this;
|
|
662
|
+
};
|
|
633
663
|
/**
|
|
634
664
|
* Set the instruction that it is currently using V1 Plutus withdrawal scripts
|
|
635
665
|
* @returns The MeshTxBuilder instance
|
|
@@ -2100,8 +2130,10 @@ var Transaction = class {
|
|
|
2100
2130
|
}
|
|
2101
2131
|
}
|
|
2102
2132
|
async addTxInputsAsNeeded() {
|
|
2103
|
-
|
|
2104
|
-
|
|
2133
|
+
if (this.txBuilder.meshTxBuilderBody.extraInputs.length === 0) {
|
|
2134
|
+
const utxos = await this.initiator.getUtxos();
|
|
2135
|
+
this.txBuilder.selectUtxosFrom(utxos);
|
|
2136
|
+
}
|
|
2105
2137
|
}
|
|
2106
2138
|
async addChangeAddress() {
|
|
2107
2139
|
if (this.txBuilder.meshTxBuilderBody.changeAddress === "") {
|
package/dist/index.d.cts
CHANGED
|
@@ -99,6 +99,12 @@ declare class MeshTxBuilderCore {
|
|
|
99
99
|
* @returns The MeshTxBuilder instance
|
|
100
100
|
*/
|
|
101
101
|
txOutReferenceScript: (scriptCbor: string, version?: LanguageVersion) => this;
|
|
102
|
+
/**
|
|
103
|
+
* Set the reference script to be attached with the output
|
|
104
|
+
* @param languageVersion The Plutus script version
|
|
105
|
+
* @returns The MeshTxBuilder instance
|
|
106
|
+
*/
|
|
107
|
+
spendingPlutusScript: (languageVersion: LanguageVersion) => this;
|
|
102
108
|
/**
|
|
103
109
|
* Set the instruction that it is currently using V1 Plutus spending scripts
|
|
104
110
|
* @returns The MeshTxBuilder instance
|
|
@@ -146,6 +152,12 @@ declare class MeshTxBuilderCore {
|
|
|
146
152
|
* @returns The MeshTxBuilder instance
|
|
147
153
|
*/
|
|
148
154
|
readOnlyTxInReference: (txHash: string, txIndex: number) => this;
|
|
155
|
+
/**
|
|
156
|
+
* Set the minting script for the current mint
|
|
157
|
+
* @param languageVersion The Plutus script version
|
|
158
|
+
* @returns The MeshTxBuilder instance
|
|
159
|
+
*/
|
|
160
|
+
mintPlutusScript: (languageVersion: LanguageVersion) => this;
|
|
149
161
|
/**
|
|
150
162
|
* Set the instruction that it is currently using V1 Plutus minting scripts
|
|
151
163
|
* @returns The MeshTxBuilder instance
|
|
@@ -222,6 +234,12 @@ declare class MeshTxBuilderCore {
|
|
|
222
234
|
* @returns The MeshTxBuilder instance
|
|
223
235
|
*/
|
|
224
236
|
txInCollateral: (txHash: string, txIndex: number, amount?: Asset[], address?: string) => this;
|
|
237
|
+
/**
|
|
238
|
+
* Set the instruction that it is currently using V1 Plutus withdrawal scripts
|
|
239
|
+
* @param languageVersion The Plutus script version
|
|
240
|
+
* @returns The MeshTxBuilder instance
|
|
241
|
+
*/
|
|
242
|
+
withdrawalPlutusScript: (languageVersion: LanguageVersion) => this;
|
|
225
243
|
/**
|
|
226
244
|
* Set the instruction that it is currently using V1 Plutus withdrawal scripts
|
|
227
245
|
* @returns The MeshTxBuilder instance
|
package/dist/index.d.ts
CHANGED
|
@@ -99,6 +99,12 @@ declare class MeshTxBuilderCore {
|
|
|
99
99
|
* @returns The MeshTxBuilder instance
|
|
100
100
|
*/
|
|
101
101
|
txOutReferenceScript: (scriptCbor: string, version?: LanguageVersion) => this;
|
|
102
|
+
/**
|
|
103
|
+
* Set the reference script to be attached with the output
|
|
104
|
+
* @param languageVersion The Plutus script version
|
|
105
|
+
* @returns The MeshTxBuilder instance
|
|
106
|
+
*/
|
|
107
|
+
spendingPlutusScript: (languageVersion: LanguageVersion) => this;
|
|
102
108
|
/**
|
|
103
109
|
* Set the instruction that it is currently using V1 Plutus spending scripts
|
|
104
110
|
* @returns The MeshTxBuilder instance
|
|
@@ -146,6 +152,12 @@ declare class MeshTxBuilderCore {
|
|
|
146
152
|
* @returns The MeshTxBuilder instance
|
|
147
153
|
*/
|
|
148
154
|
readOnlyTxInReference: (txHash: string, txIndex: number) => this;
|
|
155
|
+
/**
|
|
156
|
+
* Set the minting script for the current mint
|
|
157
|
+
* @param languageVersion The Plutus script version
|
|
158
|
+
* @returns The MeshTxBuilder instance
|
|
159
|
+
*/
|
|
160
|
+
mintPlutusScript: (languageVersion: LanguageVersion) => this;
|
|
149
161
|
/**
|
|
150
162
|
* Set the instruction that it is currently using V1 Plutus minting scripts
|
|
151
163
|
* @returns The MeshTxBuilder instance
|
|
@@ -222,6 +234,12 @@ declare class MeshTxBuilderCore {
|
|
|
222
234
|
* @returns The MeshTxBuilder instance
|
|
223
235
|
*/
|
|
224
236
|
txInCollateral: (txHash: string, txIndex: number, amount?: Asset[], address?: string) => this;
|
|
237
|
+
/**
|
|
238
|
+
* Set the instruction that it is currently using V1 Plutus withdrawal scripts
|
|
239
|
+
* @param languageVersion The Plutus script version
|
|
240
|
+
* @returns The MeshTxBuilder instance
|
|
241
|
+
*/
|
|
242
|
+
withdrawalPlutusScript: (languageVersion: LanguageVersion) => this;
|
|
225
243
|
/**
|
|
226
244
|
* Set the instruction that it is currently using V1 Plutus withdrawal scripts
|
|
227
245
|
* @returns The MeshTxBuilder instance
|
package/dist/index.js
CHANGED
|
@@ -342,6 +342,16 @@ var MeshTxBuilderCore = class {
|
|
|
342
342
|
}
|
|
343
343
|
return this;
|
|
344
344
|
};
|
|
345
|
+
/**
|
|
346
|
+
* Set the reference script to be attached with the output
|
|
347
|
+
* @param languageVersion The Plutus script version
|
|
348
|
+
* @returns The MeshTxBuilder instance
|
|
349
|
+
*/
|
|
350
|
+
spendingPlutusScript = (languageVersion) => {
|
|
351
|
+
this.addingPlutusScriptInput = true;
|
|
352
|
+
this.plutusSpendingScriptVersion = languageVersion;
|
|
353
|
+
return this;
|
|
354
|
+
};
|
|
345
355
|
/**
|
|
346
356
|
* Set the instruction that it is currently using V1 Plutus spending scripts
|
|
347
357
|
* @returns The MeshTxBuilder instance
|
|
@@ -428,6 +438,16 @@ var MeshTxBuilderCore = class {
|
|
|
428
438
|
this.meshTxBuilderBody.referenceInputs.push({ txHash, txIndex });
|
|
429
439
|
return this;
|
|
430
440
|
};
|
|
441
|
+
/**
|
|
442
|
+
* Set the minting script for the current mint
|
|
443
|
+
* @param languageVersion The Plutus script version
|
|
444
|
+
* @returns The MeshTxBuilder instance
|
|
445
|
+
*/
|
|
446
|
+
mintPlutusScript = (languageVersion) => {
|
|
447
|
+
this.addingPlutusMint = true;
|
|
448
|
+
this.plutusMintingScriptVersion = languageVersion;
|
|
449
|
+
return this;
|
|
450
|
+
};
|
|
431
451
|
/**
|
|
432
452
|
* Set the instruction that it is currently using V1 Plutus minting scripts
|
|
433
453
|
* @returns The MeshTxBuilder instance
|
|
@@ -596,6 +616,16 @@ var MeshTxBuilderCore = class {
|
|
|
596
616
|
};
|
|
597
617
|
return this;
|
|
598
618
|
};
|
|
619
|
+
/**
|
|
620
|
+
* Set the instruction that it is currently using V1 Plutus withdrawal scripts
|
|
621
|
+
* @param languageVersion The Plutus script version
|
|
622
|
+
* @returns The MeshTxBuilder instance
|
|
623
|
+
*/
|
|
624
|
+
withdrawalPlutusScript = (languageVersion) => {
|
|
625
|
+
this.addingPlutusWithdrawal = true;
|
|
626
|
+
this.plutusWithdrawalScriptVersion = languageVersion;
|
|
627
|
+
return this;
|
|
628
|
+
};
|
|
599
629
|
/**
|
|
600
630
|
* Set the instruction that it is currently using V1 Plutus withdrawal scripts
|
|
601
631
|
* @returns The MeshTxBuilder instance
|
|
@@ -2084,8 +2114,10 @@ var Transaction = class {
|
|
|
2084
2114
|
}
|
|
2085
2115
|
}
|
|
2086
2116
|
async addTxInputsAsNeeded() {
|
|
2087
|
-
|
|
2088
|
-
|
|
2117
|
+
if (this.txBuilder.meshTxBuilderBody.extraInputs.length === 0) {
|
|
2118
|
+
const utxos = await this.initiator.getUtxos();
|
|
2119
|
+
this.txBuilder.selectUtxosFrom(utxos);
|
|
2120
|
+
}
|
|
2089
2121
|
}
|
|
2090
2122
|
async addChangeAddress() {
|
|
2091
2123
|
if (this.txBuilder.meshTxBuilderBody.changeAddress === "") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshsdk/transaction",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
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": "1.7.
|
|
38
|
-
"@meshsdk/core-csl": "1.7.
|
|
39
|
-
"@meshsdk/core-cst": "1.7.
|
|
37
|
+
"@meshsdk/common": "1.7.3",
|
|
38
|
+
"@meshsdk/core-csl": "1.7.3",
|
|
39
|
+
"@meshsdk/core-cst": "1.7.3",
|
|
40
40
|
"json-bigint": "^1.0.0"
|
|
41
41
|
},
|
|
42
42
|
"prettier": "@meshsdk/configs/prettier",
|