Skip to content

Commit aa5f00e

Browse files
Merge branch 'main' into beta
2 parents 9582311 + aa593bb commit aa5f00e

File tree

3 files changed

+40
-23
lines changed

3 files changed

+40
-23
lines changed

src/UI/Option/TabLinks/MainWalletLinks/Ton.svelte

+23-16
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,31 @@
4141
4242
const handleGetNonce = async (id: string) => {
4343
try {
44-
const msg = `I am signing my one-time nonce: ${Math.floor(Math.random() * 10000)}`;
45-
46-
$tonConnector.setConnectRequestParameters({
47-
state: "ready",
48-
value: { tonProof: msg },
44+
const res: any = await nimbus.post("/users/nonce?verified=true", {
45+
publicAddress: id,
46+
referrer: undefined,
4947
});
5048
51-
$tonConnector.openModal();
52-
53-
$tonConnector.onStatusChange((wallet) => {
54-
if (
55-
wallet &&
56-
wallet.connectItems?.tonProof &&
57-
"proof" in wallet.connectItems.tonProof
58-
) {
59-
handleUpdatePublicAddress(wallet);
60-
}
61-
});
49+
if (res && res.data) {
50+
const msg = `I am signing my one-time nonce: ${res.data.nonce}`;
51+
52+
$tonConnector.setConnectRequestParameters({
53+
state: "ready",
54+
value: { tonProof: msg },
55+
});
56+
57+
$tonConnector.openModal();
58+
59+
$tonConnector.onStatusChange((wallet) => {
60+
if (
61+
wallet &&
62+
wallet.connectItems?.tonProof &&
63+
"proof" in wallet.connectItems.tonProof
64+
) {
65+
handleUpdatePublicAddress(wallet);
66+
}
67+
});
68+
}
6269
} catch (e) {
6370
console.error("error: ", e);
6471
if ($tonConnector.connected) {

src/entries/newTab/App.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
109109
const tonInstance = new TonConnectUI({
110110
manifestUrl:
111-
"https://gist.githubusercontent.com/toannhu96/0f9cdecbfa668157a901c76f41ced0f0/raw/0b8e76d86ca3ce0a14db9315c4e03ba3b9caaa60/tonconnect-manifest.json",
111+
"https://gist.githubusercontent.com/toannhu96/0f9cdecbfa668157a901c76f41ced0f0/raw/78bdaee6e4f101032bb97cfece71b79b7f28fbd5/tonconnect-manifest.json",
112112
});
113113
tonConnector.update((n) => (n = tonInstance));
114114
});

src/layouts/DailyCheckin.svelte

+16-6
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
2323
import goldImg from "~/assets/Gold4.svg";
2424
import wheelIcon from "~/assets/wheel-icon.svg";
25+
import { getUserInfo } from "~/lib/queryAPI";
2526
2627
export let currentRoute;
2728
@@ -36,11 +37,11 @@
3637
value: "checkin",
3738
type: "Daily Checkin",
3839
},
39-
{
40-
label: i18n("checkinPage.tab-leaderboard", "Flip GM Points"),
41-
value: "flip",
42-
type: "Flip GM Points",
43-
},
40+
// {
41+
// label: i18n("checkinPage.tab-leaderboard", "Flip GM Points"),
42+
// value: "flip",
43+
// type: "Flip GM Points",
44+
// },
4445
// {
4546
// label: i18n("checkinPage.tab-leaderboard", "Leaderboard"),
4647
// value: "leaderboard",
@@ -143,6 +144,15 @@
143144
return response;
144145
};
145146
147+
$: queryUserInfo = createQuery({
148+
queryKey: ["users-me"],
149+
queryFn: () => getUserInfo(),
150+
staleTime: Infinity,
151+
retry: false,
152+
});
153+
154+
$: allowSuiCamp = $queryUserInfo.data?.suiCampAllowed || false;
155+
146156
$: queryLinkSocial = createQuery({
147157
queryKey: ["link-socials"],
148158
queryFn: () => getLinkData(),
@@ -199,7 +209,7 @@
199209
<ErrorBoundary>
200210
<div class="relative z-9">
201211
{#if socialData && socialData.find((item) => item.type === "twitter")}
202-
{#if isSkipToMainPage}
212+
{#if isSkipToMainPage || allowSuiCamp}
203213
<div
204214
class="max-w-[2000px] m-auto xl:w-[90%] w-[90%] py-8 grid xl:grid-cols-6 grid-cols-1 gap-6 relative z-2"
205215
>

0 commit comments

Comments
 (0)