@meshsdk/transaction 1.6.2 → 1.6.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.d.cts CHANGED
@@ -221,18 +221,17 @@ declare class MeshTxBuilderCore {
221
221
  withdrawalPlutusScriptV3: () => this;
222
222
  /**
223
223
  * Withdraw stake rewards in the MeshTxBuilder instance
224
- * @param stakeAddress The address corresponding to the stake key
224
+ * @param rewardAddress The bech32 reward address (i.e. start with `stake_xxxxx`)
225
225
  * @param coin The amount of lovelaces in the withdrawal
226
226
  * @returns The MeshTxBuilder instance
227
227
  */
228
- withdrawal: (stakeAddress: string, coin: string) => this;
228
+ withdrawal: (rewardAddress: string, coin: string) => this;
229
229
  /**
230
230
  * Add a withdrawal script to the MeshTxBuilder instance
231
231
  * @param scriptCbor The script in CBOR format
232
- * @param version The language version
233
232
  * @returns The MeshTxBuilder instance
234
233
  */
235
- withdrawalScript: (scriptCbor: string, version: LanguageVersion) => this;
234
+ withdrawalScript: (scriptCbor: string) => this;
236
235
  /**
237
236
  * Add a withdrawal reference to the MeshTxBuilder instance
238
237
  * @param txHash The transaction hash of reference UTxO
@@ -241,7 +240,7 @@ declare class MeshTxBuilderCore {
241
240
  * @param scriptSize The script size of the withdrawal script
242
241
  * @returns The MeshTxBuilder instance
243
242
  */
244
- withdrawalTxInReference: (txHash: string, txIndex: number, withdrawalScriptHash?: string, scriptSize?: string) => void;
243
+ withdrawalTxInReference: (txHash: string, txIndex: number, withdrawalScriptHash?: string, scriptSize?: string) => this;
245
244
  /**
246
245
  * Set the transaction withdrawal redeemer value in the MeshTxBuilder instance
247
246
  * @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
@@ -261,24 +260,24 @@ declare class MeshTxBuilderCore {
261
260
  registerPoolCertificate: (poolParams: PoolParams) => this;
262
261
  /**
263
262
  * Creates a stake registration certificate, and adds it to the transaction
264
- * @param stakeKeyHash The keyHash of the stake key
263
+ * @param rewardAddress The bech32 reward address (i.e. start with `stake_xxxxx`)
265
264
  * @returns The MeshTxBuilder instance
266
265
  */
267
- registerStakeCertificate: (stakeKeyHash: string) => this;
266
+ registerStakeCertificate: (rewardAddress: string) => this;
268
267
  /**
269
268
  * Creates a stake delegation certificate, and adds it to the transaction
270
269
  * This will delegate stake from the corresponding stake address to the pool
271
- * @param stakeKeyHash The keyHash of the stake key
270
+ * @param rewardAddress The bech32 reward address (i.e. start with `stake_xxxxx`)
272
271
  * @param poolId poolId can be in either bech32 or hex form
273
272
  * @returns The MeshTxBuilder instance
274
273
  */
275
- delegateStakeCertificate: (stakeKeyHash: string, poolId: string) => this;
274
+ delegateStakeCertificate: (rewardAddress: string, poolId: string) => this;
276
275
  /**
277
276
  * Creates a stake deregister certificate, and adds it to the transaction
278
- * @param stakeKeyHash The keyHash of the stake key
277
+ * @param rewardAddress The bech32 reward address (i.e. start with `stake_xxxxx`)
279
278
  * @returns The MeshTxBuilder instance
280
279
  */
281
- deregisterStakeCertificate: (stakeKeyHash: string) => this;
280
+ deregisterStakeCertificate: (rewardAddress: string) => this;
282
281
  /**
283
282
  * Creates a pool retire certificate, and adds it to the transaction
284
283
  * @param poolId poolId can be in either bech32 or hex form
@@ -286,6 +285,25 @@ declare class MeshTxBuilderCore {
286
285
  * @returns The MeshTxBuilder instance
287
286
  */
288
287
  retirePoolCertificate: (poolId: string, epoch: number) => this;
288
+ /**
289
+ * Adds a script witness to the certificate
290
+ * @param scriptCbor The CborHex of the script
291
+ * @param version Optional - The plutus version of the script, null version implies Native Script
292
+ */
293
+ certificateScript: (scriptCbor: string, version?: LanguageVersion) => this;
294
+ /**
295
+ * Adds a script witness to the certificate
296
+ * @param txHash The transaction hash of the reference UTxO
297
+ * @param txIndex The transaction index of the reference UTxO
298
+ * @param spendingScriptHash The script hash of the spending script
299
+ * @param version Optional - The plutus version of the script, null version implies Native Script
300
+ * @param scriptSize The size of the plutus script referenced
301
+ */
302
+ certificateTxInReference: (txHash: string, txIndex: number, spendingScriptHash: string, version?: LanguageVersion, scriptSize?: string) => this;
303
+ certificateRedeemerValue: (redeemer: BuilderData["content"], type?: BuilderData["type"], exUnits?: {
304
+ mem: number;
305
+ steps: number;
306
+ }) => this;
289
307
  /**
290
308
  * Configure the address to accept change UTxO
291
309
  * @param addr The address to accept change UTxO
@@ -346,6 +364,13 @@ declare class MeshTxBuilderCore {
346
364
  reset: () => void;
347
365
  }
348
366
 
367
+ /**
368
+ * Convert UTxO to TxIn parameters in array for MeshTxBuilder
369
+ * @param utxo UTxO
370
+ * @returns [txHash, outputIndex, amount, address]
371
+ */
372
+ declare const utxoToTxIn: (utxo: UTxO) => [string, number, Asset[], string];
373
+
349
374
  interface MeshTxBuilderOptions {
350
375
  fetcher?: IFetcher;
351
376
  submitter?: ISubmitter;
@@ -562,4 +587,4 @@ declare class Transaction {
562
587
  private addChangeAddress;
563
588
  }
564
589
 
565
- export { ForgeScript, MeshTxBuilder, type MeshTxBuilderOptions, Transaction, type TransactionOptions };
590
+ export { ForgeScript, MeshTxBuilder, type MeshTxBuilderOptions, Transaction, type TransactionOptions, utxoToTxIn };
package/dist/index.d.ts CHANGED
@@ -221,18 +221,17 @@ declare class MeshTxBuilderCore {
221
221
  withdrawalPlutusScriptV3: () => this;
222
222
  /**
223
223
  * Withdraw stake rewards in the MeshTxBuilder instance
224
- * @param stakeAddress The address corresponding to the stake key
224
+ * @param rewardAddress The bech32 reward address (i.e. start with `stake_xxxxx`)
225
225
  * @param coin The amount of lovelaces in the withdrawal
226
226
  * @returns The MeshTxBuilder instance
227
227
  */
228
- withdrawal: (stakeAddress: string, coin: string) => this;
228
+ withdrawal: (rewardAddress: string, coin: string) => this;
229
229
  /**
230
230
  * Add a withdrawal script to the MeshTxBuilder instance
231
231
  * @param scriptCbor The script in CBOR format
232
- * @param version The language version
233
232
  * @returns The MeshTxBuilder instance
234
233
  */
235
- withdrawalScript: (scriptCbor: string, version: LanguageVersion) => this;
234
+ withdrawalScript: (scriptCbor: string) => this;
236
235
  /**
237
236
  * Add a withdrawal reference to the MeshTxBuilder instance
238
237
  * @param txHash The transaction hash of reference UTxO
@@ -241,7 +240,7 @@ declare class MeshTxBuilderCore {
241
240
  * @param scriptSize The script size of the withdrawal script
242
241
  * @returns The MeshTxBuilder instance
243
242
  */
244
- withdrawalTxInReference: (txHash: string, txIndex: number, withdrawalScriptHash?: string, scriptSize?: string) => void;
243
+ withdrawalTxInReference: (txHash: string, txIndex: number, withdrawalScriptHash?: string, scriptSize?: string) => this;
245
244
  /**
246
245
  * Set the transaction withdrawal redeemer value in the MeshTxBuilder instance
247
246
  * @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
@@ -261,24 +260,24 @@ declare class MeshTxBuilderCore {
261
260
  registerPoolCertificate: (poolParams: PoolParams) => this;
262
261
  /**
263
262
  * Creates a stake registration certificate, and adds it to the transaction
264
- * @param stakeKeyHash The keyHash of the stake key
263
+ * @param rewardAddress The bech32 reward address (i.e. start with `stake_xxxxx`)
265
264
  * @returns The MeshTxBuilder instance
266
265
  */
267
- registerStakeCertificate: (stakeKeyHash: string) => this;
266
+ registerStakeCertificate: (rewardAddress: string) => this;
268
267
  /**
269
268
  * Creates a stake delegation certificate, and adds it to the transaction
270
269
  * This will delegate stake from the corresponding stake address to the pool
271
- * @param stakeKeyHash The keyHash of the stake key
270
+ * @param rewardAddress The bech32 reward address (i.e. start with `stake_xxxxx`)
272
271
  * @param poolId poolId can be in either bech32 or hex form
273
272
  * @returns The MeshTxBuilder instance
274
273
  */
275
- delegateStakeCertificate: (stakeKeyHash: string, poolId: string) => this;
274
+ delegateStakeCertificate: (rewardAddress: string, poolId: string) => this;
276
275
  /**
277
276
  * Creates a stake deregister certificate, and adds it to the transaction
278
- * @param stakeKeyHash The keyHash of the stake key
277
+ * @param rewardAddress The bech32 reward address (i.e. start with `stake_xxxxx`)
279
278
  * @returns The MeshTxBuilder instance
280
279
  */
281
- deregisterStakeCertificate: (stakeKeyHash: string) => this;
280
+ deregisterStakeCertificate: (rewardAddress: string) => this;
282
281
  /**
283
282
  * Creates a pool retire certificate, and adds it to the transaction
284
283
  * @param poolId poolId can be in either bech32 or hex form
@@ -286,6 +285,25 @@ declare class MeshTxBuilderCore {
286
285
  * @returns The MeshTxBuilder instance
287
286
  */
288
287
  retirePoolCertificate: (poolId: string, epoch: number) => this;
288
+ /**
289
+ * Adds a script witness to the certificate
290
+ * @param scriptCbor The CborHex of the script
291
+ * @param version Optional - The plutus version of the script, null version implies Native Script
292
+ */
293
+ certificateScript: (scriptCbor: string, version?: LanguageVersion) => this;
294
+ /**
295
+ * Adds a script witness to the certificate
296
+ * @param txHash The transaction hash of the reference UTxO
297
+ * @param txIndex The transaction index of the reference UTxO
298
+ * @param spendingScriptHash The script hash of the spending script
299
+ * @param version Optional - The plutus version of the script, null version implies Native Script
300
+ * @param scriptSize The size of the plutus script referenced
301
+ */
302
+ certificateTxInReference: (txHash: string, txIndex: number, spendingScriptHash: string, version?: LanguageVersion, scriptSize?: string) => this;
303
+ certificateRedeemerValue: (redeemer: BuilderData["content"], type?: BuilderData["type"], exUnits?: {
304
+ mem: number;
305
+ steps: number;
306
+ }) => this;
289
307
  /**
290
308
  * Configure the address to accept change UTxO
291
309
  * @param addr The address to accept change UTxO
@@ -346,6 +364,13 @@ declare class MeshTxBuilderCore {
346
364
  reset: () => void;
347
365
  }
348
366
 
367
+ /**
368
+ * Convert UTxO to TxIn parameters in array for MeshTxBuilder
369
+ * @param utxo UTxO
370
+ * @returns [txHash, outputIndex, amount, address]
371
+ */
372
+ declare const utxoToTxIn: (utxo: UTxO) => [string, number, Asset[], string];
373
+
349
374
  interface MeshTxBuilderOptions {
350
375
  fetcher?: IFetcher;
351
376
  submitter?: ISubmitter;
@@ -562,4 +587,4 @@ declare class Transaction {
562
587
  private addChangeAddress;
563
588
  }
564
589
 
565
- export { ForgeScript, MeshTxBuilder, type MeshTxBuilderOptions, Transaction, type TransactionOptions };
590
+ export { ForgeScript, MeshTxBuilder, type MeshTxBuilderOptions, Transaction, type TransactionOptions, utxoToTxIn };