Skip to content

Commit c07dd6c

Browse files
committed
open claim in metamask with pre-filled paramters
1 parent 4f4c307 commit c07dd6c

File tree

4 files changed

+25
-7
lines changed

4 files changed

+25
-7
lines changed

apps/box/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ android {
8282
applicationId "land.fx.blox"
8383
minSdkVersion rootProject.ext.minSdkVersion
8484
targetSdkVersion rootProject.ext.targetSdkVersion
85-
versionCode 247
86-
versionName "2.2.2"
85+
versionCode 248
86+
versionName "2.2.3"
8787
// buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
8888

8989
testBuildType System.getProperty('testBuildType', 'debug')

apps/box/ios/Box.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@
665665
"$(inherited)",
666666
"@executable_path/Frameworks",
667667
);
668-
MARKETING_VERSION = 2.2.2;
668+
MARKETING_VERSION = 2.2.3;
669669
OTHER_LDFLAGS = (
670670
"$(inherited)",
671671
"-ObjC",
@@ -702,7 +702,7 @@
702702
"$(inherited)",
703703
"@executable_path/Frameworks",
704704
);
705-
MARKETING_VERSION = 2.2.2;
705+
MARKETING_VERSION = 2.2.3;
706706
OTHER_LDFLAGS = (
707707
"$(inherited)",
708708
"-ObjC",

apps/box/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "box",
3-
"version": "2.2.2",
3+
"version": "2.2.3",
44
"private": true,
55
"dependencies": {
66
"@functionland/fula-sec": "*",

apps/box/src/components/Cards/EarningCard.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import { useTranslation } from 'react-i18next';
1414
import { useFulaBalance, useFormattedFulaBalance } from '../../hooks/useFulaBalance';
1515
import { useClaimableTokens } from '../../hooks/useClaimableTokens';
1616
import { useUserProfileStore } from '../../stores/useUserProfileStore';
17+
import { useSettingsStore } from '../../stores/useSettingsStore';
18+
import { useBloxsStore } from '../../stores/useBloxsStore';
1719

1820
type EarningCardProps = React.ComponentProps<typeof FxBox> & {
1921
data: { totalFula: string };
@@ -50,6 +52,10 @@ export const EarningCard = ({
5052
(state) => state.manualSignatureWalletAddress
5153
);
5254

55+
// Get selected chain and current Blox peerId for claim portal
56+
const selectedChain = useSettingsStore((state) => state.selectedChain);
57+
const currentBloxPeerId = useBloxsStore((state) => state.currentBloxPeerId);
58+
5359
// Use claimable rewards hook
5460
const {
5561
totalUnclaimed,
@@ -93,10 +99,22 @@ export const EarningCard = ({
9399
onRefreshPress?.();
94100
};
95101

96-
// Handler for opening claim web portal
102+
// Handler for opening claim web portal in MetaMask browser
97103
const handleOpenClaimPortal = async () => {
98104
try {
99-
await Linking.openURL('https://claim-web.fula.network');
105+
// Build the claim URL with network and peerId parameters
106+
const claimBaseUrl = 'https://claim-web.fula.network';
107+
const params = new URLSearchParams();
108+
params.append('network', selectedChain);
109+
if (currentBloxPeerId) {
110+
params.append('peerId', currentBloxPeerId);
111+
}
112+
const claimUrl = `${claimBaseUrl}?${params.toString()}`;
113+
114+
// Wrap in MetaMask deep link to open in MetaMask browser
115+
const metamaskDeepLink = `https://metamask.app.link/dapp/${encodeURIComponent(claimUrl)}`;
116+
117+
await Linking.openURL(metamaskDeepLink);
100118
} catch (error: any) {
101119
queueToast({
102120
type: 'error',

0 commit comments

Comments
 (0)