@dubsdotapp/expo 0.2.32 → 0.2.33
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 +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +26 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +16 -0
- package/src/hooks/useClaim.ts +12 -4
- package/src/index.ts +2 -0
- package/src/types.ts +15 -0
- package/src/ui/game/ClaimPrizeSheet.tsx +3 -1
package/dist/index.mjs
CHANGED
|
@@ -305,6 +305,19 @@ var DubsClient = class {
|
|
|
305
305
|
message: res.message
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
|
+
async confirmClaim(gameId, params) {
|
|
309
|
+
const res = await this.request(
|
|
310
|
+
"POST",
|
|
311
|
+
`/games/${encodeURIComponent(gameId)}/claim/confirm`,
|
|
312
|
+
params
|
|
313
|
+
);
|
|
314
|
+
return {
|
|
315
|
+
gameId: res.gameId,
|
|
316
|
+
signature: res.signature,
|
|
317
|
+
explorerUrl: res.explorerUrl,
|
|
318
|
+
message: res.message
|
|
319
|
+
};
|
|
320
|
+
}
|
|
308
321
|
// ── Game Queries ──
|
|
309
322
|
async getGame(gameId) {
|
|
310
323
|
const res = await this.request(
|
|
@@ -1798,11 +1811,18 @@ function useClaim() {
|
|
|
1798
1811
|
connection
|
|
1799
1812
|
);
|
|
1800
1813
|
console.log("[useClaim] Step 2 done. Signature:", signature);
|
|
1801
|
-
|
|
1814
|
+
setStatus("confirming");
|
|
1815
|
+
console.log("[useClaim] Step 3: Confirming claim...");
|
|
1816
|
+
const confirmResult = await client.confirmClaim(params.gameId, {
|
|
1817
|
+
playerWallet: params.playerWallet,
|
|
1818
|
+
signature,
|
|
1819
|
+
amountClaimed: params.amountClaimed
|
|
1820
|
+
});
|
|
1821
|
+
console.log("[useClaim] Step 3 done.");
|
|
1802
1822
|
const result = {
|
|
1803
1823
|
gameId: params.gameId,
|
|
1804
1824
|
signature,
|
|
1805
|
-
explorerUrl
|
|
1825
|
+
explorerUrl: confirmResult.explorerUrl
|
|
1806
1826
|
};
|
|
1807
1827
|
setData(result);
|
|
1808
1828
|
setStatus("success");
|
|
@@ -4210,6 +4230,7 @@ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
|
4210
4230
|
var STATUS_LABELS4 = {
|
|
4211
4231
|
building: "Building transaction...",
|
|
4212
4232
|
signing: "Approve in wallet...",
|
|
4233
|
+
confirming: "Confirming...",
|
|
4213
4234
|
success: "Claimed!"
|
|
4214
4235
|
};
|
|
4215
4236
|
function ClaimPrizeSheet({
|
|
@@ -4277,11 +4298,12 @@ function ClaimPrizeSheet({
|
|
|
4277
4298
|
try {
|
|
4278
4299
|
await mutation.execute({
|
|
4279
4300
|
playerWallet: wallet.publicKey.toBase58(),
|
|
4280
|
-
gameId
|
|
4301
|
+
gameId,
|
|
4302
|
+
amountClaimed: prizeAmount
|
|
4281
4303
|
});
|
|
4282
4304
|
} catch {
|
|
4283
4305
|
}
|
|
4284
|
-
}, [wallet.publicKey, mutation.execute, gameId]);
|
|
4306
|
+
}, [wallet.publicKey, mutation.execute, gameId, prizeAmount]);
|
|
4285
4307
|
const statusLabel = STATUS_LABELS4[mutation.status] || "";
|
|
4286
4308
|
return /* @__PURE__ */ jsxs12(
|
|
4287
4309
|
Modal3,
|