@0xobelisk/sui-client 1.0.4 → 1.0.6
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 +15 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -2
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/dubhe.ts +6 -2
- package/src/libs/suiInteractor/suiInteractor.ts +8 -0
- package/src/utils/index.ts +7 -0
package/dist/index.mjs
CHANGED
|
@@ -615,10 +615,17 @@ var SuiInteractor = class {
|
|
|
615
615
|
}) {
|
|
616
616
|
for (const clientIdx in this.clients) {
|
|
617
617
|
try {
|
|
618
|
+
const txResOptions = {
|
|
619
|
+
showEvents: true,
|
|
620
|
+
showEffects: true,
|
|
621
|
+
showObjectChanges: true,
|
|
622
|
+
showBalanceChanges: true
|
|
623
|
+
};
|
|
618
624
|
return await this.clients[clientIdx].waitForTransaction({
|
|
619
625
|
digest,
|
|
620
626
|
timeout,
|
|
621
|
-
pollInterval
|
|
627
|
+
pollInterval,
|
|
628
|
+
options: txResOptions
|
|
622
629
|
});
|
|
623
630
|
} catch (err) {
|
|
624
631
|
console.warn(
|
|
@@ -986,6 +993,12 @@ function numberToAddressHex(num) {
|
|
|
986
993
|
const paddedHex = "0x" + hex.padStart(64, "0");
|
|
987
994
|
return paddedHex;
|
|
988
995
|
}
|
|
996
|
+
function normalizePackageId(input) {
|
|
997
|
+
const withPrefix = input.startsWith("0x") ? input : "0x" + input;
|
|
998
|
+
const withoutPrefix = withPrefix.slice(2);
|
|
999
|
+
const normalized = withoutPrefix.replace(/^0+/, "");
|
|
1000
|
+
return "0x" + normalized;
|
|
1001
|
+
}
|
|
989
1002
|
|
|
990
1003
|
// src/dubhe.ts
|
|
991
1004
|
import { bcs as bcs2, fromHEX as fromHEX2, toHEX } from "@mysten/bcs";
|
|
@@ -1553,7 +1566,7 @@ var Dubhe = class {
|
|
|
1553
1566
|
this.accountManager = new SuiAccountManager({ mnemonics, secretKey });
|
|
1554
1567
|
fullnodeUrls = fullnodeUrls || [getFullnodeUrl(networkType ?? "mainnet")];
|
|
1555
1568
|
this.suiInteractor = new SuiInteractor(fullnodeUrls, networkType);
|
|
1556
|
-
this.packageId = packageId;
|
|
1569
|
+
this.packageId = packageId ? normalizePackageId(packageId) : void 0;
|
|
1557
1570
|
if (metadata !== void 0) {
|
|
1558
1571
|
this.metadata = metadata;
|
|
1559
1572
|
const maxLoopNum = 5;
|