@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.js
CHANGED
|
@@ -648,10 +648,17 @@ var SuiInteractor = class {
|
|
|
648
648
|
}) {
|
|
649
649
|
for (const clientIdx in this.clients) {
|
|
650
650
|
try {
|
|
651
|
+
const txResOptions = {
|
|
652
|
+
showEvents: true,
|
|
653
|
+
showEffects: true,
|
|
654
|
+
showObjectChanges: true,
|
|
655
|
+
showBalanceChanges: true
|
|
656
|
+
};
|
|
651
657
|
return await this.clients[clientIdx].waitForTransaction({
|
|
652
658
|
digest,
|
|
653
659
|
timeout,
|
|
654
|
-
pollInterval
|
|
660
|
+
pollInterval,
|
|
661
|
+
options: txResOptions
|
|
655
662
|
});
|
|
656
663
|
} catch (err) {
|
|
657
664
|
console.warn(
|
|
@@ -1019,6 +1026,12 @@ function numberToAddressHex(num) {
|
|
|
1019
1026
|
const paddedHex = "0x" + hex.padStart(64, "0");
|
|
1020
1027
|
return paddedHex;
|
|
1021
1028
|
}
|
|
1029
|
+
function normalizePackageId(input) {
|
|
1030
|
+
const withPrefix = input.startsWith("0x") ? input : "0x" + input;
|
|
1031
|
+
const withoutPrefix = withPrefix.slice(2);
|
|
1032
|
+
const normalized = withoutPrefix.replace(/^0+/, "");
|
|
1033
|
+
return "0x" + normalized;
|
|
1034
|
+
}
|
|
1022
1035
|
|
|
1023
1036
|
// src/dubhe.ts
|
|
1024
1037
|
var import_bcs3 = require("@mysten/bcs");
|
|
@@ -1586,7 +1599,7 @@ var Dubhe = class {
|
|
|
1586
1599
|
this.accountManager = new SuiAccountManager({ mnemonics, secretKey });
|
|
1587
1600
|
fullnodeUrls = fullnodeUrls || [(0, import_client2.getFullnodeUrl)(networkType ?? "mainnet")];
|
|
1588
1601
|
this.suiInteractor = new SuiInteractor(fullnodeUrls, networkType);
|
|
1589
|
-
this.packageId = packageId;
|
|
1602
|
+
this.packageId = packageId ? normalizePackageId(packageId) : void 0;
|
|
1590
1603
|
if (metadata !== void 0) {
|
|
1591
1604
|
this.metadata = metadata;
|
|
1592
1605
|
const maxLoopNum = 5;
|