@0xobelisk/sui-client 0.5.20 → 0.5.22
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.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/obelisk.ts +8 -6
package/src/obelisk.ts
CHANGED
|
@@ -181,8 +181,10 @@ export class Obelisk {
|
|
|
181
181
|
if (metadata !== undefined) {
|
|
182
182
|
this.metadata = metadata as SuiMoveNormalizedModules;
|
|
183
183
|
|
|
184
|
+
const maxLoopNum = 5;
|
|
185
|
+
let loopNum = 0;
|
|
184
186
|
let stillNeedFormat = true;
|
|
185
|
-
while (stillNeedFormat === true) {
|
|
187
|
+
while (stillNeedFormat === true && loopNum <= maxLoopNum) {
|
|
186
188
|
let loopFlag = false;
|
|
187
189
|
Object.values(metadata as SuiMoveNormalizedModules).forEach(
|
|
188
190
|
(moudlevalue) => {
|
|
@@ -237,6 +239,7 @@ export class Obelisk {
|
|
|
237
239
|
);
|
|
238
240
|
|
|
239
241
|
stillNeedFormat = loopFlag;
|
|
242
|
+
loopNum++;
|
|
240
243
|
}
|
|
241
244
|
}
|
|
242
245
|
this.contractFactory = new SuiContractFactory({
|
|
@@ -829,17 +832,16 @@ export class Obelisk {
|
|
|
829
832
|
): Promise<any[] | undefined> {
|
|
830
833
|
const schemaModuleName = `${schemaName}_schema`;
|
|
831
834
|
const tx = new Transaction();
|
|
832
|
-
const params = [tx.
|
|
835
|
+
const params = [tx.object(worldId)] as TransactionArgument[];
|
|
833
836
|
|
|
834
837
|
if (entityId !== undefined) {
|
|
835
|
-
params.push(tx.
|
|
838
|
+
params.push(tx.object(entityId));
|
|
836
839
|
}
|
|
837
840
|
|
|
838
841
|
const dryResult = (await this.query[schemaModuleName].get(
|
|
839
842
|
tx,
|
|
840
843
|
params
|
|
841
844
|
)) as DevInspectResults;
|
|
842
|
-
|
|
843
845
|
// "success" | "failure";
|
|
844
846
|
return this.view(dryResult);
|
|
845
847
|
}
|
|
@@ -851,10 +853,10 @@ export class Obelisk {
|
|
|
851
853
|
): Promise<boolean | undefined> {
|
|
852
854
|
const schemaModuleName = `${schemaName}_schema`;
|
|
853
855
|
const tx = new Transaction();
|
|
854
|
-
const params = [tx.
|
|
856
|
+
const params = [tx.object(worldId)] as TransactionArgument[];
|
|
855
857
|
|
|
856
858
|
if (entityId !== undefined) {
|
|
857
|
-
params.push(tx.
|
|
859
|
+
params.push(tx.object(entityId));
|
|
858
860
|
}
|
|
859
861
|
|
|
860
862
|
const dryResult = (await this.query[schemaModuleName].contains(
|