genlayer-js 0.4.3 → 0.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
 
2
2
 
3
+ ## 0.4.4 (2024-11-28)
4
+
3
5
  ## 0.4.3 (2024-11-26)
4
6
 
5
7
 
@@ -70,20 +70,29 @@ type GenLayerTransaction = {
70
70
  };
71
71
  type TransactionDataElement = string | number | bigint | boolean | Uint8Array;
72
72
 
73
+ type ContractParamsArraySchemaElement = ContractParamsSchema | {
74
+ $rep: ContractParamsSchema;
75
+ };
76
+ type ContractParamsSchema = "null" | "bool" | "int" | "address" | "string" | "bytes" | "any" | "array" | "dict" | {
77
+ $or: ContractParamsSchema[];
78
+ } | {
79
+ $dict: ContractParamsSchema;
80
+ } | {
81
+ [key: string]: ContractParamsSchema;
82
+ } | ContractParamsArraySchemaElement[];
83
+ interface ContractMethodBase {
84
+ params: [string, ContractParamsSchema][];
85
+ kwparams: {
86
+ [key: string]: ContractParamsSchema;
87
+ };
88
+ }
89
+ interface ContractMethod extends ContractMethodBase {
90
+ ret: ContractParamsSchema;
91
+ readonly: boolean;
92
+ }
73
93
  type ContractSchema = {
74
- abi: Array<{
75
- inputs?: Array<{
76
- name: string;
77
- type: string;
78
- }>;
79
- name?: string;
80
- outputs?: Array<{
81
- name: string;
82
- type: string;
83
- }>;
84
- type: "constructor" | "function";
85
- }>;
86
- class: string;
94
+ ctor: ContractMethodBase;
95
+ methods: ContractMethod[];
87
96
  };
88
97
 
89
98
  type GenLayerMethod = {
@@ -153,4 +162,4 @@ type GenLayerClient<TSimulatorChain extends SimulatorChain> = Omit<Client<Transp
153
162
  getContractSchemaForCode: (contractCode: string) => Promise<ContractSchema>;
154
163
  };
155
164
 
156
- export { type Address$1 as Address, type CalldataEncodable, type ContractSchema, type GenLayerClient, type GenLayerMethod, type GenLayerTransaction, type MethodDescription, SimulatorChain, type TransactionData, type TransactionDataElement, type TransactionHash, TransactionStatus };
165
+ export { type Address$1 as Address, type CalldataEncodable, type ContractMethod, type ContractMethodBase, type ContractParamsArraySchemaElement, type ContractParamsSchema, type ContractSchema, type GenLayerClient, type GenLayerMethod, type GenLayerTransaction, type MethodDescription, SimulatorChain, type TransactionData, type TransactionDataElement, type TransactionHash, TransactionStatus };
@@ -70,20 +70,29 @@ type GenLayerTransaction = {
70
70
  };
71
71
  type TransactionDataElement = string | number | bigint | boolean | Uint8Array;
72
72
 
73
+ type ContractParamsArraySchemaElement = ContractParamsSchema | {
74
+ $rep: ContractParamsSchema;
75
+ };
76
+ type ContractParamsSchema = "null" | "bool" | "int" | "address" | "string" | "bytes" | "any" | "array" | "dict" | {
77
+ $or: ContractParamsSchema[];
78
+ } | {
79
+ $dict: ContractParamsSchema;
80
+ } | {
81
+ [key: string]: ContractParamsSchema;
82
+ } | ContractParamsArraySchemaElement[];
83
+ interface ContractMethodBase {
84
+ params: [string, ContractParamsSchema][];
85
+ kwparams: {
86
+ [key: string]: ContractParamsSchema;
87
+ };
88
+ }
89
+ interface ContractMethod extends ContractMethodBase {
90
+ ret: ContractParamsSchema;
91
+ readonly: boolean;
92
+ }
73
93
  type ContractSchema = {
74
- abi: Array<{
75
- inputs?: Array<{
76
- name: string;
77
- type: string;
78
- }>;
79
- name?: string;
80
- outputs?: Array<{
81
- name: string;
82
- type: string;
83
- }>;
84
- type: "constructor" | "function";
85
- }>;
86
- class: string;
94
+ ctor: ContractMethodBase;
95
+ methods: ContractMethod[];
87
96
  };
88
97
 
89
98
  type GenLayerMethod = {
@@ -153,4 +162,4 @@ type GenLayerClient<TSimulatorChain extends SimulatorChain> = Omit<Client<Transp
153
162
  getContractSchemaForCode: (contractCode: string) => Promise<ContractSchema>;
154
163
  };
155
164
 
156
- export { type Address$1 as Address, type CalldataEncodable, type ContractSchema, type GenLayerClient, type GenLayerMethod, type GenLayerTransaction, type MethodDescription, SimulatorChain, type TransactionData, type TransactionDataElement, type TransactionHash, TransactionStatus };
165
+ export { type Address$1 as Address, type CalldataEncodable, type ContractMethod, type ContractMethodBase, type ContractParamsArraySchemaElement, type ContractParamsSchema, type ContractSchema, type GenLayerClient, type GenLayerMethod, type GenLayerTransaction, type MethodDescription, SimulatorChain, type TransactionData, type TransactionDataElement, type TransactionHash, TransactionStatus };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "genlayer-js",
3
3
  "type": "module",
4
- "version": "0.4.3",
4
+ "version": "0.4.4",
5
5
  "description": "GenLayer JavaScript SDK",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -1,15 +1,31 @@
1
+ export type ContractParamsArraySchemaElement = ContractParamsSchema | {$rep: ContractParamsSchema};
2
+
3
+ export type ContractParamsSchema =
4
+ | "null"
5
+ | "bool"
6
+ | "int"
7
+ | "address"
8
+ | "string"
9
+ | "bytes"
10
+ | "any"
11
+ | "array"
12
+ | "dict"
13
+ | {$or: ContractParamsSchema[]}
14
+ | {$dict: ContractParamsSchema}
15
+ | {[key: string]: ContractParamsSchema}
16
+ | ContractParamsArraySchemaElement[];
17
+
18
+ export interface ContractMethodBase {
19
+ params: [string, ContractParamsSchema][];
20
+ kwparams: {[key: string]: ContractParamsSchema};
21
+ }
22
+
23
+ export interface ContractMethod extends ContractMethodBase {
24
+ ret: ContractParamsSchema;
25
+ readonly: boolean;
26
+ }
27
+
1
28
  export type ContractSchema = {
2
- abi: Array<{
3
- inputs?: Array<{
4
- name: string;
5
- type: string;
6
- }>;
7
- name?: string;
8
- outputs?: Array<{
9
- name: string;
10
- type: string;
11
- }>;
12
- type: "constructor" | "function";
13
- }>;
14
- class: string;
29
+ ctor: ContractMethodBase;
30
+ methods: ContractMethod[];
15
31
  };