@dubsdotapp/expo 0.2.37 → 0.2.39
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.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +50 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/hooks/useClaim.ts +11 -2
- package/src/ui/game/ClaimPrizeSheet.tsx +9 -4
- 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,7 +1850,22 @@ function useClaim() {
|
|
|
1829
1850
|
console.log("[useClaim] Complete!");
|
|
1830
1851
|
return result;
|
|
1831
1852
|
} catch (err) {
|
|
1832
|
-
console.error("[useClaim]
|
|
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";
|
|
1866
|
+
}
|
|
1867
|
+
})());
|
|
1868
|
+
console.error("[useClaim] ===== END DUMP =====");
|
|
1833
1869
|
const error2 = err instanceof Error ? err : new Error(String(err));
|
|
1834
1870
|
setError(error2);
|
|
1835
1871
|
setStatus("error");
|
|
@@ -4289,6 +4325,7 @@ function ClaimPrizeSheet({
|
|
|
4289
4325
|
onDismiss,
|
|
4290
4326
|
gameId,
|
|
4291
4327
|
prizeAmount,
|
|
4328
|
+
isRefund = false,
|
|
4292
4329
|
onSuccess,
|
|
4293
4330
|
onError
|
|
4294
4331
|
}) {
|
|
@@ -4373,7 +4410,7 @@ function ClaimPrizeSheet({
|
|
|
4373
4410
|
children: /* @__PURE__ */ jsx14(View12, { style: styles11.sheetPositioner, children: /* @__PURE__ */ jsxs12(View12, { style: [styles11.sheet, { backgroundColor: t.background }], children: [
|
|
4374
4411
|
/* @__PURE__ */ jsx14(View12, { style: styles11.handleRow, children: /* @__PURE__ */ jsx14(View12, { style: [styles11.handle, { backgroundColor: t.textMuted }] }) }),
|
|
4375
4412
|
/* @__PURE__ */ jsxs12(View12, { style: styles11.header, children: [
|
|
4376
|
-
/* @__PURE__ */ jsx14(Text12, { style: [styles11.headerTitle, { color: t.text }], children: showCelebration ? "Prize Claimed!" : "Claim Prize" }),
|
|
4413
|
+
/* @__PURE__ */ jsx14(Text12, { style: [styles11.headerTitle, { color: t.text }], children: showCelebration ? isRefund ? "Refund Claimed!" : "Prize Claimed!" : isRefund ? "Claim Refund" : "Claim Prize" }),
|
|
4377
4414
|
/* @__PURE__ */ jsx14(TouchableOpacity8, { onPress: onDismiss, activeOpacity: 0.8, children: /* @__PURE__ */ jsx14(Text12, { style: [styles11.closeButton, { color: t.textMuted }], children: "\u2715" }) })
|
|
4378
4415
|
] }),
|
|
4379
4416
|
showCelebration && /* @__PURE__ */ jsxs12(
|
|
@@ -4393,13 +4430,13 @@ function ClaimPrizeSheet({
|
|
|
4393
4430
|
prizeAmount,
|
|
4394
4431
|
" SOL"
|
|
4395
4432
|
] }),
|
|
4396
|
-
/* @__PURE__ */ jsx14(Text12, { style: [styles11.celebrationSubtext, { color: t.textMuted }], children: "Winnings sent to your wallet" })
|
|
4433
|
+
/* @__PURE__ */ jsx14(Text12, { style: [styles11.celebrationSubtext, { color: t.textMuted }], children: isRefund ? "Refund sent to your wallet" : "Winnings sent to your wallet" })
|
|
4397
4434
|
]
|
|
4398
4435
|
}
|
|
4399
4436
|
),
|
|
4400
4437
|
!showCelebration && /* @__PURE__ */ jsxs12(View12, { style: [styles11.summaryCard, { backgroundColor: t.surface, borderColor: t.border }], children: [
|
|
4401
4438
|
/* @__PURE__ */ jsxs12(View12, { style: styles11.summaryRow, children: [
|
|
4402
|
-
/* @__PURE__ */ jsx14(Text12, { style: [styles11.summaryLabel, { color: t.textMuted }], children: "Prize" }),
|
|
4439
|
+
/* @__PURE__ */ jsx14(Text12, { style: [styles11.summaryLabel, { color: t.textMuted }], children: isRefund ? "Refund" : "Prize" }),
|
|
4403
4440
|
/* @__PURE__ */ jsxs12(Text12, { style: [styles11.summaryValue, { color: t.success }], children: [
|
|
4404
4441
|
prizeAmount,
|
|
4405
4442
|
" SOL"
|
|
@@ -4437,7 +4474,8 @@ function ClaimPrizeSheet({
|
|
|
4437
4474
|
/* @__PURE__ */ jsx14(ActivityIndicator7, { size: "small", color: "#FFFFFF" }),
|
|
4438
4475
|
/* @__PURE__ */ jsx14(Text12, { style: styles11.ctaText, children: statusLabel })
|
|
4439
4476
|
] }) : /* @__PURE__ */ jsxs12(Text12, { style: [styles11.ctaText, !canClaim && { opacity: 0.5 }], children: [
|
|
4440
|
-
"Claim
|
|
4477
|
+
isRefund ? "Claim Refund" : "Claim Prize",
|
|
4478
|
+
" \u2014 ",
|
|
4441
4479
|
prizeAmount,
|
|
4442
4480
|
" SOL"
|
|
4443
4481
|
] })
|