@0xobelisk/sui-common 0.5.23 → 0.5.25

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.
@@ -9,25 +9,13 @@ import { generateSchemaEvent } from './generateEvent';
9
9
  import { generateSystem } from './generateSystem';
10
10
  import { generateSchemaHub } from './generateSchemaHub';
11
11
  import { generateSchemaError } from './generateError';
12
-
13
- function matchFrameworkId(
14
- network: 'mainnet' | 'testnet' | 'devnet' | 'localnet',
15
- ): string {
16
- switch (network) {
17
- case 'testnet':
18
- return '0x417ad1864a56a29ad0b5aaddd2e11bac1eeab6a68883ef53184a4cc5c293fec6';
19
- case 'localnet':
20
- return '0x417ad1864a56a29ad0b5aaddd2e11bac1eeab6a68883ef53184a4cc5c293fec6';
21
- default:
22
- return '0x417ad1864a56a29ad0b5aaddd2e11bac1eeab6a68883ef53184a4cc5c293fec6';
23
- }
24
- }
12
+ import {generateDefaultSchema} from "./generateDefaultSchema";
13
+ import {generateInit} from "./generateInit";
25
14
 
26
15
  export async function schemaGen(
27
16
  config: DubheConfig,
28
17
  srcPrefix?: string,
29
- network?: 'mainnet' | 'testnet' | 'devnet' | 'localnet',
30
- frameworkId?: string,
18
+ network?: 'mainnet' | 'testnet' | 'devnet' | 'localnet'
31
19
  ) {
32
20
  console.log('\nšŸš€ Starting Schema Generation Process...');
33
21
  console.log('šŸ“‹ Project Configuration:');
@@ -36,16 +24,9 @@ export async function schemaGen(
36
24
  ` ā”œā”€ Description: ${config.description || 'No description provided'}`,
37
25
  );
38
26
  console.log(` ā”œā”€ Network: ${network || 'testnet'}`);
39
- console.log(
40
- ` └─ Framework ID: ${
41
- frameworkId || matchFrameworkId(network ?? 'testnet')
42
- }\n`,
43
- );
44
27
 
45
28
  const path = srcPrefix ?? process.cwd();
46
29
 
47
- frameworkId = frameworkId || matchFrameworkId(network ?? 'testnet');
48
-
49
30
  if (existsSync(`${path}/contracts/${config.name}`)) {
50
31
  deleteFolderRecursive(
51
32
  `${path}/contracts/${config.name}/sources/codegen`,
@@ -53,7 +34,7 @@ export async function schemaGen(
53
34
  }
54
35
 
55
36
  if (!existsSync(`${path}/contracts/${config.name}/Move.toml`)) {
56
- await generateToml(config, path, frameworkId);
37
+ await generateToml(config, path);
57
38
  }
58
39
 
59
40
  if (
@@ -68,8 +49,9 @@ export async function schemaGen(
68
49
  await generateSchemaStructure(config.name, config.schemas, path);
69
50
  await generateSchemaEvent(config.name, config.schemas, path);
70
51
  await generateSchemaError(config.name, config.schemas, path);
71
- await generateDappKey(config, path);
72
- await generateSchemaHub(config, path);
52
+
53
+ await generateDefaultSchema(config, path);
54
+ await generateInit(config, path);
73
55
  await generateSystem(config, path);
74
56
  await generateMigrate(config, path);
75
57