Skip to content

Commit feaade7

Browse files
committed
updated metamask
1 parent 52c1e73 commit feaade7

File tree

4 files changed

+46
-8
lines changed

4 files changed

+46
-8
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 242
86-
versionName "2.1.4"
85+
versionCode 243
86+
versionName "2.1.5"
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.1.4;
668+
MARKETING_VERSION = 2.1.5;
669669
OTHER_LDFLAGS = (
670670
"$(inherited)",
671671
"-ObjC",
@@ -702,7 +702,7 @@
702702
"$(inherited)",
703703
"@executable_path/Frameworks",
704704
);
705-
MARKETING_VERSION = 2.1.4;
705+
MARKETING_VERSION = 2.1.5;
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.1.4",
3+
"version": "2.1.5",
44
"private": true,
55
"dependencies": {
66
"@functionland/fula-sec": "*",

apps/box/src/screens/InitialSetup/LinkPassword.screen.tsx

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,52 @@ export const LinkPasswordScreen = () => {
118118
},
119119
});
120120

121-
// Get provider and remove any existing listeners
121+
// Get provider
122122
const provider = await sdk?.getProvider();
123-
provider?.removeAllListeners();
123+
if (!provider) {
124+
throw new Error('Provider not available');
125+
}
126+
127+
console.log('Current connection status:', { connected, account });
128+
129+
// Connect to wallet first - this will open MetaMask
130+
console.log('Attempting to connect to wallet...');
131+
const accounts = await sdk?.connect();
132+
console.log('Connect response:', accounts);
133+
134+
// Wait a moment for state to update
135+
await new Promise(resolve => setTimeout(resolve, 500));
136+
137+
// Get the current account from the provider
138+
const currentAccounts = await provider.request?.({
139+
method: 'eth_accounts',
140+
}) as string[];
141+
142+
console.log('Current accounts from provider:', currentAccounts);
143+
144+
if (!currentAccounts || currentAccounts.length === 0) {
145+
throw new Error('No account connected after wallet connection');
146+
}
147+
148+
const connectedAccount = currentAccounts[0];
149+
console.log('Using account for signing:', connectedAccount);
150+
console.log('Message to sign:', msg);
151+
152+
// Convert message to hex for compatibility
153+
const msgHex = '0x' + Buffer.from(msg).toString('hex');
154+
155+
// Use provider.request directly for personal_sign
156+
console.log('Sending personal_sign request...');
157+
signature = (await provider.request?.({
158+
method: 'personal_sign',
159+
params: [msgHex, connectedAccount],
160+
})) as string;
124161

125-
signature = (await sdk?.connectAndSign({ msg })) as string;
162+
console.log('Signature received:', signature);
126163
resolveSigned();
127164
return signature;
128165
} catch (error) {
166+
console.error('personalSign error:', error);
129167
throw error;
130168
} finally {
131169
notifee.stopForegroundService();

0 commit comments

Comments
 (0)