@column-org/wallet-sdk 1.1.4 → 1.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@column-org/wallet-sdk",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "Column Wallet Mobile Deep-Link SDK for Movement/Aptos ecosystem",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -8,4 +8,5 @@ if (typeof global.Buffer === 'undefined') {
8
8
 
9
9
  export * from './ColumnWalletSDK';
10
10
  export * from './ColumnShared';
11
+ export { ColumnWalletNative } from './ui/native/ColumnWalletNative';
11
12
  export { ColumnWalletModal } from './ui/native/ColumnWalletModal';
@@ -13,6 +13,7 @@ export function ColumnWalletModal({ visible, onClose, onConnect, sdk }: Props) {
13
13
  const handleConnect = async () => {
14
14
  try {
15
15
  const url = sdk.connect();
16
+ console.log("🔗 Modal: Attempting to connect with URL:", url);
16
17
 
17
18
  // Attempt to open the deep link
18
19
  // Use relaxed check for Expo Go / Android 11+ visibility rules
@@ -0,0 +1,44 @@
1
+ import { ColumnWalletSDK } from '../../ColumnWalletSDK';
2
+ import { ColumnSDKConfig } from '../../ColumnShared';
3
+
4
+ /**
5
+ * Enhanced SDK Class specifically for React Native / Expo environments
6
+ */
7
+ export class ColumnWalletNative extends ColumnWalletSDK {
8
+ constructor(config: ColumnSDKConfig) {
9
+ const detectedConfig = ColumnWalletNative.autoDetectMetadata(config);
10
+ super(detectedConfig);
11
+ }
12
+
13
+ private static autoDetectMetadata(config: ColumnSDKConfig): ColumnSDKConfig {
14
+ const detectedConfig = { ...config };
15
+
16
+ // 1. Try to detect App Name and Description from Expo Constants
17
+ try {
18
+ // We use require to avoid hard dependency if not in Expo
19
+ const Constants = require('expo-constants').default;
20
+ const expoConfig = Constants.expoConfig || Constants.manifest;
21
+
22
+ if (!detectedConfig.appName && expoConfig?.name) {
23
+ detectedConfig.appName = expoConfig.name;
24
+ }
25
+ if (!detectedConfig.appDescription && expoConfig?.description) {
26
+ detectedConfig.appDescription = expoConfig.description;
27
+ }
28
+ } catch (e) {
29
+ // expo-constants not available or failed
30
+ }
31
+
32
+ // 2. Try to auto-detect the Redirect Link (Deep Link Scheme) using Expo Linking
33
+ try {
34
+ if (!detectedConfig.redirectLink) {
35
+ const Linking = require('expo-linking');
36
+ detectedConfig.redirectLink = Linking.createURL('');
37
+ }
38
+ } catch (e) {
39
+ // expo-linking not available or failed
40
+ }
41
+
42
+ return detectedConfig;
43
+ }
44
+ }