@meshsdk/transaction 1.7.0 → 1.7.1
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 +37 -28
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +37 -28
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -114,7 +114,7 @@ var MeshTxBuilderCore = class {
|
|
|
114
114
|
simpleScriptTxIn: {
|
|
115
115
|
scriptSource: {
|
|
116
116
|
type: "Provided",
|
|
117
|
-
|
|
117
|
+
scriptCode: scriptCbor
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
};
|
|
@@ -191,33 +191,42 @@ var MeshTxBuilderCore = class {
|
|
|
191
191
|
}
|
|
192
192
|
return this;
|
|
193
193
|
};
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
194
|
+
/**
|
|
195
|
+
* Native script - Set the reference input where it would also be spent in the transaction
|
|
196
|
+
* @param txHash The transaction hash of the reference UTxO
|
|
197
|
+
* @param txIndex The transaction index of the reference UTxO
|
|
198
|
+
* @param spendingScriptHash The script hash of the spending script
|
|
199
|
+
* @returns The MeshTxBuilder instance
|
|
200
|
+
*/
|
|
201
|
+
simpleScriptTxInReference = (txHash, txIndex, spendingScriptHash, scriptSize) => {
|
|
202
|
+
if (!this.txInQueueItem) throw Error("Undefined input");
|
|
203
|
+
if (this.txInQueueItem.type === "Script") {
|
|
204
|
+
throw Error(
|
|
205
|
+
"simpleScriptTxInReference called on a plutus script, use spendingTxInReference instead"
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
if (this.txInQueueItem.type === "SimpleScript") {
|
|
209
|
+
throw Error(
|
|
210
|
+
"simpleScriptTxInReference called on a native script input that already has a script defined"
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
if (this.txInQueueItem.type === "PubKey") {
|
|
214
|
+
this.txInQueueItem = {
|
|
215
|
+
type: "SimpleScript",
|
|
216
|
+
txIn: this.txInQueueItem.txIn,
|
|
217
|
+
simpleScriptTxIn: {
|
|
218
|
+
scriptSource: {
|
|
219
|
+
type: "Inline",
|
|
220
|
+
txHash,
|
|
221
|
+
txIndex,
|
|
222
|
+
simpleScriptHash: spendingScriptHash,
|
|
223
|
+
scriptSize
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
return this;
|
|
229
|
+
};
|
|
221
230
|
/**
|
|
222
231
|
* Set the redeemer for the reference input to be spent in same transaction
|
|
223
232
|
* @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
package/dist/index.d.cts
CHANGED
|
@@ -45,6 +45,14 @@ declare class MeshTxBuilderCore {
|
|
|
45
45
|
* @returns The MeshTxBuilder instance
|
|
46
46
|
*/
|
|
47
47
|
txInInlineDatumPresent: () => this;
|
|
48
|
+
/**
|
|
49
|
+
* Native script - Set the reference input where it would also be spent in the transaction
|
|
50
|
+
* @param txHash The transaction hash of the reference UTxO
|
|
51
|
+
* @param txIndex The transaction index of the reference UTxO
|
|
52
|
+
* @param spendingScriptHash The script hash of the spending script
|
|
53
|
+
* @returns The MeshTxBuilder instance
|
|
54
|
+
*/
|
|
55
|
+
simpleScriptTxInReference: (txHash: string, txIndex: number, spendingScriptHash?: string, scriptSize?: string) => this;
|
|
48
56
|
/**
|
|
49
57
|
* Set the redeemer for the reference input to be spent in same transaction
|
|
50
58
|
* @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,14 @@ declare class MeshTxBuilderCore {
|
|
|
45
45
|
* @returns The MeshTxBuilder instance
|
|
46
46
|
*/
|
|
47
47
|
txInInlineDatumPresent: () => this;
|
|
48
|
+
/**
|
|
49
|
+
* Native script - Set the reference input where it would also be spent in the transaction
|
|
50
|
+
* @param txHash The transaction hash of the reference UTxO
|
|
51
|
+
* @param txIndex The transaction index of the reference UTxO
|
|
52
|
+
* @param spendingScriptHash The script hash of the spending script
|
|
53
|
+
* @returns The MeshTxBuilder instance
|
|
54
|
+
*/
|
|
55
|
+
simpleScriptTxInReference: (txHash: string, txIndex: number, spendingScriptHash?: string, scriptSize?: string) => this;
|
|
48
56
|
/**
|
|
49
57
|
* Set the redeemer for the reference input to be spent in same transaction
|
|
50
58
|
* @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
package/dist/index.js
CHANGED
|
@@ -80,7 +80,7 @@ var MeshTxBuilderCore = class {
|
|
|
80
80
|
simpleScriptTxIn: {
|
|
81
81
|
scriptSource: {
|
|
82
82
|
type: "Provided",
|
|
83
|
-
|
|
83
|
+
scriptCode: scriptCbor
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
};
|
|
@@ -157,33 +157,42 @@ var MeshTxBuilderCore = class {
|
|
|
157
157
|
}
|
|
158
158
|
return this;
|
|
159
159
|
};
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
160
|
+
/**
|
|
161
|
+
* Native script - Set the reference input where it would also be spent in the transaction
|
|
162
|
+
* @param txHash The transaction hash of the reference UTxO
|
|
163
|
+
* @param txIndex The transaction index of the reference UTxO
|
|
164
|
+
* @param spendingScriptHash The script hash of the spending script
|
|
165
|
+
* @returns The MeshTxBuilder instance
|
|
166
|
+
*/
|
|
167
|
+
simpleScriptTxInReference = (txHash, txIndex, spendingScriptHash, scriptSize) => {
|
|
168
|
+
if (!this.txInQueueItem) throw Error("Undefined input");
|
|
169
|
+
if (this.txInQueueItem.type === "Script") {
|
|
170
|
+
throw Error(
|
|
171
|
+
"simpleScriptTxInReference called on a plutus script, use spendingTxInReference instead"
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
if (this.txInQueueItem.type === "SimpleScript") {
|
|
175
|
+
throw Error(
|
|
176
|
+
"simpleScriptTxInReference called on a native script input that already has a script defined"
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
if (this.txInQueueItem.type === "PubKey") {
|
|
180
|
+
this.txInQueueItem = {
|
|
181
|
+
type: "SimpleScript",
|
|
182
|
+
txIn: this.txInQueueItem.txIn,
|
|
183
|
+
simpleScriptTxIn: {
|
|
184
|
+
scriptSource: {
|
|
185
|
+
type: "Inline",
|
|
186
|
+
txHash,
|
|
187
|
+
txIndex,
|
|
188
|
+
simpleScriptHash: spendingScriptHash,
|
|
189
|
+
scriptSize
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
return this;
|
|
195
|
+
};
|
|
187
196
|
/**
|
|
188
197
|
* Set the redeemer for the reference input to be spent in same transaction
|
|
189
198
|
* @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshsdk/transaction",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
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.1",
|
|
38
|
+
"@meshsdk/core-csl": "1.7.1",
|
|
39
|
+
"@meshsdk/core-cst": "1.7.1",
|
|
40
40
|
"json-bigint": "^1.0.0"
|
|
41
41
|
},
|
|
42
42
|
"prettier": "@meshsdk/configs/prettier",
|