@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.mjs
CHANGED
|
@@ -616,14 +616,35 @@ var MwaWalletAdapter = class {
|
|
|
616
616
|
}
|
|
617
617
|
async signAndSendTransaction(transaction) {
|
|
618
618
|
if (!this._connected) throw new Error("Wallet not connected");
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
this.
|
|
622
|
-
|
|
623
|
-
|
|
619
|
+
let signature;
|
|
620
|
+
try {
|
|
621
|
+
signature = await this.transact(async (wallet) => {
|
|
622
|
+
const reauth = await wallet.reauthorize({ auth_token: this._authToken });
|
|
623
|
+
this.applyAuthResult(reauth);
|
|
624
|
+
const result = await wallet.signAndSendTransactions({
|
|
625
|
+
transactions: [transaction]
|
|
626
|
+
});
|
|
627
|
+
return result[0];
|
|
624
628
|
});
|
|
625
|
-
|
|
626
|
-
|
|
629
|
+
} catch (err) {
|
|
630
|
+
console.error("[Dubs:MWA] ===== signAndSendTransaction ERROR DUMP =====");
|
|
631
|
+
console.error("[Dubs:MWA] typeof:", typeof err);
|
|
632
|
+
console.error("[Dubs:MWA] value:", err);
|
|
633
|
+
console.error("[Dubs:MWA] message:", err?.message);
|
|
634
|
+
console.error("[Dubs:MWA] name:", err?.name);
|
|
635
|
+
console.error("[Dubs:MWA] code:", err?.code);
|
|
636
|
+
console.error("[Dubs:MWA] cause:", err?.cause);
|
|
637
|
+
console.error("[Dubs:MWA] stack:", err?.stack);
|
|
638
|
+
console.error("[Dubs:MWA] JSON:", (() => {
|
|
639
|
+
try {
|
|
640
|
+
return JSON.stringify(err, Object.getOwnPropertyNames(err ?? {}));
|
|
641
|
+
} catch {
|
|
642
|
+
return "unstringifiable";
|
|
643
|
+
}
|
|
644
|
+
})());
|
|
645
|
+
console.error("[Dubs:MWA] ===== END DUMP =====");
|
|
646
|
+
throw err;
|
|
647
|
+
}
|
|
627
648
|
if (signature instanceof Uint8Array) {
|
|
628
649
|
return new PublicKey(signature).toBase58();
|
|
629
650
|
}
|
|
@@ -1829,37 +1850,23 @@ function useClaim() {
|
|
|
1829
1850
|
console.log("[useClaim] Complete!");
|
|
1830
1851
|
return result;
|
|
1831
1852
|
} catch (err) {
|
|
1832
|
-
console.error("[useClaim]
|
|
1833
|
-
console.
|
|
1834
|
-
console.
|
|
1835
|
-
console.
|
|
1836
|
-
console.
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
for (const key of Object.keys(err)) {
|
|
1846
|
-
extras[key] = err[key];
|
|
1853
|
+
console.error("[useClaim] ===== CLAIM ERROR DUMP =====");
|
|
1854
|
+
console.error("[useClaim] typeof:", typeof err);
|
|
1855
|
+
console.error("[useClaim] value:", err);
|
|
1856
|
+
console.error("[useClaim] message:", err?.message);
|
|
1857
|
+
console.error("[useClaim] name:", err?.name);
|
|
1858
|
+
console.error("[useClaim] code:", err?.code);
|
|
1859
|
+
console.error("[useClaim] cause:", err?.cause);
|
|
1860
|
+
console.error("[useClaim] stack:", err?.stack);
|
|
1861
|
+
console.error("[useClaim] JSON:", (() => {
|
|
1862
|
+
try {
|
|
1863
|
+
return JSON.stringify(err, Object.getOwnPropertyNames(err ?? {}));
|
|
1864
|
+
} catch {
|
|
1865
|
+
return "unstringifiable";
|
|
1847
1866
|
}
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
}
|
|
1852
|
-
console.log("[useClaim] Serialized for /errors/parse:", JSON.stringify(rawError));
|
|
1853
|
-
let parsed;
|
|
1854
|
-
try {
|
|
1855
|
-
parsed = await client.parseError(rawError);
|
|
1856
|
-
console.log("[useClaim] Server parsed result:", JSON.stringify(parsed));
|
|
1857
|
-
} catch (parseErr) {
|
|
1858
|
-
console.error("[useClaim] /errors/parse call failed:", parseErr);
|
|
1859
|
-
parsed = { code: "transaction_failed", message: err instanceof Error ? err.message : String(err) };
|
|
1860
|
-
}
|
|
1861
|
-
const error2 = new Error(parsed.message);
|
|
1862
|
-
error2.code = parsed.code;
|
|
1867
|
+
})());
|
|
1868
|
+
console.error("[useClaim] ===== END DUMP =====");
|
|
1869
|
+
const error2 = err instanceof Error ? err : new Error(String(err));
|
|
1863
1870
|
setError(error2);
|
|
1864
1871
|
setStatus("error");
|
|
1865
1872
|
throw error2;
|