@dubsdotapp/expo 0.2.36 → 0.2.38
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 +44 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +44 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useClaim.ts +12 -33
- package/src/wallet/mwa-adapter.ts +23 -8
package/dist/index.js
CHANGED
|
@@ -685,14 +685,35 @@ var MwaWalletAdapter = class {
|
|
|
685
685
|
}
|
|
686
686
|
async signAndSendTransaction(transaction) {
|
|
687
687
|
if (!this._connected) throw new Error("Wallet not connected");
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
this.
|
|
691
|
-
|
|
692
|
-
|
|
688
|
+
let signature;
|
|
689
|
+
try {
|
|
690
|
+
signature = await this.transact(async (wallet) => {
|
|
691
|
+
const reauth = await wallet.reauthorize({ auth_token: this._authToken });
|
|
692
|
+
this.applyAuthResult(reauth);
|
|
693
|
+
const result = await wallet.signAndSendTransactions({
|
|
694
|
+
transactions: [transaction]
|
|
695
|
+
});
|
|
696
|
+
return result[0];
|
|
693
697
|
});
|
|
694
|
-
|
|
695
|
-
|
|
698
|
+
} catch (err) {
|
|
699
|
+
console.error("[Dubs:MWA] ===== signAndSendTransaction ERROR DUMP =====");
|
|
700
|
+
console.error("[Dubs:MWA] typeof:", typeof err);
|
|
701
|
+
console.error("[Dubs:MWA] value:", err);
|
|
702
|
+
console.error("[Dubs:MWA] message:", err?.message);
|
|
703
|
+
console.error("[Dubs:MWA] name:", err?.name);
|
|
704
|
+
console.error("[Dubs:MWA] code:", err?.code);
|
|
705
|
+
console.error("[Dubs:MWA] cause:", err?.cause);
|
|
706
|
+
console.error("[Dubs:MWA] stack:", err?.stack);
|
|
707
|
+
console.error("[Dubs:MWA] JSON:", (() => {
|
|
708
|
+
try {
|
|
709
|
+
return JSON.stringify(err, Object.getOwnPropertyNames(err ?? {}));
|
|
710
|
+
} catch {
|
|
711
|
+
return "unstringifiable";
|
|
712
|
+
}
|
|
713
|
+
})());
|
|
714
|
+
console.error("[Dubs:MWA] ===== END DUMP =====");
|
|
715
|
+
throw err;
|
|
716
|
+
}
|
|
696
717
|
if (signature instanceof Uint8Array) {
|
|
697
718
|
return new import_web3.PublicKey(signature).toBase58();
|
|
698
719
|
}
|
|
@@ -1878,37 +1899,23 @@ function useClaim() {
|
|
|
1878
1899
|
console.log("[useClaim] Complete!");
|
|
1879
1900
|
return result;
|
|
1880
1901
|
} catch (err) {
|
|
1881
|
-
console.error("[useClaim]
|
|
1882
|
-
console.
|
|
1883
|
-
console.
|
|
1884
|
-
console.
|
|
1885
|
-
console.
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
for (const key of Object.keys(err)) {
|
|
1895
|
-
extras[key] = err[key];
|
|
1902
|
+
console.error("[useClaim] ===== CLAIM ERROR DUMP =====");
|
|
1903
|
+
console.error("[useClaim] typeof:", typeof err);
|
|
1904
|
+
console.error("[useClaim] value:", err);
|
|
1905
|
+
console.error("[useClaim] message:", err?.message);
|
|
1906
|
+
console.error("[useClaim] name:", err?.name);
|
|
1907
|
+
console.error("[useClaim] code:", err?.code);
|
|
1908
|
+
console.error("[useClaim] cause:", err?.cause);
|
|
1909
|
+
console.error("[useClaim] stack:", err?.stack);
|
|
1910
|
+
console.error("[useClaim] JSON:", (() => {
|
|
1911
|
+
try {
|
|
1912
|
+
return JSON.stringify(err, Object.getOwnPropertyNames(err ?? {}));
|
|
1913
|
+
} catch {
|
|
1914
|
+
return "unstringifiable";
|
|
1896
1915
|
}
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
}
|
|
1901
|
-
console.log("[useClaim] Serialized for /errors/parse:", JSON.stringify(rawError));
|
|
1902
|
-
let parsed;
|
|
1903
|
-
try {
|
|
1904
|
-
parsed = await client.parseError(rawError);
|
|
1905
|
-
console.log("[useClaim] Server parsed result:", JSON.stringify(parsed));
|
|
1906
|
-
} catch (parseErr) {
|
|
1907
|
-
console.error("[useClaim] /errors/parse call failed:", parseErr);
|
|
1908
|
-
parsed = { code: "transaction_failed", message: err instanceof Error ? err.message : String(err) };
|
|
1909
|
-
}
|
|
1910
|
-
const error2 = new Error(parsed.message);
|
|
1911
|
-
error2.code = parsed.code;
|
|
1916
|
+
})());
|
|
1917
|
+
console.error("[useClaim] ===== END DUMP =====");
|
|
1918
|
+
const error2 = err instanceof Error ? err : new Error(String(err));
|
|
1912
1919
|
setError(error2);
|
|
1913
1920
|
setStatus("error");
|
|
1914
1921
|
throw error2;
|