@meshsdk/common 1.9.0-beta.101 → 1.9.0-beta.102

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
@@ -1175,10 +1175,7 @@ var conStr = (constructor, fields) => {
1175
1175
  if (!Array.isArray(fields)) {
1176
1176
  throw new Error("fields of a constructor must be an array");
1177
1177
  }
1178
- return {
1179
- constructor,
1180
- fields
1181
- };
1178
+ return { constructor, fields };
1182
1179
  };
1183
1180
  var conStr0 = (fields) => conStr(0, fields);
1184
1181
  var conStr1 = (fields) => conStr(1, fields);
package/dist/index.d.cts CHANGED
@@ -651,57 +651,61 @@ declare const mPlutusBSArrayToString: (bsArray: string[]) => string;
651
651
  /**
652
652
  * The Plutus Data constructor object, representing custom data type in JSON
653
653
  */
654
- type ConStr<N = 0, T = any> = {
654
+ interface ConStr<N = number, T extends PlutusData[] = PlutusData[]> {
655
655
  constructor: N;
656
656
  fields: T;
657
- };
657
+ }
658
658
  /**
659
659
  * The Plutus Data index 0 constructor object, representing custom data type in JSON
660
660
  */
661
- type ConStr0<T = any> = ConStr<0, T>;
661
+ interface ConStr0<T extends PlutusData[] = PlutusData[]> extends ConStr<0, T> {
662
+ }
662
663
  /**
663
664
  * The Plutus Data index 1 constructor object, representing custom data type in JSON
664
665
  */
665
- type ConStr1<T = any> = ConStr<1, T>;
666
+ interface ConStr1<T extends PlutusData[] = PlutusData[]> extends ConStr<1, T> {
667
+ }
666
668
  /**
667
669
  * The Plutus Data index 2 constructor object, representing custom data type in JSON
668
670
  */
669
- type ConStr2<T = any> = ConStr<2, T>;
671
+ interface ConStr2<T extends PlutusData[] = PlutusData[]> extends ConStr<2, T> {
672
+ }
670
673
  /**
671
674
  * The Plutus Data index 3 constructor object, representing custom data type in JSON
672
675
  */
673
- type ConStr3<T = any> = ConStr<3, T>;
676
+ interface ConStr3<T extends PlutusData[] = PlutusData[]> extends ConStr<3, T> {
677
+ }
674
678
  /**
675
679
  * The utility function to create a Plutus Data constructor object, representing custom data type in JSON
676
680
  * @param constructor The constructor index number
677
681
  * @param fields The items in array
678
682
  * @returns The Plutus Data constructor object
679
683
  */
680
- declare const conStr: <N extends number, T>(constructor: N, fields: T) => ConStr<N, T>;
684
+ declare const conStr: <N extends number, T extends PlutusData[]>(constructor: N, fields: T) => ConStr<N, T>;
681
685
  /**
682
686
  * The utility function to create a Plutus Data index 0 constructor object, representing custom data type in JSON
683
687
  * @param fields The items of in array
684
688
  * @returns The Plutus Data constructor object
685
689
  */
686
- declare const conStr0: <T>(fields: T) => ConStr0<T>;
690
+ declare const conStr0: <T extends PlutusData[]>(fields: T) => ConStr0<T>;
687
691
  /**
688
692
  * The utility function to create a Plutus Data index 1 constructor object, representing custom data type in JSON
689
693
  * @param fields The items of in array
690
694
  * @returns The Plutus Data constructor object
691
695
  */
692
- declare const conStr1: <T>(fields: T) => ConStr1<T>;
696
+ declare const conStr1: <T extends PlutusData[]>(fields: T) => ConStr1<T>;
693
697
  /**
694
698
  * The utility function to create a Plutus Data index 2 constructor object, representing custom data type in JSON
695
699
  * @param fields The items of in array
696
700
  * @returns The Plutus Data constructor object
697
701
  */
698
- declare const conStr2: <T>(fields: T) => ConStr2<T>;
702
+ declare const conStr2: <T extends PlutusData[]>(fields: T) => ConStr2<T>;
699
703
  /**
700
704
  * The utility function to create a Plutus Data index 3 constructor object, representing custom data type in JSON
701
705
  * @param fields The items of in array
702
706
  * @returns The Plutus Data constructor object
703
707
  */
704
- declare const conStr3: <T>(fields: T) => ConStr3<T>;
708
+ declare const conStr3: <T extends PlutusData[]>(fields: T) => ConStr3<T>;
705
709
 
706
710
  /**
707
711
  * The Plutus Data boolean in JSON
@@ -898,12 +902,12 @@ type Tuple<T extends any[]> = {
898
902
  * Aiken alias
899
903
  * The Plutus Data Option in JSON
900
904
  */
901
- type Option<T> = Some<T> | None;
905
+ type Option<T extends PlutusData> = Some<T> | None;
902
906
  /**
903
907
  * Aiken alias
904
908
  * The Plutus Data Option - Some in JSON
905
909
  */
906
- type Some<T> = ConStr0<[T]>;
910
+ type Some<T extends PlutusData> = ConStr0<[T]>;
907
911
  /**
908
912
  * Aiken alias
909
913
  * The Plutus Data Option - None in JSON
@@ -997,13 +1001,13 @@ declare const tuple: <T extends PlutusData[]>(...args: T) => Tuple<T>;
997
1001
  * @param value The optional value of the option
998
1002
  * @returns Return None constructor if the value is not provided, otherwise return Some constructor with the value
999
1003
  */
1000
- declare const option: <T>(value?: T) => Option<T>;
1004
+ declare const option: <T extends PlutusData>(value?: T) => Option<T>;
1001
1005
  /**
1002
1006
  * The utility function to create a Plutus Data Option - Some in JSON
1003
1007
  * @param value The value of the option
1004
1008
  * @returns The Plutus Data Option - Some object
1005
1009
  */
1006
- declare const some: <T>(value: T) => Some<T>;
1010
+ declare const some: <T extends PlutusData>(value: T) => Some<T>;
1007
1011
  /**
1008
1012
  * The utility function to create a Plutus Data Option - None in JSON
1009
1013
  * @returns The Plutus Data Option - None object
package/dist/index.d.ts CHANGED
@@ -651,57 +651,61 @@ declare const mPlutusBSArrayToString: (bsArray: string[]) => string;
651
651
  /**
652
652
  * The Plutus Data constructor object, representing custom data type in JSON
653
653
  */
654
- type ConStr<N = 0, T = any> = {
654
+ interface ConStr<N = number, T extends PlutusData[] = PlutusData[]> {
655
655
  constructor: N;
656
656
  fields: T;
657
- };
657
+ }
658
658
  /**
659
659
  * The Plutus Data index 0 constructor object, representing custom data type in JSON
660
660
  */
661
- type ConStr0<T = any> = ConStr<0, T>;
661
+ interface ConStr0<T extends PlutusData[] = PlutusData[]> extends ConStr<0, T> {
662
+ }
662
663
  /**
663
664
  * The Plutus Data index 1 constructor object, representing custom data type in JSON
664
665
  */
665
- type ConStr1<T = any> = ConStr<1, T>;
666
+ interface ConStr1<T extends PlutusData[] = PlutusData[]> extends ConStr<1, T> {
667
+ }
666
668
  /**
667
669
  * The Plutus Data index 2 constructor object, representing custom data type in JSON
668
670
  */
669
- type ConStr2<T = any> = ConStr<2, T>;
671
+ interface ConStr2<T extends PlutusData[] = PlutusData[]> extends ConStr<2, T> {
672
+ }
670
673
  /**
671
674
  * The Plutus Data index 3 constructor object, representing custom data type in JSON
672
675
  */
673
- type ConStr3<T = any> = ConStr<3, T>;
676
+ interface ConStr3<T extends PlutusData[] = PlutusData[]> extends ConStr<3, T> {
677
+ }
674
678
  /**
675
679
  * The utility function to create a Plutus Data constructor object, representing custom data type in JSON
676
680
  * @param constructor The constructor index number
677
681
  * @param fields The items in array
678
682
  * @returns The Plutus Data constructor object
679
683
  */
680
- declare const conStr: <N extends number, T>(constructor: N, fields: T) => ConStr<N, T>;
684
+ declare const conStr: <N extends number, T extends PlutusData[]>(constructor: N, fields: T) => ConStr<N, T>;
681
685
  /**
682
686
  * The utility function to create a Plutus Data index 0 constructor object, representing custom data type in JSON
683
687
  * @param fields The items of in array
684
688
  * @returns The Plutus Data constructor object
685
689
  */
686
- declare const conStr0: <T>(fields: T) => ConStr0<T>;
690
+ declare const conStr0: <T extends PlutusData[]>(fields: T) => ConStr0<T>;
687
691
  /**
688
692
  * The utility function to create a Plutus Data index 1 constructor object, representing custom data type in JSON
689
693
  * @param fields The items of in array
690
694
  * @returns The Plutus Data constructor object
691
695
  */
692
- declare const conStr1: <T>(fields: T) => ConStr1<T>;
696
+ declare const conStr1: <T extends PlutusData[]>(fields: T) => ConStr1<T>;
693
697
  /**
694
698
  * The utility function to create a Plutus Data index 2 constructor object, representing custom data type in JSON
695
699
  * @param fields The items of in array
696
700
  * @returns The Plutus Data constructor object
697
701
  */
698
- declare const conStr2: <T>(fields: T) => ConStr2<T>;
702
+ declare const conStr2: <T extends PlutusData[]>(fields: T) => ConStr2<T>;
699
703
  /**
700
704
  * The utility function to create a Plutus Data index 3 constructor object, representing custom data type in JSON
701
705
  * @param fields The items of in array
702
706
  * @returns The Plutus Data constructor object
703
707
  */
704
- declare const conStr3: <T>(fields: T) => ConStr3<T>;
708
+ declare const conStr3: <T extends PlutusData[]>(fields: T) => ConStr3<T>;
705
709
 
706
710
  /**
707
711
  * The Plutus Data boolean in JSON
@@ -898,12 +902,12 @@ type Tuple<T extends any[]> = {
898
902
  * Aiken alias
899
903
  * The Plutus Data Option in JSON
900
904
  */
901
- type Option<T> = Some<T> | None;
905
+ type Option<T extends PlutusData> = Some<T> | None;
902
906
  /**
903
907
  * Aiken alias
904
908
  * The Plutus Data Option - Some in JSON
905
909
  */
906
- type Some<T> = ConStr0<[T]>;
910
+ type Some<T extends PlutusData> = ConStr0<[T]>;
907
911
  /**
908
912
  * Aiken alias
909
913
  * The Plutus Data Option - None in JSON
@@ -997,13 +1001,13 @@ declare const tuple: <T extends PlutusData[]>(...args: T) => Tuple<T>;
997
1001
  * @param value The optional value of the option
998
1002
  * @returns Return None constructor if the value is not provided, otherwise return Some constructor with the value
999
1003
  */
1000
- declare const option: <T>(value?: T) => Option<T>;
1004
+ declare const option: <T extends PlutusData>(value?: T) => Option<T>;
1001
1005
  /**
1002
1006
  * The utility function to create a Plutus Data Option - Some in JSON
1003
1007
  * @param value The value of the option
1004
1008
  * @returns The Plutus Data Option - Some object
1005
1009
  */
1006
- declare const some: <T>(value: T) => Some<T>;
1010
+ declare const some: <T extends PlutusData>(value: T) => Some<T>;
1007
1011
  /**
1008
1012
  * The utility function to create a Plutus Data Option - None in JSON
1009
1013
  * @returns The Plutus Data Option - None object
package/dist/index.js CHANGED
@@ -1016,10 +1016,7 @@ var conStr = (constructor, fields) => {
1016
1016
  if (!Array.isArray(fields)) {
1017
1017
  throw new Error("fields of a constructor must be an array");
1018
1018
  }
1019
- return {
1020
- constructor,
1021
- fields
1022
- };
1019
+ return { constructor, fields };
1023
1020
  };
1024
1021
  var conStr0 = (fields) => conStr(0, fields);
1025
1022
  var conStr1 = (fields) => conStr(1, fields);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshsdk/common",
3
- "version": "1.9.0-beta.101",
3
+ "version": "1.9.0-beta.102",
4
4
  "description": "Contains constants, types and interfaces used across the SDK and different serialization libraries",
5
5
  "main": "./dist/index.cjs",
6
6
  "browser": "./dist/index.js",