@one_deploy/sdk 1.0.0 → 1.0.1

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": "@one_deploy/sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "ONE Ecosystem SDK - Shared services, types, utilities, and React providers",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -106,19 +106,19 @@ export function OneProvider({
106
106
  config,
107
107
  autoFetchBalance = true,
108
108
  }: OneProviderProps) {
109
- // Initialize SDK and Engine Client
110
- const [isInitialized, setIsInitialized] = useState(false);
109
+ // Initialize SDK synchronously before creating engine client
110
+ // This must happen before useMemo so getConfig() works in the constructor
111
+ useMemo(() => {
112
+ initOneSDK(config);
113
+ }, [config]);
114
+
115
+ const [isInitialized, setIsInitialized] = useState(true);
111
116
  const engine = useMemo(() => createOneEngineClient({
112
117
  baseUrl: config.oneEngineUrl,
113
118
  clientId: config.oneClientId,
114
119
  secretKey: config.oneSecretKey,
115
120
  }), [config]);
116
121
 
117
- useEffect(() => {
118
- initOneSDK(config);
119
- setIsInitialized(true);
120
- }, [config]);
121
-
122
122
  // ===== Auth State =====
123
123
  const [user, setUser] = useState<User | null>(null);
124
124
  const [accessToken, setAccessToken] = useState<string | null>(null);