@one_deploy/sdk 1.0.1 → 1.0.3
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/dist/config/index.d.mts +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +10 -8
- package/dist/config/index.js.map +1 -1
- package/dist/config/index.mjs +10 -8
- package/dist/config/index.mjs.map +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -10
- package/dist/index.mjs.map +1 -1
- package/dist/providers/index.js +11 -9
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/index.mjs +11 -9
- package/dist/providers/index.mjs.map +1 -1
- package/dist/react-native.js +9 -7
- package/dist/react-native.js.map +1 -1
- package/dist/react-native.mjs +9 -7
- package/dist/react-native.mjs.map +1 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/config/index.ts +15 -9
package/src/config/index.ts
CHANGED
|
@@ -22,16 +22,22 @@ export interface OneConfig {
|
|
|
22
22
|
thirdwebClientId?: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
// Default configuration values
|
|
26
|
+
const DEFAULT_ENGINE_URL = 'https://api.one23.io';
|
|
27
|
+
const DEFAULT_CLIENT_ID = 'one_pk_e8f647bfa643fdcfaa3a23f760488e49be09f929296eed4a6c399d437d907f60';
|
|
28
|
+
|
|
25
29
|
let config: OneConfig | null = null;
|
|
26
30
|
|
|
27
|
-
export function initOneSDK(options: OneConfig): void {
|
|
28
|
-
if
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
export function initOneSDK(options: Partial<OneConfig>): void {
|
|
32
|
+
// Use defaults if not provided
|
|
33
|
+
const engineUrl = options.oneEngineUrl || DEFAULT_ENGINE_URL;
|
|
34
|
+
const clientId = options.oneClientId || DEFAULT_CLIENT_ID;
|
|
35
|
+
|
|
36
|
+
config = {
|
|
37
|
+
...options,
|
|
38
|
+
oneEngineUrl: engineUrl,
|
|
39
|
+
oneClientId: clientId,
|
|
40
|
+
} as OneConfig;
|
|
35
41
|
}
|
|
36
42
|
|
|
37
43
|
export function getConfig(): OneConfig {
|
|
@@ -46,7 +52,7 @@ export function isInitialized(): boolean {
|
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
export function getEngineUrl(): string {
|
|
49
|
-
return config?.oneEngineUrl || process.env.NEXT_PUBLIC_ONE_ENGINE_URL ||
|
|
55
|
+
return config?.oneEngineUrl || process.env.NEXT_PUBLIC_ONE_ENGINE_URL || DEFAULT_ENGINE_URL;
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
// ===== Chain Data (Fetched from Engine) =====
|