@0xobelisk/sui-cli 1.2.0-pre.110 → 1.2.0-pre.112

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": "@0xobelisk/sui-cli",
3
- "version": "1.2.0-pre.110",
3
+ "version": "1.2.0-pre.112",
4
4
  "description": "Tookit for interacting with move eps framework",
5
5
  "keywords": [
6
6
  "sui",
@@ -47,8 +47,8 @@
47
47
  "yargs": "^17.7.1",
48
48
  "zod": "^3.22.3",
49
49
  "zod-validation-error": "^1.3.0",
50
- "@0xobelisk/sui-client": "1.2.0-pre.110",
51
- "@0xobelisk/sui-common": "1.2.0-pre.110"
50
+ "@0xobelisk/sui-client": "1.2.0-pre.112",
51
+ "@0xobelisk/sui-common": "1.2.0-pre.112"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/cli-progress": "^3.11.5",
@@ -370,7 +370,6 @@ async function publishContract(
370
370
  let version = 1;
371
371
  let packageId = '';
372
372
  let dappHub = '';
373
- let components = dubheConfig.components;
374
373
  let resources = dubheConfig.resources;
375
374
  let enums = dubheConfig.enums;
376
375
  let upgradeCapId = '';
@@ -450,7 +449,6 @@ async function publishContract(
450
449
  dubheDappHub,
451
450
  upgradeCapId,
452
451
  version,
453
- components,
454
452
  resources,
455
453
  enums
456
454
  );
@@ -627,7 +625,6 @@ export async function publishDubheFramework(
627
625
  upgradeCapId,
628
626
  version,
629
627
  {},
630
- {},
631
628
  {}
632
629
  );
633
630
 
@@ -10,7 +10,6 @@ import {
10
10
  switchEnv,
11
11
  initializeDubhe,
12
12
  getOnchainResources,
13
- getOnchainComponents,
14
13
  getStartCheckpoint,
15
14
  updateGenesisUpgradeFunction,
16
15
  getDubheDappHub,
@@ -88,7 +87,6 @@ export async function upgradeHandler(
88
87
  let startCheckpoint = await getStartCheckpoint(projectPath, network);
89
88
  let dappHub = await getDubheDappHub(network);
90
89
  let onchainResources = await getOnchainResources(projectPath, network);
91
- let onchainComponents = await getOnchainComponents(projectPath, network);
92
90
 
93
91
  let pendingMigration: Migration[] = [];
94
92
  Object.entries(config.resources).forEach(([key, value]) => {
@@ -96,11 +94,6 @@ export async function upgradeHandler(
96
94
  pendingMigration.push({ name: key, fields: value });
97
95
  }
98
96
  });
99
- Object.entries(config.components).forEach(([key, value]) => {
100
- if (!onchainComponents.hasOwnProperty(key)) {
101
- pendingMigration.push({ name: key, fields: value });
102
- }
103
- });
104
97
 
105
98
  const tables = pendingMigration.map((migration) => migration.name);
106
99
  // Only update genesis.move when there are new tables to register.
@@ -254,7 +247,6 @@ export async function upgradeHandler(
254
247
  dappHub,
255
248
  upgradeCap,
256
249
  oldVersion + 1,
257
- config.components,
258
250
  config.resources,
259
251
  config.enums
260
252
  );
@@ -8,7 +8,7 @@ import chalk from 'chalk';
8
8
  import { spawn } from 'child_process';
9
9
  import { Dubhe, NetworkType, SuiMoveNormalizedModules, loadMetadata } from '@0xobelisk/sui-client';
10
10
  import { DubheCliError } from './errors';
11
- import { Component, MoveType, EmptyComponent, DubheConfig } from '@0xobelisk/sui-common';
11
+ import { Component, MoveType, DubheConfig } from '@0xobelisk/sui-common';
12
12
  import { TESTNET_DUBHE_HUB_OBJECT_ID, TESTNET_ORIGINAL_DUBHE_PACKAGE_ID } from './constants';
13
13
 
14
14
  export type DeploymentJsonType = {
@@ -19,7 +19,6 @@ export type DeploymentJsonType = {
19
19
  dappHub: string;
20
20
  upgradeCap: string;
21
21
  version: number;
22
- components: Record<string, Component | MoveType | EmptyComponent>;
23
22
  resources: Record<string, Component | MoveType>;
24
23
  enums?: Record<string, string[]>;
25
24
  };
@@ -128,14 +127,6 @@ export async function getOriginalDubhePackageId(network: string) {
128
127
  throw new Error(`Invalid network: ${network}`);
129
128
  }
130
129
  }
131
- export async function getOnchainComponents(
132
- projectPath: string,
133
- network: string
134
- ): Promise<Record<string, Component | MoveType | EmptyComponent>> {
135
- const deployment = await getDeploymentJson(projectPath, network);
136
- return deployment.components;
137
- }
138
-
139
130
  export async function getOnchainResources(
140
131
  projectPath: string,
141
132
  network: string
@@ -185,7 +176,6 @@ export async function saveContractData(
185
176
  dappHub: string,
186
177
  upgradeCap: string,
187
178
  version: number,
188
- components: Record<string, Component | MoveType | EmptyComponent>,
189
179
  resources: Record<string, Component | MoveType>,
190
180
  enums?: Record<string, string[]>
191
181
  ) {
@@ -197,7 +187,6 @@ export async function saveContractData(
197
187
  dappHub,
198
188
  upgradeCap,
199
189
  version,
200
- components,
201
190
  resources,
202
191
  enums
203
192
  };
@@ -773,53 +762,6 @@ export function initializeDubhe({
773
762
  }
774
763
 
775
764
  export function generateConfigJson(config: DubheConfig): string {
776
- const components = Object.entries(config.components).map(([name, component]) => {
777
- if (typeof component === 'string') {
778
- return {
779
- [name]: {
780
- fields: [{ entity_id: 'address' }, { value: component }],
781
- keys: ['entity_id'],
782
- offchain: false
783
- }
784
- };
785
- }
786
-
787
- if (Object.keys(component as object).length === 0) {
788
- return {
789
- [name]: {
790
- fields: [{ entity_id: 'address' }],
791
- keys: ['entity_id'],
792
- offchain: false
793
- }
794
- };
795
- }
796
-
797
- const fields = (component as any).fields || {};
798
- const keys = (component as any).keys || ['entity_id'];
799
- const offchain = (component as any).offchain ?? false;
800
-
801
- // ensure entity_id field exists
802
- if (!fields.entity_id && keys.includes('entity_id')) {
803
- fields.entity_id = 'address';
804
- }
805
-
806
- // prepare fields with entity_id first
807
- const fieldEntries = Object.entries(fields);
808
- const entityIdField = fieldEntries.find(([key]) => key === 'entity_id');
809
- const otherFields = fieldEntries.filter(([key]) => key !== 'entity_id');
810
- const orderedFields = entityIdField ? [entityIdField, ...otherFields] : otherFields;
811
-
812
- return {
813
- [name]: {
814
- fields: orderedFields.map(([fieldName, fieldType]) => ({
815
- [fieldName]: fieldType
816
- })),
817
- keys: keys,
818
- offchain: offchain
819
- }
820
- };
821
- });
822
-
823
765
  const resources = Object.entries(config.resources).map(([name, resource]) => {
824
766
  // Simple type shorthand (e.g., counter1: 'u32') – entity-keyed by account (entity_id: String).
825
767
  if (typeof resource === 'string') {
@@ -909,7 +851,6 @@ export function generateConfigJson(config: DubheConfig): string {
909
851
 
910
852
  return JSON.stringify(
911
853
  {
912
- components,
913
854
  resources,
914
855
  enums
915
856
  },