@0xobelisk/sui-common 1.2.0-pre.1 → 1.2.0-pre.100

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.ts CHANGED
@@ -17,38 +17,36 @@ declare function formatAndWriteTypescript(output: string, fullOutputPath: string
17
17
  */
18
18
  declare function posixPath(path: string): string;
19
19
 
20
- type BaseType = 'String' | 'vector<String>' | 'address' | 'bool' | 'u8' | 'u32' | 'u64' | 'u128' | 'vector<address>' | 'vector<bool>' | 'vector<u8>' | 'vector<vector<u8>>' | 'vector<u32>' | 'vector<u64>' | 'vector<u128>' | string;
21
- type StorageDataType = 'Struct' | 'Enum';
22
- type StorageMapType = 'Map' | 'Bag' | 'Table';
23
- type Address = string;
24
- type Bool = boolean;
25
- type U8 = number;
26
- type U32 = number;
27
- type U64 = number;
28
- type U128 = number;
29
- type Vector<T> = T[];
30
- type BaseValueType = String | Address | Bool | U8 | U32 | U64 | U128 | Vector<Address> | Vector<Bool> | Vector<U8> | Vector<Vector<U8>> | Vector<U64> | Vector<U128>;
31
- type SchemaData = Record<string, string> | string[];
32
- type SchemaType = string;
33
- type EventData = Record<string, string>;
34
- type ErrorData = Record<string, string>;
35
- type DataType = any;
36
- declare function storage<T extends DataType>(value: T): SchemaType;
37
- declare function storage<K extends DataType, V extends DataType>(key: K, value: V): SchemaType;
38
- declare function storage<K1 extends DataType, K2 extends DataType, V extends DataType>(key1: K1, key2: K2, value: V): SchemaType;
39
- type Plugin = 'merak';
20
+ type ComponentType = 'Onchain' | 'Offchain';
21
+ type MoveType = 'address' | 'bool' | 'u8' | 'u32' | 'u64' | 'u128' | 'u256' | 'String' | 'vector<address>' | 'vector<bool>' | 'vector<u8>' | 'vector<vector<u8>>' | 'vector<u32>' | 'vector<u64>' | 'vector<u128>' | 'vector<u256>' | string;
22
+ type Component = {
23
+ offchain?: boolean;
24
+ fields: Record<string, MoveType>;
25
+ keys?: string[];
26
+ };
27
+ type EmptyComponent = Record<string, never>;
40
28
  type DubheConfig = {
41
29
  name: string;
42
30
  description: string;
43
- data?: Record<string, SchemaData>;
44
- schemas: Record<string, SchemaType>;
45
- events?: Record<string, EventData>;
46
- errors?: ErrorData;
47
- plugins?: Plugin[];
31
+ enums?: Record<string, string[]>;
32
+ components: Record<string, Component | MoveType | EmptyComponent>;
33
+ resources: Record<string, Component | MoveType>;
34
+ errors?: Record<string, string>;
35
+ };
36
+ type DubheMetadata = {
37
+ components: Record<string, Component | MoveType | EmptyComponent>;
38
+ resources: Record<string, Component | MoveType>;
39
+ enums: Record<string, string[]>;
48
40
  };
49
- type MoveType = 'string' | 'vector<string>' | 'String' | 'vector<String>' | 'address' | 'bool' | 'u8' | 'u32' | 'u64' | 'u128' | 'vector<address>' | 'vector<bool>' | 'vector<u8>' | 'vector<vector<u8>>' | 'vector<u32>' | 'vector<u64>' | 'vector<u128>';
41
+ type BaseType = any;
42
+ type ErrorData = any;
43
+ type EventData = any;
44
+ type SchemaData = any;
45
+ type SchemaType = any;
46
+
47
+ declare function schemaGen(rootDir: string, config: DubheConfig, network?: 'mainnet' | 'testnet' | 'devnet' | 'localnet'): Promise<void>;
50
48
 
51
- declare function schemaGen(config: DubheConfig, srcPrefix?: string, network?: 'mainnet' | 'testnet' | 'devnet' | 'localnet'): Promise<void>;
49
+ declare const defineConfig: (config: DubheConfig) => DubheConfig;
52
50
 
53
51
  declare function loadConfig(configPath?: string): Promise<unknown>;
54
52
  declare function resolveConfigPath(configPath: string | undefined, toFileURL?: boolean): Promise<string>;
@@ -68,4 +66,4 @@ type SubscribableType = {
68
66
  name?: string;
69
67
  };
70
68
 
71
- export { BaseType, BaseValueType, DubheConfig, ErrorData, EventData, MoveType, Plugin, SchemaData, SchemaType, StorageDataType, StorageMapType, SubscribableType, SubscriptionKind, formatAndWriteMove, formatAndWriteTypescript, formatMove, formatTypescript, loadConfig, parseData, posixPath, resolveConfigPath, schemaGen, storage };
69
+ export { BaseType, Component, ComponentType, DubheConfig, DubheMetadata, EmptyComponent, ErrorData, EventData, MoveType, SchemaData, SchemaType, SubscribableType, SubscriptionKind, defineConfig, formatAndWriteMove, formatAndWriteTypescript, formatMove, formatTypescript, loadConfig, parseData, posixPath, resolveConfigPath, schemaGen };