@imtbl/sdk 0.0.1-alpha.2 → 0.0.1-alpha.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/starkex.js CHANGED
@@ -1,10 +1,58 @@
1
- import { ImmutableX } from '@imtbl/core-sdk';
1
+ import { ImmutableX, Config } from '@imtbl/core-sdk';
2
+
3
+ var Environment;
4
+ (function (Environment) {
5
+ Environment["PRODUCTION"] = "production";
6
+ Environment["SANDBOX"] = "sandbox";
7
+ })(Environment || (Environment = {}));
8
+
9
+ // Set `sdkVersion` on config
10
+ const PRODUCTION = () => {
11
+ return Config.createConfig({
12
+ basePath: 'https://api.x.immutable.com',
13
+ chainID: 1,
14
+ coreContractAddress: '0x5FDCCA53617f4d2b9134B29090C87D01058e27e9',
15
+ registrationContractAddress: '0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c',
16
+ sdkVersion: 'ts-immutable-sdk-0.0.1-alpha.3',
17
+ });
18
+ };
19
+ // Set `sdkVersion` on config
20
+ const SANDBOX = () => {
21
+ return Config.createConfig({
22
+ basePath: 'https://api.sandbox.x.immutable.com',
23
+ chainID: 5,
24
+ coreContractAddress: '0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623',
25
+ registrationContractAddress: '0x1C97Ada273C9A52253f463042f29117090Cd7D83',
26
+ sdkVersion: 'ts-immutable-sdk-0.0.1-alpha.3',
27
+ });
28
+ };
29
+ class StarkExConfiguration {
30
+ immutableXConfig;
31
+ baseConfig;
32
+ constructor({ baseConfig, overrides }) {
33
+ this.baseConfig = baseConfig;
34
+ if (overrides) {
35
+ this.immutableXConfig = overrides.immutableXConfig;
36
+ }
37
+ else {
38
+ switch (baseConfig.environment) {
39
+ case Environment.SANDBOX: {
40
+ this.immutableXConfig = SANDBOX();
41
+ break;
42
+ }
43
+ case Environment.PRODUCTION: {
44
+ this.immutableXConfig = PRODUCTION();
45
+ break;
46
+ }
47
+ }
48
+ }
49
+ }
50
+ }
2
51
 
3
- /* eslint-disable @typescript-eslint/no-unused-vars */
4
52
  const StarkExAPIFactory = (config) => {
5
- const imtblClient = new ImmutableX(config.getStarkExConfig());
53
+ const imtblClient = new ImmutableX(config.immutableXConfig);
6
54
  const { deposit, registerOffchain, isRegisteredOnchain, prepareWithdrawal, completeWithdrawal, createOrder, cancelOrder, createTrade, transfer, batchNftTransfer, ...StarkEx } = imtblClient;
7
55
  return { ...StarkEx };
8
56
  };
9
57
 
10
- export { StarkExAPIFactory };
58
+ export { StarkExAPIFactory, StarkExConfiguration };
package/package.json CHANGED
@@ -1,24 +1,42 @@
1
1
  {
2
2
  "name": "@imtbl/sdk",
3
3
  "description": "Immutable Unified SDK",
4
- "version": "0.0.1-alpha.2",
4
+ "version": "0.0.1-alpha.3",
5
5
  "author": "Immutable",
6
6
  "bugs": "https://github.com/immutable/ts-immutable-sdk/issues",
7
7
  "dependencies": {
8
8
  "@biom3/design-tokens": "0.1.4-beta",
9
- "@biom3/react": "^0.1.3-beta",
9
+ "@biom3/react": "^0.2.4-beta",
10
10
  "@ethersproject/providers": "^5.7.2",
11
- "@imtbl/core-sdk": "^1.0.2-alpha.5",
11
+ "@imtbl/core-sdk": "^1.1.1-alpha.1",
12
12
  "@magic-ext/oidc": "^1.0.1",
13
13
  "@metamask/detect-provider": "^2.0.0",
14
+ "@rollup/plugin-replace": "^5.0.2",
15
+ "@swc/helpers": "~0.5.0",
16
+ "@typescript-eslint/eslint-plugin": "^5.57.1",
17
+ "@typescript-eslint/parser": "^5.57.1",
18
+ "@uniswap/router-sdk": "^1.4.0",
19
+ "@uniswap/swap-router-contracts": "^1.3.0",
20
+ "@uniswap/v3-core": "^1.0.1",
21
+ "@uniswap/v3-periphery": "^1.4.3",
22
+ "@uniswap/v3-sdk": "^3.9.0",
14
23
  "axios": "^1.3.5",
24
+ "compression": "^1.7.4",
25
+ "dotenv": "^16.0.3",
15
26
  "eslint": "^8.37.0",
16
27
  "ethers": "^5.7.2",
28
+ "express": "^4.17.1",
29
+ "express-formidable": "^1.2.0",
30
+ "helmet": "^4.2.0",
17
31
  "magic-sdk": "^13.3.1",
18
32
  "oidc-client-ts": "^2.2.1",
33
+ "pino": "^8.11.0",
34
+ "pino-http": "^8.3.3",
19
35
  "react": "^18.2.0",
20
36
  "react-dom": "^18.2.0",
21
- "react-router-dom": "^6.10.0"
37
+ "react-router-dom": "^6.10.0",
38
+ "rxjs": "^7.8.0",
39
+ "tsc-watch": "^6.0.0"
22
40
  },
23
41
  "devDependencies": {
24
42
  "@imtbl/checkout-sdk-web": "0.0.0",