@meshsdk/core 1.9.0-beta.21 → 1.9.0-beta.23

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 CHANGED
@@ -31,6 +31,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/index.ts
32
32
  var index_exports = {};
33
33
  __export(index_exports, {
34
+ MintingBlueprint: () => MintingBlueprint,
35
+ SpendingBlueprint: () => SpendingBlueprint,
36
+ WithdrawalBlueprint: () => WithdrawalBlueprint,
34
37
  applyCborEncoding: () => applyCborEncoding,
35
38
  applyParamsToScript: () => applyParamsToScript2,
36
39
  checkSignature: () => import_core_cst.checkSignature,
@@ -145,6 +148,132 @@ var serializeData = (rawData, type) => {
145
148
  return serializer.serializeData(builderData);
146
149
  };
147
150
 
151
+ // src/utils/blueprint/minting.ts
152
+ var MintingBlueprint = class {
153
+ version;
154
+ cbor;
155
+ hash;
156
+ constructor(version) {
157
+ this.version = version;
158
+ this.cbor = "";
159
+ this.hash = "";
160
+ }
161
+ /**
162
+ * Initialize the minting blueprint, with the same parameters to `applyParamsToScript`
163
+ * @param compiledCode The raw script CborHex from blueprint.
164
+ * @param params The parameters to apply, in an array.
165
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
166
+ * @returns The minting blueprint object
167
+ */
168
+ paramScript(compiledCode, params, paramsType = "Mesh") {
169
+ const cbor = applyParamsToScript2(compiledCode, params, paramsType);
170
+ const hash = resolveScriptHash(cbor, this.version);
171
+ this.hash = hash;
172
+ this.cbor = cbor;
173
+ return this;
174
+ }
175
+ /**
176
+ * Initialize the minting blueprint, with no parameters
177
+ * @param compiledCode The raw script CborHex from blueprint.
178
+ * @returns The minting blueprint object
179
+ */
180
+ noParamScript(compiledCode) {
181
+ return this.paramScript(compiledCode, []);
182
+ }
183
+ };
184
+
185
+ // src/utils/blueprint/spending.ts
186
+ var SpendingBlueprint = class {
187
+ version;
188
+ networkId;
189
+ cbor;
190
+ hash;
191
+ address;
192
+ stakeHash;
193
+ isStakeScriptCredential;
194
+ constructor(version, networkId, stakeHash, isStakeScriptCredential = false) {
195
+ this.version = version;
196
+ this.networkId = networkId;
197
+ this.stakeHash = stakeHash;
198
+ this.cbor = "";
199
+ this.hash = "";
200
+ this.address = "";
201
+ this.isStakeScriptCredential = isStakeScriptCredential;
202
+ }
203
+ /**
204
+ * Initialize the minting blueprint, with the same parameters to `applyParamsToScript`
205
+ * @param compiledCode The raw script CborHex from blueprint.
206
+ * @param params The parameters to apply, in an array.
207
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
208
+ * @returns
209
+ */
210
+ paramScript(compiledCode, params, paramsType = "Mesh") {
211
+ const cbor = applyParamsToScript2(compiledCode, params, paramsType);
212
+ const hash = resolveScriptHash(cbor, this.version);
213
+ const plutusScript = {
214
+ code: cbor,
215
+ version: this.version
216
+ };
217
+ const address = serializePlutusScript(
218
+ plutusScript,
219
+ this.stakeHash,
220
+ this.networkId,
221
+ this.isStakeScriptCredential
222
+ ).address;
223
+ this.hash = hash;
224
+ this.cbor = cbor;
225
+ this.address = address;
226
+ return this;
227
+ }
228
+ /**
229
+ * Initialize the minting blueprint, with no parameters
230
+ * @param compiledCode The raw script CborHex from blueprint.
231
+ * @returns The minting blueprint object
232
+ */
233
+ noParamScript(compiledCode) {
234
+ return this.paramScript(compiledCode, []);
235
+ }
236
+ };
237
+
238
+ // src/utils/blueprint/withdrawal.ts
239
+ var WithdrawalBlueprint = class {
240
+ version;
241
+ networkId;
242
+ cbor;
243
+ hash;
244
+ address;
245
+ constructor(version, networkId) {
246
+ this.version = version;
247
+ this.networkId = networkId;
248
+ this.cbor = "";
249
+ this.hash = "";
250
+ this.address = "";
251
+ }
252
+ /**
253
+ * Initialize the withdrawal blueprint, with the same parameters to `applyParamsToScript`
254
+ * @param compiledCode The raw script CborHex from blueprint.
255
+ * @param params The parameters to apply, in an array.
256
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
257
+ * @returns The withdrawal blueprint object
258
+ */
259
+ paramScript(compiledCode, params, paramsType = "Mesh") {
260
+ const cbor = applyParamsToScript2(compiledCode, params, paramsType);
261
+ const hash = resolveScriptHash(cbor, this.version);
262
+ this.address = serializeRewardAddress(hash, true, this.networkId);
263
+ this.hash = hash;
264
+ this.cbor = cbor;
265
+ return this;
266
+ }
267
+ /**
268
+ * Initialize the withdrawal blueprint, with no parameters
269
+ * @param compiledCode The raw script CborHex from blueprint.
270
+ * @returns The withdrawal blueprint object
271
+ */
272
+ noParamScript(compiledCode) {
273
+ return this.paramScript(compiledCode, []);
274
+ }
275
+ };
276
+
148
277
  // src/index.ts
149
278
  __reExport(index_exports, require("@meshsdk/common"), module.exports);
150
279
  var cst = __toESM(require("@meshsdk/core-cst"), 1);
@@ -154,6 +283,9 @@ __reExport(index_exports, require("@meshsdk/wallet"), module.exports);
154
283
  var import_core_cst = require("@meshsdk/core-cst");
155
284
  // Annotate the CommonJS export names for ESM import in node:
156
285
  0 && (module.exports = {
286
+ MintingBlueprint,
287
+ SpendingBlueprint,
288
+ WithdrawalBlueprint,
157
289
  applyCborEncoding,
158
290
  applyParamsToScript,
159
291
  checkSignature,
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _meshsdk_common from '@meshsdk/common';
2
- import { Data, NativeScript, LanguageVersion, PlutusScript, DeserializedAddress, PubKeyAddress, ScriptAddress, BuilderData, PlutusDataType } from '@meshsdk/common';
2
+ import { Data, NativeScript, LanguageVersion, PlutusScript, DeserializedAddress, PubKeyAddress, ScriptAddress, BuilderData, PlutusDataType, IMintingBlueprint, ISpendingBlueprint, IWithdrawalBlueprint } from '@meshsdk/common';
3
3
  export * from '@meshsdk/common';
4
4
  import * as coreCst from '@meshsdk/core-cst';
5
5
  export { coreCst as core };
@@ -170,4 +170,114 @@ declare const serializeRewardAddress: (hash: string, isScriptHash?: boolean, net
170
170
  */
171
171
  declare const serializeData: (rawData: BuilderData["content"], type: Omit<PlutusDataType, "CBOR">) => string;
172
172
 
173
- export { applyCborEncoding, applyParamsToScript, deserializeAddress, deserializeDatum, deserializePoolId, resolveDataHash, resolveNativeScriptAddress, resolveNativeScriptHash, resolveNativeScriptHex, resolvePaymentKeyHash, resolvePlutusScriptAddress, resolvePlutusScriptHash, resolvePoolId, resolvePrivateKey, resolveRewardAddress, resolveScriptHash, resolveScriptHashDRepId, resolveScriptRef, resolveStakeKeyHash, resolveTxHash, serializeAddressObj, serializeData, serializeNativeScript, serializePlutusScript, serializePoolId, serializeRewardAddress };
173
+ /**
174
+ * Minting blueprint
175
+ * @category Blueprint
176
+ * @implements IMintingBlueprint
177
+ * @class
178
+ * @example
179
+ *
180
+ * const blueprint = new MintingBlueprint("V3");
181
+ * blueprint.paramScript("84xxxxxx", ["params"], "Mesh");
182
+ *
183
+ * const policyId = blueprint.hash;
184
+ * const scriptCbor = blueprint.cbor;
185
+ */
186
+ declare class MintingBlueprint implements IMintingBlueprint {
187
+ version: LanguageVersion;
188
+ cbor: string;
189
+ hash: string;
190
+ constructor(version: LanguageVersion);
191
+ /**
192
+ * Initialize the minting blueprint, with the same parameters to `applyParamsToScript`
193
+ * @param compiledCode The raw script CborHex from blueprint.
194
+ * @param params The parameters to apply, in an array.
195
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
196
+ * @returns The minting blueprint object
197
+ */
198
+ paramScript(compiledCode: string, params: object[] | Data[], paramsType?: PlutusDataType): this;
199
+ /**
200
+ * Initialize the minting blueprint, with no parameters
201
+ * @param compiledCode The raw script CborHex from blueprint.
202
+ * @returns The minting blueprint object
203
+ */
204
+ noParamScript(compiledCode: string): this;
205
+ }
206
+
207
+ /**
208
+ * Spending blueprint
209
+ * @category Blueprint
210
+ * @implements ISpendingBlueprint
211
+ * @class
212
+ * @example
213
+ *
214
+ * const blueprint = new SpendingBlueprint("V3", 0, stakeHash);
215
+ * blueprint.paramScript("84xxxxxx", ["params"], "Mesh");
216
+ *
217
+ * const scriptHash = blueprint.hash;
218
+ * const scriptCbor = blueprint.cbor;
219
+ * const scriptAddress = blueprint.address;
220
+ */
221
+ declare class SpendingBlueprint implements ISpendingBlueprint {
222
+ version: LanguageVersion;
223
+ networkId: number;
224
+ cbor: string;
225
+ hash: string;
226
+ address: string;
227
+ stakeHash?: string;
228
+ isStakeScriptCredential: boolean;
229
+ constructor(version: LanguageVersion, networkId: number, stakeHash: string, isStakeScriptCredential?: boolean);
230
+ /**
231
+ * Initialize the minting blueprint, with the same parameters to `applyParamsToScript`
232
+ * @param compiledCode The raw script CborHex from blueprint.
233
+ * @param params The parameters to apply, in an array.
234
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
235
+ * @returns
236
+ */
237
+ paramScript(compiledCode: string, params: object[] | Data[], paramsType?: PlutusDataType): this;
238
+ /**
239
+ * Initialize the minting blueprint, with no parameters
240
+ * @param compiledCode The raw script CborHex from blueprint.
241
+ * @returns The minting blueprint object
242
+ */
243
+ noParamScript(compiledCode: string): this;
244
+ }
245
+
246
+ /**
247
+ * Withdrawal blueprint
248
+ * @category Blueprint
249
+ * @implements IWithdrawalBlueprint
250
+ * @class
251
+ * @example
252
+ *
253
+ * const blueprint = new WithdrawalBlueprint("V3", 0);
254
+ * blueprint.paramScript("84xxxxxx", ["params"], "Mesh");
255
+ *
256
+ * const scriptHash = blueprint.hash;
257
+ * const scriptCbor = blueprint.cbor;
258
+ * const rewardAddress = blueprint.address;
259
+ */
260
+ declare class WithdrawalBlueprint implements IWithdrawalBlueprint {
261
+ version: LanguageVersion;
262
+ networkId: number;
263
+ cbor: string;
264
+ hash: string;
265
+ address: string;
266
+ constructor(version: LanguageVersion, networkId: number);
267
+ /**
268
+ * Initialize the withdrawal blueprint, with the same parameters to `applyParamsToScript`
269
+ * @param compiledCode The raw script CborHex from blueprint.
270
+ * @param params The parameters to apply, in an array.
271
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
272
+ * @returns The withdrawal blueprint object
273
+ */
274
+ paramScript(compiledCode: string, params: object[] | Data[], paramsType?: PlutusDataType): this;
275
+ /**
276
+ * Initialize the withdrawal blueprint, with no parameters
277
+ * @param compiledCode The raw script CborHex from blueprint.
278
+ * @returns The withdrawal blueprint object
279
+ */
280
+ noParamScript(compiledCode: string): this;
281
+ }
282
+
283
+ export { MintingBlueprint, SpendingBlueprint, WithdrawalBlueprint, applyCborEncoding, applyParamsToScript, deserializeAddress, deserializeDatum, deserializePoolId, resolveDataHash, resolveNativeScriptAddress, resolveNativeScriptHash, resolveNativeScriptHex, resolvePaymentKeyHash, resolvePlutusScriptAddress, resolvePlutusScriptHash, resolvePoolId, resolvePrivateKey, resolveRewardAddress, resolveScriptHash, resolveScriptHashDRepId, resolveScriptRef, resolveStakeKeyHash, resolveTxHash, serializeAddressObj, serializeData, serializeNativeScript, serializePlutusScript, serializePoolId, serializeRewardAddress };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _meshsdk_common from '@meshsdk/common';
2
- import { Data, NativeScript, LanguageVersion, PlutusScript, DeserializedAddress, PubKeyAddress, ScriptAddress, BuilderData, PlutusDataType } from '@meshsdk/common';
2
+ import { Data, NativeScript, LanguageVersion, PlutusScript, DeserializedAddress, PubKeyAddress, ScriptAddress, BuilderData, PlutusDataType, IMintingBlueprint, ISpendingBlueprint, IWithdrawalBlueprint } from '@meshsdk/common';
3
3
  export * from '@meshsdk/common';
4
4
  import * as coreCst from '@meshsdk/core-cst';
5
5
  export { coreCst as core };
@@ -170,4 +170,114 @@ declare const serializeRewardAddress: (hash: string, isScriptHash?: boolean, net
170
170
  */
171
171
  declare const serializeData: (rawData: BuilderData["content"], type: Omit<PlutusDataType, "CBOR">) => string;
172
172
 
173
- export { applyCborEncoding, applyParamsToScript, deserializeAddress, deserializeDatum, deserializePoolId, resolveDataHash, resolveNativeScriptAddress, resolveNativeScriptHash, resolveNativeScriptHex, resolvePaymentKeyHash, resolvePlutusScriptAddress, resolvePlutusScriptHash, resolvePoolId, resolvePrivateKey, resolveRewardAddress, resolveScriptHash, resolveScriptHashDRepId, resolveScriptRef, resolveStakeKeyHash, resolveTxHash, serializeAddressObj, serializeData, serializeNativeScript, serializePlutusScript, serializePoolId, serializeRewardAddress };
173
+ /**
174
+ * Minting blueprint
175
+ * @category Blueprint
176
+ * @implements IMintingBlueprint
177
+ * @class
178
+ * @example
179
+ *
180
+ * const blueprint = new MintingBlueprint("V3");
181
+ * blueprint.paramScript("84xxxxxx", ["params"], "Mesh");
182
+ *
183
+ * const policyId = blueprint.hash;
184
+ * const scriptCbor = blueprint.cbor;
185
+ */
186
+ declare class MintingBlueprint implements IMintingBlueprint {
187
+ version: LanguageVersion;
188
+ cbor: string;
189
+ hash: string;
190
+ constructor(version: LanguageVersion);
191
+ /**
192
+ * Initialize the minting blueprint, with the same parameters to `applyParamsToScript`
193
+ * @param compiledCode The raw script CborHex from blueprint.
194
+ * @param params The parameters to apply, in an array.
195
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
196
+ * @returns The minting blueprint object
197
+ */
198
+ paramScript(compiledCode: string, params: object[] | Data[], paramsType?: PlutusDataType): this;
199
+ /**
200
+ * Initialize the minting blueprint, with no parameters
201
+ * @param compiledCode The raw script CborHex from blueprint.
202
+ * @returns The minting blueprint object
203
+ */
204
+ noParamScript(compiledCode: string): this;
205
+ }
206
+
207
+ /**
208
+ * Spending blueprint
209
+ * @category Blueprint
210
+ * @implements ISpendingBlueprint
211
+ * @class
212
+ * @example
213
+ *
214
+ * const blueprint = new SpendingBlueprint("V3", 0, stakeHash);
215
+ * blueprint.paramScript("84xxxxxx", ["params"], "Mesh");
216
+ *
217
+ * const scriptHash = blueprint.hash;
218
+ * const scriptCbor = blueprint.cbor;
219
+ * const scriptAddress = blueprint.address;
220
+ */
221
+ declare class SpendingBlueprint implements ISpendingBlueprint {
222
+ version: LanguageVersion;
223
+ networkId: number;
224
+ cbor: string;
225
+ hash: string;
226
+ address: string;
227
+ stakeHash?: string;
228
+ isStakeScriptCredential: boolean;
229
+ constructor(version: LanguageVersion, networkId: number, stakeHash: string, isStakeScriptCredential?: boolean);
230
+ /**
231
+ * Initialize the minting blueprint, with the same parameters to `applyParamsToScript`
232
+ * @param compiledCode The raw script CborHex from blueprint.
233
+ * @param params The parameters to apply, in an array.
234
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
235
+ * @returns
236
+ */
237
+ paramScript(compiledCode: string, params: object[] | Data[], paramsType?: PlutusDataType): this;
238
+ /**
239
+ * Initialize the minting blueprint, with no parameters
240
+ * @param compiledCode The raw script CborHex from blueprint.
241
+ * @returns The minting blueprint object
242
+ */
243
+ noParamScript(compiledCode: string): this;
244
+ }
245
+
246
+ /**
247
+ * Withdrawal blueprint
248
+ * @category Blueprint
249
+ * @implements IWithdrawalBlueprint
250
+ * @class
251
+ * @example
252
+ *
253
+ * const blueprint = new WithdrawalBlueprint("V3", 0);
254
+ * blueprint.paramScript("84xxxxxx", ["params"], "Mesh");
255
+ *
256
+ * const scriptHash = blueprint.hash;
257
+ * const scriptCbor = blueprint.cbor;
258
+ * const rewardAddress = blueprint.address;
259
+ */
260
+ declare class WithdrawalBlueprint implements IWithdrawalBlueprint {
261
+ version: LanguageVersion;
262
+ networkId: number;
263
+ cbor: string;
264
+ hash: string;
265
+ address: string;
266
+ constructor(version: LanguageVersion, networkId: number);
267
+ /**
268
+ * Initialize the withdrawal blueprint, with the same parameters to `applyParamsToScript`
269
+ * @param compiledCode The raw script CborHex from blueprint.
270
+ * @param params The parameters to apply, in an array.
271
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
272
+ * @returns The withdrawal blueprint object
273
+ */
274
+ paramScript(compiledCode: string, params: object[] | Data[], paramsType?: PlutusDataType): this;
275
+ /**
276
+ * Initialize the withdrawal blueprint, with no parameters
277
+ * @param compiledCode The raw script CborHex from blueprint.
278
+ * @returns The withdrawal blueprint object
279
+ */
280
+ noParamScript(compiledCode: string): this;
281
+ }
282
+
283
+ export { MintingBlueprint, SpendingBlueprint, WithdrawalBlueprint, applyCborEncoding, applyParamsToScript, deserializeAddress, deserializeDatum, deserializePoolId, resolveDataHash, resolveNativeScriptAddress, resolveNativeScriptHash, resolveNativeScriptHex, resolvePaymentKeyHash, resolvePlutusScriptAddress, resolvePlutusScriptHash, resolvePoolId, resolvePrivateKey, resolveRewardAddress, resolveScriptHash, resolveScriptHashDRepId, resolveScriptRef, resolveStakeKeyHash, resolveTxHash, serializeAddressObj, serializeData, serializeNativeScript, serializePlutusScript, serializePoolId, serializeRewardAddress };
package/dist/index.js CHANGED
@@ -78,6 +78,132 @@ var serializeData = (rawData, type) => {
78
78
  return serializer.serializeData(builderData);
79
79
  };
80
80
 
81
+ // src/utils/blueprint/minting.ts
82
+ var MintingBlueprint = class {
83
+ version;
84
+ cbor;
85
+ hash;
86
+ constructor(version) {
87
+ this.version = version;
88
+ this.cbor = "";
89
+ this.hash = "";
90
+ }
91
+ /**
92
+ * Initialize the minting blueprint, with the same parameters to `applyParamsToScript`
93
+ * @param compiledCode The raw script CborHex from blueprint.
94
+ * @param params The parameters to apply, in an array.
95
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
96
+ * @returns The minting blueprint object
97
+ */
98
+ paramScript(compiledCode, params, paramsType = "Mesh") {
99
+ const cbor = applyParamsToScript2(compiledCode, params, paramsType);
100
+ const hash = resolveScriptHash(cbor, this.version);
101
+ this.hash = hash;
102
+ this.cbor = cbor;
103
+ return this;
104
+ }
105
+ /**
106
+ * Initialize the minting blueprint, with no parameters
107
+ * @param compiledCode The raw script CborHex from blueprint.
108
+ * @returns The minting blueprint object
109
+ */
110
+ noParamScript(compiledCode) {
111
+ return this.paramScript(compiledCode, []);
112
+ }
113
+ };
114
+
115
+ // src/utils/blueprint/spending.ts
116
+ var SpendingBlueprint = class {
117
+ version;
118
+ networkId;
119
+ cbor;
120
+ hash;
121
+ address;
122
+ stakeHash;
123
+ isStakeScriptCredential;
124
+ constructor(version, networkId, stakeHash, isStakeScriptCredential = false) {
125
+ this.version = version;
126
+ this.networkId = networkId;
127
+ this.stakeHash = stakeHash;
128
+ this.cbor = "";
129
+ this.hash = "";
130
+ this.address = "";
131
+ this.isStakeScriptCredential = isStakeScriptCredential;
132
+ }
133
+ /**
134
+ * Initialize the minting blueprint, with the same parameters to `applyParamsToScript`
135
+ * @param compiledCode The raw script CborHex from blueprint.
136
+ * @param params The parameters to apply, in an array.
137
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
138
+ * @returns
139
+ */
140
+ paramScript(compiledCode, params, paramsType = "Mesh") {
141
+ const cbor = applyParamsToScript2(compiledCode, params, paramsType);
142
+ const hash = resolveScriptHash(cbor, this.version);
143
+ const plutusScript = {
144
+ code: cbor,
145
+ version: this.version
146
+ };
147
+ const address = serializePlutusScript(
148
+ plutusScript,
149
+ this.stakeHash,
150
+ this.networkId,
151
+ this.isStakeScriptCredential
152
+ ).address;
153
+ this.hash = hash;
154
+ this.cbor = cbor;
155
+ this.address = address;
156
+ return this;
157
+ }
158
+ /**
159
+ * Initialize the minting blueprint, with no parameters
160
+ * @param compiledCode The raw script CborHex from blueprint.
161
+ * @returns The minting blueprint object
162
+ */
163
+ noParamScript(compiledCode) {
164
+ return this.paramScript(compiledCode, []);
165
+ }
166
+ };
167
+
168
+ // src/utils/blueprint/withdrawal.ts
169
+ var WithdrawalBlueprint = class {
170
+ version;
171
+ networkId;
172
+ cbor;
173
+ hash;
174
+ address;
175
+ constructor(version, networkId) {
176
+ this.version = version;
177
+ this.networkId = networkId;
178
+ this.cbor = "";
179
+ this.hash = "";
180
+ this.address = "";
181
+ }
182
+ /**
183
+ * Initialize the withdrawal blueprint, with the same parameters to `applyParamsToScript`
184
+ * @param compiledCode The raw script CborHex from blueprint.
185
+ * @param params The parameters to apply, in an array.
186
+ * @param paramsType The type of the parameters, default to be Mesh's Data type. It could also be in JSON and raw CBOR.
187
+ * @returns The withdrawal blueprint object
188
+ */
189
+ paramScript(compiledCode, params, paramsType = "Mesh") {
190
+ const cbor = applyParamsToScript2(compiledCode, params, paramsType);
191
+ const hash = resolveScriptHash(cbor, this.version);
192
+ this.address = serializeRewardAddress(hash, true, this.networkId);
193
+ this.hash = hash;
194
+ this.cbor = cbor;
195
+ return this;
196
+ }
197
+ /**
198
+ * Initialize the withdrawal blueprint, with no parameters
199
+ * @param compiledCode The raw script CborHex from blueprint.
200
+ * @returns The withdrawal blueprint object
201
+ */
202
+ noParamScript(compiledCode) {
203
+ return this.paramScript(compiledCode, []);
204
+ }
205
+ };
206
+
81
207
  // src/index.ts
82
208
  export * from "@meshsdk/common";
83
209
  import * as cst from "@meshsdk/core-cst";
@@ -86,6 +212,9 @@ export * from "@meshsdk/transaction";
86
212
  export * from "@meshsdk/wallet";
87
213
  import { checkSignature, signData, generateNonce } from "@meshsdk/core-cst";
88
214
  export {
215
+ MintingBlueprint,
216
+ SpendingBlueprint,
217
+ WithdrawalBlueprint,
89
218
  applyCborEncoding,
90
219
  applyParamsToScript2 as applyParamsToScript,
91
220
  checkSignature,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshsdk/core",
3
- "version": "1.9.0-beta.21",
3
+ "version": "1.9.0-beta.23",
4
4
  "description": "Mesh SDK Core - https://meshjs.dev/",
5
5
  "main": "./dist/index.cjs",
6
6
  "browser": "./dist/index.js",
@@ -33,12 +33,12 @@
33
33
  "typescript": "^5.3.3"
34
34
  },
35
35
  "dependencies": {
36
- "@meshsdk/common": "1.9.0-beta.21",
37
- "@meshsdk/core-cst": "1.9.0-beta.21",
38
- "@meshsdk/provider": "1.9.0-beta.21",
39
- "@meshsdk/react": "1.9.0-beta.21",
40
- "@meshsdk/transaction": "1.9.0-beta.21",
41
- "@meshsdk/wallet": "1.9.0-beta.21"
36
+ "@meshsdk/common": "1.9.0-beta.23",
37
+ "@meshsdk/core-cst": "1.9.0-beta.23",
38
+ "@meshsdk/provider": "1.9.0-beta.23",
39
+ "@meshsdk/react": "1.9.0-beta.23",
40
+ "@meshsdk/transaction": "1.9.0-beta.23",
41
+ "@meshsdk/wallet": "1.9.0-beta.23"
42
42
  },
43
43
  "prettier": "@meshsdk/configs/prettier",
44
44
  "publishConfig": {