@meshsdk/transaction 1.7.3 → 1.7.4

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
@@ -869,6 +869,42 @@ var MeshTxBuilderCore = class {
869
869
  });
870
870
  return this;
871
871
  };
872
+ /**
873
+ * Registers DRep certificate, and adds it to the transaction
874
+ * @param drepId The bech32 drep id (i.e. starts with `drep1xxxxx`)
875
+ * @param anchor The DRep anchor, consists of a URL and a hash of the doc
876
+ * @param coin DRep registration deposit
877
+ * @returns The MeshTxBuilder instance
878
+ */
879
+ drepRegistrationCertificate = (drepId, anchor, coin = import_common.DREP_DEPOSIT) => {
880
+ this.meshTxBuilderBody.certificates.push({
881
+ type: "BasicCertificate",
882
+ certType: {
883
+ type: "DRepRegistration",
884
+ drepId,
885
+ coin: Number(coin),
886
+ anchor
887
+ }
888
+ });
889
+ return this;
890
+ };
891
+ /**
892
+ * Dregister DRep certificate, and adds it to the transaction
893
+ * @param drepId The bech32 drep id (i.e. starts with `drep1xxxxx`)
894
+ * @param coin DRep registration deposit
895
+ * @returns The MeshTxBuilder instance
896
+ */
897
+ drepDeregistrationCertificate = (drepId, coin = import_common.DREP_DEPOSIT) => {
898
+ this.meshTxBuilderBody.certificates.push({
899
+ type: "BasicCertificate",
900
+ certType: {
901
+ type: "DRepDeregistration",
902
+ drepId,
903
+ coin: Number(coin)
904
+ }
905
+ });
906
+ return this;
907
+ };
872
908
  /**
873
909
  * Adds a script witness to the certificate
874
910
  * @param scriptCbor The CborHex of the script
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Protocol, MintItem, TxIn, Withdrawal, PubKeyTxIn, RefTxIn, MeshTxBuilderBody, Asset, BuilderData, LanguageVersion, PoolParams, UTxO, UtxoSelectionStrategy, Network, Redeemer, Action, IFetcher, ISubmitter, IEvaluator, IMeshTxSerializer, ScriptSource, SimpleScriptSourceInfo, NativeScript, IInitiator, Recipient, Token, PlutusScript, Budget, Data, Mint } from '@meshsdk/common';
1
+ import { Protocol, MintItem, TxIn, Withdrawal, PubKeyTxIn, RefTxIn, MeshTxBuilderBody, Asset, BuilderData, LanguageVersion, PoolParams, Anchor, UTxO, UtxoSelectionStrategy, Network, Redeemer, Action, IFetcher, ISubmitter, IEvaluator, IMeshTxSerializer, ScriptSource, SimpleScriptSourceInfo, NativeScript, IInitiator, Recipient, Token, PlutusScript, Budget, Data, Mint } from '@meshsdk/common';
2
2
 
3
3
  declare class MeshTxBuilderCore {
4
4
  txEvaluationMultiplier: number;
@@ -321,6 +321,21 @@ declare class MeshTxBuilderCore {
321
321
  * @returns The MeshTxBuilder instance
322
322
  */
323
323
  retirePoolCertificate: (poolId: string, epoch: number) => this;
324
+ /**
325
+ * Registers DRep certificate, and adds it to the transaction
326
+ * @param drepId The bech32 drep id (i.e. starts with `drep1xxxxx`)
327
+ * @param anchor The DRep anchor, consists of a URL and a hash of the doc
328
+ * @param coin DRep registration deposit
329
+ * @returns The MeshTxBuilder instance
330
+ */
331
+ drepRegistrationCertificate: (drepId: string, anchor?: Anchor, coin?: string) => this;
332
+ /**
333
+ * Dregister DRep certificate, and adds it to the transaction
334
+ * @param drepId The bech32 drep id (i.e. starts with `drep1xxxxx`)
335
+ * @param coin DRep registration deposit
336
+ * @returns The MeshTxBuilder instance
337
+ */
338
+ drepDeregistrationCertificate: (drepId: string, coin?: string) => this;
324
339
  /**
325
340
  * Adds a script witness to the certificate
326
341
  * @param scriptCbor The CborHex of the script
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Protocol, MintItem, TxIn, Withdrawal, PubKeyTxIn, RefTxIn, MeshTxBuilderBody, Asset, BuilderData, LanguageVersion, PoolParams, UTxO, UtxoSelectionStrategy, Network, Redeemer, Action, IFetcher, ISubmitter, IEvaluator, IMeshTxSerializer, ScriptSource, SimpleScriptSourceInfo, NativeScript, IInitiator, Recipient, Token, PlutusScript, Budget, Data, Mint } from '@meshsdk/common';
1
+ import { Protocol, MintItem, TxIn, Withdrawal, PubKeyTxIn, RefTxIn, MeshTxBuilderBody, Asset, BuilderData, LanguageVersion, PoolParams, Anchor, UTxO, UtxoSelectionStrategy, Network, Redeemer, Action, IFetcher, ISubmitter, IEvaluator, IMeshTxSerializer, ScriptSource, SimpleScriptSourceInfo, NativeScript, IInitiator, Recipient, Token, PlutusScript, Budget, Data, Mint } from '@meshsdk/common';
2
2
 
3
3
  declare class MeshTxBuilderCore {
4
4
  txEvaluationMultiplier: number;
@@ -321,6 +321,21 @@ declare class MeshTxBuilderCore {
321
321
  * @returns The MeshTxBuilder instance
322
322
  */
323
323
  retirePoolCertificate: (poolId: string, epoch: number) => this;
324
+ /**
325
+ * Registers DRep certificate, and adds it to the transaction
326
+ * @param drepId The bech32 drep id (i.e. starts with `drep1xxxxx`)
327
+ * @param anchor The DRep anchor, consists of a URL and a hash of the doc
328
+ * @param coin DRep registration deposit
329
+ * @returns The MeshTxBuilder instance
330
+ */
331
+ drepRegistrationCertificate: (drepId: string, anchor?: Anchor, coin?: string) => this;
332
+ /**
333
+ * Dregister DRep certificate, and adds it to the transaction
334
+ * @param drepId The bech32 drep id (i.e. starts with `drep1xxxxx`)
335
+ * @param coin DRep registration deposit
336
+ * @returns The MeshTxBuilder instance
337
+ */
338
+ drepDeregistrationCertificate: (drepId: string, coin?: string) => this;
324
339
  /**
325
340
  * Adds a script witness to the certificate
326
341
  * @param scriptCbor The CborHex of the script
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ import JSONBig from "json-bigint";
6
6
  import {
7
7
  DEFAULT_PROTOCOL_PARAMETERS,
8
8
  DEFAULT_REDEEMER_BUDGET,
9
+ DREP_DEPOSIT,
9
10
  emptyTxBuilderBody,
10
11
  UtxoSelection
11
12
  } from "@meshsdk/common";
@@ -835,6 +836,42 @@ var MeshTxBuilderCore = class {
835
836
  });
836
837
  return this;
837
838
  };
839
+ /**
840
+ * Registers DRep certificate, and adds it to the transaction
841
+ * @param drepId The bech32 drep id (i.e. starts with `drep1xxxxx`)
842
+ * @param anchor The DRep anchor, consists of a URL and a hash of the doc
843
+ * @param coin DRep registration deposit
844
+ * @returns The MeshTxBuilder instance
845
+ */
846
+ drepRegistrationCertificate = (drepId, anchor, coin = DREP_DEPOSIT) => {
847
+ this.meshTxBuilderBody.certificates.push({
848
+ type: "BasicCertificate",
849
+ certType: {
850
+ type: "DRepRegistration",
851
+ drepId,
852
+ coin: Number(coin),
853
+ anchor
854
+ }
855
+ });
856
+ return this;
857
+ };
858
+ /**
859
+ * Dregister DRep certificate, and adds it to the transaction
860
+ * @param drepId The bech32 drep id (i.e. starts with `drep1xxxxx`)
861
+ * @param coin DRep registration deposit
862
+ * @returns The MeshTxBuilder instance
863
+ */
864
+ drepDeregistrationCertificate = (drepId, coin = DREP_DEPOSIT) => {
865
+ this.meshTxBuilderBody.certificates.push({
866
+ type: "BasicCertificate",
867
+ certType: {
868
+ type: "DRepDeregistration",
869
+ drepId,
870
+ coin: Number(coin)
871
+ }
872
+ });
873
+ return this;
874
+ };
838
875
  /**
839
876
  * Adds a script witness to the certificate
840
877
  * @param scriptCbor The CborHex of the script
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshsdk/transaction",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
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.3",
38
- "@meshsdk/core-csl": "1.7.3",
39
- "@meshsdk/core-cst": "1.7.3",
37
+ "@meshsdk/common": "1.7.4",
38
+ "@meshsdk/core-csl": "1.7.4",
39
+ "@meshsdk/core-cst": "1.7.4",
40
40
  "json-bigint": "^1.0.0"
41
41
  },
42
42
  "prettier": "@meshsdk/configs/prettier",