@0xobelisk/sui-cli 0.5.23 → 0.5.24
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/dubhe.js +39 -31
- package/dist/dubhe.js.map +1 -1
- package/package.json +3 -3
- package/src/commands/index.ts +2 -2
- package/src/commands/publish.ts +1 -1
- package/src/commands/upgrade.ts +43 -53
- package/src/utils/localnode/status.ts +1 -1
- package/src/utils/publishHandler.ts +49 -11
- package/src/utils/upgradeHandler.ts +238 -246
- package/src/utils/utils.ts +23 -3
package/src/utils/utils.ts
CHANGED
|
@@ -8,15 +8,17 @@ export * from './localnode';
|
|
|
8
8
|
export type schema = {
|
|
9
9
|
name: string;
|
|
10
10
|
objectId: string;
|
|
11
|
+
structure: Record<string, string>
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
export type DeploymentJsonType = {
|
|
14
15
|
projectName: string;
|
|
15
16
|
network: 'mainnet' | 'testnet' | 'devnet' | 'localnet';
|
|
16
17
|
packageId: string;
|
|
17
|
-
schemas: schema[];
|
|
18
18
|
upgradeCap: string;
|
|
19
|
+
schemaHub: string;
|
|
19
20
|
version: number;
|
|
21
|
+
schemas: schema[];
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
export function validatePrivateKey(privateKey: string): false | string {
|
|
@@ -75,6 +77,14 @@ async function getDeploymentJson(projectPath: string, network: string) {
|
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
|
|
80
|
+
export async function getOnchainSchemas(
|
|
81
|
+
projectPath: string,
|
|
82
|
+
network: string
|
|
83
|
+
): Promise<schema[]> {
|
|
84
|
+
const deployment = await getDeploymentJson(projectPath, network);
|
|
85
|
+
return deployment.schemas;
|
|
86
|
+
}
|
|
87
|
+
|
|
78
88
|
export async function getVersion(
|
|
79
89
|
projectPath: string,
|
|
80
90
|
network: string
|
|
@@ -107,6 +117,14 @@ export async function getUpgradeCap(
|
|
|
107
117
|
return deployment.upgradeCap;
|
|
108
118
|
}
|
|
109
119
|
|
|
120
|
+
export async function getSchemaHub(
|
|
121
|
+
projectPath: string,
|
|
122
|
+
network: string
|
|
123
|
+
): Promise<string> {
|
|
124
|
+
const deployment = await getDeploymentJson(projectPath, network);
|
|
125
|
+
return deployment.schemaHub;
|
|
126
|
+
}
|
|
127
|
+
|
|
110
128
|
export async function getObjectIdBySchemaName(
|
|
111
129
|
projectPath: string,
|
|
112
130
|
network: string,
|
|
@@ -121,9 +139,10 @@ export function saveContractData(
|
|
|
121
139
|
projectName: string,
|
|
122
140
|
network: 'mainnet' | 'testnet' | 'devnet' | 'localnet',
|
|
123
141
|
packageId: string,
|
|
124
|
-
schemas: schema[],
|
|
125
142
|
upgradeCap: string,
|
|
126
|
-
|
|
143
|
+
schemaHub: string,
|
|
144
|
+
version: number,
|
|
145
|
+
schemas: schema[],
|
|
127
146
|
) {
|
|
128
147
|
const DeploymentData: DeploymentJsonType = {
|
|
129
148
|
projectName,
|
|
@@ -131,6 +150,7 @@ export function saveContractData(
|
|
|
131
150
|
packageId,
|
|
132
151
|
schemas,
|
|
133
152
|
upgradeCap,
|
|
153
|
+
schemaHub,
|
|
134
154
|
version,
|
|
135
155
|
};
|
|
136
156
|
|