@optimex-xyz/market-maker-sdk 0.4.0 → 0.5.0-dev-81225fa

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
@@ -12,6 +12,7 @@ A comprehensive toolkit for implementing Private Market Makers (PMMs) in the cro
12
12
  - [2. Quick Start](#2-quick-start)
13
13
  - [2.1. Installation](#21-installation)
14
14
  - [2.2. Environment Setup](#22-environment-setup)
15
+ - [2.3. Available Environments](#23-available-environments)
15
16
  - [3. PMM Backend APIs](#3-pmm-backend-apis)
16
17
  - [3.1. Endpoint: `/indicative-quote`](#31-endpoint-indicative-quote)
17
18
  - [Description](#description)
@@ -110,9 +111,26 @@ yarn add @optimex-xyz/market-maker-sdk
110
111
 
111
112
  ### 2.2. Environment Setup
112
113
 
113
- | Variable | Development | Production |
114
- | -------- | ----------- | ---------- |
115
- | SDK_ENV | dev | production |
114
+ you can directly specify the environment
115
+
116
+ ```typescript
117
+ import { sdk, Environment } from '@optimex-xyz/market-maker-sdk'
118
+
119
+ // Change to development environment
120
+ sdk.setEnvironment('dev' as Environment)
121
+
122
+ // Change to production environment
123
+ sdk.setEnvironment('production' as Environment)
124
+ ```
125
+
126
+ ### 2.3. Available Environments
127
+
128
+ | Environment | Description |
129
+ | ------------ | -------------------------------------------------------------------- |
130
+ | `dev` | Development environment with test networks and staging services |
131
+ | `production` | Production environment with mainnet networks and production services |
132
+
133
+ Each environment includes specific configuration for backend URLs, RPC endpoints, router addresses, and payment addresses.
116
134
 
117
135
  ## 3. PMM Backend APIs
118
136
 
package/dist/index.d.mts CHANGED
@@ -14,7 +14,7 @@ interface AppConfig extends EnvironmentConfig {
14
14
  declare class Config {
15
15
  private env;
16
16
  private config;
17
- constructor();
17
+ constructor(env?: Environment);
18
18
  /**
19
19
  * Set the environment for the SDK
20
20
  * @param env The environment to use ('dev' or 'production')
@@ -31,10 +31,15 @@ declare const config: Config;
31
31
 
32
32
  declare class SDK {
33
33
  /**
34
- * Initialize the SDK with a specific environment
34
+ * Change the environment after initialization
35
35
  * @param env The environment to use ('dev' or 'production')
36
36
  */
37
37
  setEnvironment(env: Environment): void;
38
+ /**
39
+ * Get the current environment configuration
40
+ * @returns The current environment configuration
41
+ */
42
+ getConfig(): AppConfig;
38
43
  }
39
44
  declare const sdk: SDK;
40
45
 
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ interface AppConfig extends EnvironmentConfig {
14
14
  declare class Config {
15
15
  private env;
16
16
  private config;
17
- constructor();
17
+ constructor(env?: Environment);
18
18
  /**
19
19
  * Set the environment for the SDK
20
20
  * @param env The environment to use ('dev' or 'production')
@@ -31,10 +31,15 @@ declare const config: Config;
31
31
 
32
32
  declare class SDK {
33
33
  /**
34
- * Initialize the SDK with a specific environment
34
+ * Change the environment after initialization
35
35
  * @param env The environment to use ('dev' or 'production')
36
36
  */
37
37
  setEnvironment(env: Environment): void;
38
+ /**
39
+ * Get the current environment configuration
40
+ * @returns The current environment configuration
41
+ */
42
+ getConfig(): AppConfig;
38
43
  }
39
44
  declare const sdk: SDK;
40
45
 
package/dist/index.js CHANGED
@@ -89,8 +89,8 @@ var environments = {
89
89
  }
90
90
  };
91
91
  var Config = class {
92
- constructor() {
93
- this.env = process.env.SDK_ENV || "production";
92
+ constructor(env = "production") {
93
+ this.env = env;
94
94
  this.config = this.validateAndGetConfig(this.env);
95
95
  }
96
96
  /**
@@ -134,12 +134,19 @@ var config = new Config();
134
134
  // src/config/sdk.ts
135
135
  var SDK = class {
136
136
  /**
137
- * Initialize the SDK with a specific environment
137
+ * Change the environment after initialization
138
138
  * @param env The environment to use ('dev' or 'production')
139
139
  */
140
140
  setEnvironment(env) {
141
141
  config.setEnvironment(env);
142
142
  }
143
+ /**
144
+ * Get the current environment configuration
145
+ * @returns The current environment configuration
146
+ */
147
+ getConfig() {
148
+ return config.get();
149
+ }
143
150
  };
144
151
  var sdk = new SDK();
145
152
 
package/dist/index.mjs CHANGED
@@ -24,8 +24,8 @@ var environments = {
24
24
  }
25
25
  };
26
26
  var Config = class {
27
- constructor() {
28
- this.env = process.env.SDK_ENV || "production";
27
+ constructor(env = "production") {
28
+ this.env = env;
29
29
  this.config = this.validateAndGetConfig(this.env);
30
30
  }
31
31
  /**
@@ -69,12 +69,19 @@ var config = new Config();
69
69
  // src/config/sdk.ts
70
70
  var SDK = class {
71
71
  /**
72
- * Initialize the SDK with a specific environment
72
+ * Change the environment after initialization
73
73
  * @param env The environment to use ('dev' or 'production')
74
74
  */
75
75
  setEnvironment(env) {
76
76
  config.setEnvironment(env);
77
77
  }
78
+ /**
79
+ * Get the current environment configuration
80
+ * @returns The current environment configuration
81
+ */
82
+ getConfig() {
83
+ return config.get();
84
+ }
78
85
  };
79
86
  var sdk = new SDK();
80
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimex-xyz/market-maker-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.5.0-dev-81225fa",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"