@phantom/react-native-sdk 1.0.0-beta.4 → 1.0.0-beta.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/README.md CHANGED
@@ -423,7 +423,7 @@ adb shell am start -W -a android.intent.action.VIEW -d "myapp://phantom-auth-cal
423
423
  - Check `app.json` (Expo) or platform-specific configuration
424
424
 
425
425
  2. **"Authentication failed"**
426
- - Verify your organization ID is correct
426
+ - Verify your app ID is correct
427
427
  - Check network connectivity
428
428
  - Ensure redirect URL matches your scheme
429
429
 
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { ReactNode } from 'react';
3
3
  import * as _phantom_embedded_provider_core from '@phantom/embedded-provider-core';
4
4
  import { EmbeddedProviderConfig, EmbeddedProvider, WalletAddress, ConnectResult } from '@phantom/embedded-provider-core';
5
5
  export { ConnectResult, SignAndSendTransactionParams, SignMessageParams, SignMessageResult, SignedTransaction, WalletAddress } from '@phantom/embedded-provider-core';
6
- import * as _phantom_chains from '@phantom/chains';
6
+ import * as _phantom_chain_interfaces from '@phantom/chain-interfaces';
7
7
  export { AddressType } from '@phantom/client';
8
8
  export { NetworkId } from '@phantom/constants';
9
9
 
@@ -11,7 +11,7 @@ interface PhantomDebugConfig {
11
11
  /** Enable debug logging */
12
12
  enabled?: boolean;
13
13
  }
14
- interface PhantomSDKConfig extends Omit<EmbeddedProviderConfig, "apiBaseUrl" | "embeddedWalletType"> {
14
+ interface PhantomSDKConfig extends Omit<EmbeddedProviderConfig, "apiBaseUrl" | "embeddedWalletType" | "authOptions"> {
15
15
  /** Custom URL scheme for your app (e.g., "myapp") */
16
16
  scheme: string;
17
17
  /** Enable auto-connect to existing sessions (default: true) */
@@ -20,6 +20,10 @@ interface PhantomSDKConfig extends Omit<EmbeddedProviderConfig, "apiBaseUrl" | "
20
20
  apiBaseUrl?: string;
21
21
  /** Authentication options */
22
22
  embeddedWalletType?: "app-wallet" | "user-wallet";
23
+ authOptions?: {
24
+ authUrl?: string;
25
+ redirectUrl?: string;
26
+ };
23
27
  }
24
28
  interface ConnectOptions {
25
29
  /** OAuth provider to use */
@@ -71,7 +75,7 @@ declare function useAccounts(): {
71
75
  * @returns Solana chain interface with connection enforcement
72
76
  */
73
77
  declare function useSolana(): {
74
- solana: _phantom_chains.ISolanaChain;
78
+ solana: _phantom_chain_interfaces.ISolanaChain;
75
79
  isAvailable: boolean;
76
80
  };
77
81
 
@@ -81,7 +85,7 @@ declare function useSolana(): {
81
85
  * @returns Ethereum chain interface with connection enforcement
82
86
  */
83
87
  declare function useEthereum(): {
84
- ethereum: _phantom_chains.IEthereumChain;
88
+ ethereum: _phantom_chain_interfaces.IEthereumChain;
85
89
  isAvailable: boolean;
86
90
  };
87
91
 
package/dist/index.js CHANGED
@@ -104,7 +104,7 @@ var ExpoAuthProvider = class {
104
104
  return;
105
105
  }
106
106
  const phantomOptions = options;
107
- const { authUrl, redirectUrl, organizationId, parentOrganizationId, sessionId, provider, customAuthData, appId } = phantomOptions;
107
+ const { authUrl, redirectUrl, organizationId, sessionId, provider, customAuthData, appId } = phantomOptions;
108
108
  if (!redirectUrl) {
109
109
  throw new Error("redirectUrl is required for web browser authentication");
110
110
  }
@@ -115,7 +115,6 @@ var ExpoAuthProvider = class {
115
115
  const baseUrl = authUrl || import_constants.DEFAULT_AUTH_URL;
116
116
  const params = new URLSearchParams({
117
117
  organization_id: organizationId,
118
- parent_organization_id: parentOrganizationId,
119
118
  app_id: appId,
120
119
  redirect_uri: redirectUrl,
121
120
  session_id: sessionId,
@@ -137,7 +136,6 @@ var ExpoAuthProvider = class {
137
136
  baseUrl,
138
137
  redirectUrl,
139
138
  organizationId,
140
- parentOrganizationId,
141
139
  sessionId,
142
140
  provider,
143
141
  hasCustomData: !!customAuthData
@@ -263,7 +261,7 @@ var ReactNativeStamper = class {
263
261
  this.algorithm = import_sdk_types.Algorithm.ed25519;
264
262
  this.type = "PKI";
265
263
  this.keyPrefix = config.keyPrefix || "phantom-rn-stamper";
266
- this.organizationId = config.organizationId || "default";
264
+ this.appId = config.appId || "default";
267
265
  }
268
266
  /**
269
267
  * Initialize the stamper and generate/load cryptographic keys
@@ -416,10 +414,10 @@ var ReactNativeStamper = class {
416
414
  return null;
417
415
  }
418
416
  getActiveKeyName() {
419
- return `${this.keyPrefix}-${this.organizationId}-active`;
417
+ return `${this.keyPrefix}-${this.appId}-active`;
420
418
  }
421
419
  getPendingKeyName() {
422
- return `${this.keyPrefix}-${this.organizationId}-pending`;
420
+ return `${this.keyPrefix}-${this.appId}-pending`;
423
421
  }
424
422
  };
425
423
 
@@ -479,8 +477,8 @@ function PhantomProvider({ children, config, debugConfig }) {
479
477
  const urlParamsAccessor = new ExpoURLParamsAccessor();
480
478
  const logger = new ExpoLogger(debugConfig?.enabled || false);
481
479
  const stamper = new ReactNativeStamper({
482
- keyPrefix: `phantom-rn-${memoizedConfig.organizationId}`,
483
- organizationId: memoizedConfig.organizationId
480
+ keyPrefix: `phantom-rn-${memoizedConfig.appId}`,
481
+ appId: memoizedConfig.appId
484
482
  });
485
483
  const platformName = `${import_react_native2.Platform.OS}-${import_react_native2.Platform.Version}`;
486
484
  const platform = {
@@ -495,7 +493,7 @@ function PhantomProvider({ children, config, debugConfig }) {
495
493
  [import_constants2.ANALYTICS_HEADERS.PLATFORM_VERSION]: `${import_react_native2.Platform.Version}`,
496
494
  [import_constants2.ANALYTICS_HEADERS.APP_ID]: config.appId,
497
495
  [import_constants2.ANALYTICS_HEADERS.WALLET_TYPE]: config.embeddedWalletType,
498
- [import_constants2.ANALYTICS_HEADERS.SDK_VERSION]: "1.0.0-beta.4"
496
+ [import_constants2.ANALYTICS_HEADERS.SDK_VERSION]: "1.0.0-beta.6"
499
497
  // Replaced at build time
500
498
  }
501
499
  };
package/dist/index.mjs CHANGED
@@ -60,7 +60,7 @@ var ExpoAuthProvider = class {
60
60
  return;
61
61
  }
62
62
  const phantomOptions = options;
63
- const { authUrl, redirectUrl, organizationId, parentOrganizationId, sessionId, provider, customAuthData, appId } = phantomOptions;
63
+ const { authUrl, redirectUrl, organizationId, sessionId, provider, customAuthData, appId } = phantomOptions;
64
64
  if (!redirectUrl) {
65
65
  throw new Error("redirectUrl is required for web browser authentication");
66
66
  }
@@ -71,7 +71,6 @@ var ExpoAuthProvider = class {
71
71
  const baseUrl = authUrl || DEFAULT_AUTH_URL;
72
72
  const params = new URLSearchParams({
73
73
  organization_id: organizationId,
74
- parent_organization_id: parentOrganizationId,
75
74
  app_id: appId,
76
75
  redirect_uri: redirectUrl,
77
76
  session_id: sessionId,
@@ -93,7 +92,6 @@ var ExpoAuthProvider = class {
93
92
  baseUrl,
94
93
  redirectUrl,
95
94
  organizationId,
96
- parentOrganizationId,
97
95
  sessionId,
98
96
  provider,
99
97
  hasCustomData: !!customAuthData
@@ -219,7 +217,7 @@ var ReactNativeStamper = class {
219
217
  this.algorithm = Algorithm.ed25519;
220
218
  this.type = "PKI";
221
219
  this.keyPrefix = config.keyPrefix || "phantom-rn-stamper";
222
- this.organizationId = config.organizationId || "default";
220
+ this.appId = config.appId || "default";
223
221
  }
224
222
  /**
225
223
  * Initialize the stamper and generate/load cryptographic keys
@@ -372,10 +370,10 @@ var ReactNativeStamper = class {
372
370
  return null;
373
371
  }
374
372
  getActiveKeyName() {
375
- return `${this.keyPrefix}-${this.organizationId}-active`;
373
+ return `${this.keyPrefix}-${this.appId}-active`;
376
374
  }
377
375
  getPendingKeyName() {
378
- return `${this.keyPrefix}-${this.organizationId}-pending`;
376
+ return `${this.keyPrefix}-${this.appId}-pending`;
379
377
  }
380
378
  };
381
379
 
@@ -435,8 +433,8 @@ function PhantomProvider({ children, config, debugConfig }) {
435
433
  const urlParamsAccessor = new ExpoURLParamsAccessor();
436
434
  const logger = new ExpoLogger(debugConfig?.enabled || false);
437
435
  const stamper = new ReactNativeStamper({
438
- keyPrefix: `phantom-rn-${memoizedConfig.organizationId}`,
439
- organizationId: memoizedConfig.organizationId
436
+ keyPrefix: `phantom-rn-${memoizedConfig.appId}`,
437
+ appId: memoizedConfig.appId
440
438
  });
441
439
  const platformName = `${Platform.OS}-${Platform.Version}`;
442
440
  const platform = {
@@ -451,7 +449,7 @@ function PhantomProvider({ children, config, debugConfig }) {
451
449
  [ANALYTICS_HEADERS.PLATFORM_VERSION]: `${Platform.Version}`,
452
450
  [ANALYTICS_HEADERS.APP_ID]: config.appId,
453
451
  [ANALYTICS_HEADERS.WALLET_TYPE]: config.embeddedWalletType,
454
- [ANALYTICS_HEADERS.SDK_VERSION]: "1.0.0-beta.4"
452
+ [ANALYTICS_HEADERS.SDK_VERSION]: "1.0.0-beta.6"
455
453
  // Replaced at build time
456
454
  }
457
455
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phantom/react-native-sdk",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.6",
4
4
  "description": "Phantom Wallet SDK for React Native and Expo applications",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -45,14 +45,14 @@
45
45
  "directory": "packages/react-native-sdk"
46
46
  },
47
47
  "dependencies": {
48
- "@phantom/api-key-stamper": "^1.0.0-beta.4",
49
- "@phantom/base64url": "^1.0.0-beta.4",
50
- "@phantom/chains": "^1.0.0-beta.4",
51
- "@phantom/client": "^1.0.0-beta.4",
52
- "@phantom/constants": "^1.0.0-beta.4",
53
- "@phantom/crypto": "^1.0.0-beta.4",
54
- "@phantom/embedded-provider-core": "^1.0.0-beta.4",
55
- "@phantom/sdk-types": "^1.0.0-beta.4",
48
+ "@phantom/api-key-stamper": "^1.0.0-beta.6",
49
+ "@phantom/base64url": "^1.0.0-beta.6",
50
+ "@phantom/chain-interfaces": "^1.0.0-beta.6",
51
+ "@phantom/client": "^1.0.0-beta.6",
52
+ "@phantom/constants": "^1.0.0-beta.6",
53
+ "@phantom/crypto": "^1.0.0-beta.6",
54
+ "@phantom/embedded-provider-core": "^1.0.0-beta.6",
55
+ "@phantom/sdk-types": "^1.0.0-beta.6",
56
56
  "@types/bs58": "^5.0.0",
57
57
  "bs58": "^6.0.0",
58
58
  "buffer": "^6.0.3"