@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/base.d.ts CHANGED
@@ -1,123 +1,18 @@
1
- /**
2
- * Immutable X API
3
- * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
- *
5
- * The version of the OpenAPI document: 3.0
6
- * Contact: support@immutable.com
7
- *
8
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
- * https://openapi-generator.tech
10
- * Do not edit the class manually.
11
- */
12
- interface ConfigurationParameters {
13
- apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
14
- username?: string;
15
- password?: string;
16
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
17
- basePath?: string;
18
- baseOptions?: any;
19
- formDataCtor?: new () => any;
20
- }
21
- declare class Configuration$1 {
22
- /**
23
- * parameter for apiKey security
24
- * @param name security name
25
- * @memberof Configuration
26
- */
27
- apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
28
- /**
29
- * parameter for basic security
30
- *
31
- * @type {string}
32
- * @memberof Configuration
33
- */
34
- username?: string;
35
- /**
36
- * parameter for basic security
37
- *
38
- * @type {string}
39
- * @memberof Configuration
40
- */
41
- password?: string;
42
- /**
43
- * parameter for oauth2 security
44
- * @param name security name
45
- * @param scopes oauth2 scope
46
- * @memberof Configuration
47
- */
48
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
49
- /**
50
- * override base path
51
- *
52
- * @type {string}
53
- * @memberof Configuration
54
- */
55
- basePath?: string;
56
- /**
57
- * base options for axios calls
58
- *
59
- * @type {any}
60
- * @memberof Configuration
61
- */
62
- baseOptions?: any;
63
- /**
64
- * The FormData constructor that will be used to create multipart form data
65
- * requests. You can inject this here so that execution environments that
66
- * do not support the FormData class can still run the generated client.
67
- *
68
- * @type {new () => FormData}
69
- */
70
- formDataCtor?: new () => any;
71
- constructor(param?: ConfigurationParameters);
72
- /**
73
- * Check if the given MIME is a JSON MIME.
74
- * JSON MIME examples:
75
- * application/json
76
- * application/json; charset=UTF8
77
- * APPLICATION/JSON
78
- * application/vnd.company+json
79
- * @param mime - MIME (Multipurpose Internet Mail Extensions)
80
- * @return True if the given MIME is JSON, false otherwise.
81
- */
82
- isJsonMime(mime: string): boolean;
83
- }
84
-
85
- /**
86
- * The configuration for the Ethereum network
87
- */
88
- interface EthConfiguration {
89
- coreContractAddress: string;
90
- registrationContractAddress: string;
91
- chainID: number;
92
- }
93
- /**
94
- * The configuration for the ImmutableX client
95
- */
96
- interface ImmutableXConfiguration {
97
- /**
98
- * The configuration for the API client
99
- */
100
- apiConfiguration: Configuration$1;
101
- /**
102
- * The configuration for the Ethereum network
103
- */
104
- ethConfiguration: EthConfiguration;
105
- }
106
-
107
1
  declare enum Environment {
108
- DEVELOPMENT = "development",
109
- SANDBOX = "sandbox",
110
- PRODUCTION = "production"
2
+ PRODUCTION = "production",
3
+ SANDBOX = "sandbox"
4
+ }
5
+ declare class ImmutableConfiguration {
6
+ readonly environment: Environment;
7
+ readonly apiKey?: string;
8
+ constructor(options: {
9
+ environment: Environment;
10
+ apiKey?: string;
11
+ });
111
12
  }
112
- type StarkExConfig = ImmutableXConfiguration & {
113
- env: Environment;
114
- };
115
- declare class Configuration {
116
- private readonly starkExConfig;
117
- constructor(config: StarkExConfig);
118
- getStarkExConfig(): StarkExConfig;
13
+ interface ModuleConfiguration<T> {
14
+ baseConfig: ImmutableConfiguration;
15
+ overrides?: T;
119
16
  }
120
- declare const PRODUCTION: StarkExConfig;
121
- declare const SANDBOX: StarkExConfig;
122
17
 
123
- export { Configuration, Environment, PRODUCTION, SANDBOX };
18
+ export { Environment, ImmutableConfiguration, ModuleConfiguration };
package/dist/base.js CHANGED
@@ -1,27 +1,15 @@
1
- import { Config } from '@imtbl/core-sdk';
2
-
3
1
  var Environment;
4
2
  (function (Environment) {
5
- Environment["DEVELOPMENT"] = "development";
6
- Environment["SANDBOX"] = "sandbox";
7
3
  Environment["PRODUCTION"] = "production";
4
+ Environment["SANDBOX"] = "sandbox";
8
5
  })(Environment || (Environment = {}));
9
- class Configuration {
10
- starkExConfig;
11
- constructor(config) {
12
- this.starkExConfig = config;
13
- }
14
- getStarkExConfig() {
15
- return this.starkExConfig;
6
+ class ImmutableConfiguration {
7
+ environment;
8
+ apiKey;
9
+ constructor(options) {
10
+ this.environment = options.environment;
11
+ this.apiKey = options.apiKey;
16
12
  }
17
13
  }
18
- const PRODUCTION = {
19
- ...Config.PRODUCTION,
20
- env: Environment.PRODUCTION,
21
- };
22
- const SANDBOX = {
23
- ...Config.SANDBOX,
24
- env: Environment.SANDBOX,
25
- };
26
14
 
27
- export { Configuration, Environment, PRODUCTION, SANDBOX };
15
+ export { Environment, ImmutableConfiguration };