@taqueria/plugin-contract-types 0.39.18 → 0.39.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taqueria/plugin-contract-types",
3
- "version": "0.39.18",
3
+ "version": "0.39.19",
4
4
  "main": "index.cjs",
5
5
  "module": "index.js",
6
6
  "source": "index.ts",
@@ -34,7 +34,7 @@
34
34
  "typescript": "^5.2.2"
35
35
  },
36
36
  "dependencies": {
37
- "@taqueria/node-sdk": "^0.39.18",
37
+ "@taqueria/node-sdk": "^0.39.19",
38
38
  "@taquito/michel-codec": "^17.3.1",
39
39
  "@taquito/signer": "^17.3.1",
40
40
  "@taquito/taquito": "^17.3.1",
@@ -66,5 +66,5 @@
66
66
  "esm"
67
67
  ]
68
68
  },
69
- "gitHead": "3dba409e5df2d5bdc1aeaadae1f6e1a56ff82478"
69
+ "gitHead": "73a54fed5cda24ccffab107ce912ca2cb66c637e"
70
70
  }
@@ -23,26 +23,26 @@ export type nat = BigNumber & { __type: 'nat' };
23
23
  export type mutez = BigNumber & { __type: 'mutez' };
24
24
  export type tez = BigNumber & { __type: 'tez' };
25
25
 
26
- type MapKey = Array<any> | object | string | boolean | number;
26
+ export type MapKey = Array<any> | object | string | boolean | number;
27
27
  export type MMap<K extends MapKey, V> = Omit<MichelsonMap<K, V>, 'get'> & { get: (key: K) => V };
28
28
  export type BigMap<K extends MapKey, V> = Omit<MichelsonMap<K, V>, 'get'> & { get: (key: K) => Promise<V> };
29
29
 
30
30
  export type chest = string & { __type: 'chest' };
31
31
  export type chest_key = string & { __type: 'chest_key' };
32
32
 
33
- const createStringTypeTas = <T extends string>() => {
33
+ export const createStringTypeTas = <T extends string>() => {
34
34
  return (value: string): T => value as T;
35
35
  };
36
36
 
37
- const createBigNumberTypeTas = <T extends BigNumber>() => {
37
+ export const createBigNumberTypeTas = <T extends BigNumber>() => {
38
38
  return (value: number | BigNumber | string): T => new BigNumber(value) as T;
39
39
  };
40
40
 
41
- type asMapParamOf<K, V> = K extends string ? { [key: string]: V } | Array<{ key: K; value: V }>
41
+ export type asMapParamOf<K, V> = K extends string ? { [key: string]: V } | Array<{ key: K; value: V }>
42
42
  : K extends number ? { [key: number]: V } | Array<{ key: K; value: V }>
43
43
  : Array<{ key: K; value: V }>;
44
44
 
45
- function asMap<K extends MapKey, V>(value: asMapParamOf<K, V>): MMap<K, V> {
45
+ export function asMap<K extends MapKey, V>(value: asMapParamOf<K, V>): MMap<K, V> {
46
46
  const m = new MichelsonMap<K, V>();
47
47
  if (Array.isArray(value)) {
48
48
  const vArray = value as Array<{ key: K; value: V }>;
@@ -53,16 +53,16 @@ function asMap<K extends MapKey, V>(value: asMapParamOf<K, V>): MMap<K, V> {
53
53
  }
54
54
  return m as MMap<K, V>;
55
55
  }
56
- const asBigMap = <K extends MapKey, V>(value: asMapParamOf<K, V>) => asMap(value) as unknown as BigMap<K, V>;
56
+ export const asBigMap = <K extends MapKey, V>(value: asMapParamOf<K, V>) => asMap(value) as unknown as BigMap<K, V>;
57
57
 
58
- function add<T extends BigNumber>(a: T, b: T): T {
58
+ export function add<T extends BigNumber>(a: T, b: T): T {
59
59
  return a.plus(b) as T;
60
60
  }
61
- function subtract<T extends BigNumber>(a: T, b: T): T {
61
+ export function subtract<T extends BigNumber>(a: T, b: T): T {
62
62
  return a.minus(b) as T;
63
63
  }
64
64
 
65
- function createLambdaTypeTas(expr: Expr): MichelsonCode {
65
+ export function createLambdaTypeTas(expr: Expr): MichelsonCode {
66
66
  assertMichelsonInstruction(expr);
67
67
  return expr as MichelsonCode;
68
68
  }