@dynamic-labs-wallet/core 0.0.5 → 0.0.7
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/index.esm.js +11 -9
- package/package.json +1 -1
- package/src/api/client.d.ts +2 -1
- package/src/api/client.d.ts.map +1 -1
- package/src/constants.d.ts +6 -3
- package/src/constants.d.ts.map +1 -1
package/index.esm.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
3
|
+
const DYNAMIC_AUTH_PROD_BASE_API_URL = 'https://app.dynamicauth.com';
|
|
4
|
+
const DYNAMIC_AUTH_PREPROD_BASE_API_URL = 'https://app.dynamic-preprod.xyz';
|
|
5
|
+
const DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL = 'https://app-dynamicauth-com-app-6e12fc400995.relay.evervault.app';
|
|
6
|
+
const DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL = 'https://app-dynamic-preprod-xyz-app-32d15525a875.relay.evervault.app';
|
|
7
|
+
const MPC_RELAY_PROD_API_URL = 'mpc-relay.dynamic-prod.xyz';
|
|
8
|
+
const MPC_RELAY_PREPROD_API_URL = 'relay.dynamic-preprod.xyz';
|
|
8
9
|
|
|
9
10
|
var SigningAlgorithm = /*#__PURE__*/ function(SigningAlgorithm) {
|
|
10
11
|
SigningAlgorithm["ECDSA"] = "ECDSA";
|
|
@@ -136,16 +137,17 @@ const getDynamicServerThreshold = (thresholdSignatureScheme)=>{
|
|
|
136
137
|
};
|
|
137
138
|
|
|
138
139
|
class BaseClient {
|
|
139
|
-
constructor({ environmentId, baseApiUrl, authToken }){
|
|
140
|
+
constructor({ environmentId, baseApiUrl, authToken, baseClientRelayApiUrl }){
|
|
140
141
|
const headers = {};
|
|
141
142
|
headers['Authorization'] = authToken ? `Bearer ${authToken}` : undefined;
|
|
142
143
|
this.environmentId = environmentId;
|
|
143
|
-
|
|
144
|
+
const isProd = typeof baseApiUrl === 'undefined' || DYNAMIC_AUTH_PROD_BASE_API_URL === baseApiUrl;
|
|
145
|
+
this.baseApiUrl = isProd ? DYNAMIC_AUTH_PROD_BASE_API_URL : baseApiUrl || DYNAMIC_AUTH_PREPROD_BASE_API_URL;
|
|
144
146
|
this.apiClient = axios.create({
|
|
145
147
|
baseURL: this.baseApiUrl,
|
|
146
148
|
headers
|
|
147
149
|
});
|
|
148
|
-
this.clientRelayBaseApiUrl =
|
|
150
|
+
this.clientRelayBaseApiUrl = isProd ? DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL : baseClientRelayApiUrl || DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL;
|
|
149
151
|
this.clientRelayApiClient = axios.create({
|
|
150
152
|
baseURL: this.clientRelayBaseApiUrl,
|
|
151
153
|
headers
|
|
@@ -230,4 +232,4 @@ class DynamicApiClient extends BaseClient {
|
|
|
230
232
|
}
|
|
231
233
|
}
|
|
232
234
|
|
|
233
|
-
export { BITCOIN_DERIVATION_PATHS,
|
|
235
|
+
export { BITCOIN_DERIVATION_PATHS, DYNAMIC_AUTH_PREPROD_BASE_API_URL, DYNAMIC_AUTH_PROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL, DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL, DynamicApiClient, MPC_CHAIN_CONFIG, MPC_CONFIG, MPC_RELAY_PREPROD_API_URL, MPC_RELAY_PROD_API_URL, SigningAlgorithm, ThresholdSignatureScheme, getClientThreshold, getDynamicServerThreshold, getMPCChainConfig, getTSSConfig };
|
package/package.json
CHANGED
package/src/api/client.d.ts
CHANGED
|
@@ -5,10 +5,11 @@ export declare class BaseClient {
|
|
|
5
5
|
environmentId: string;
|
|
6
6
|
clientRelayBaseApiUrl: string;
|
|
7
7
|
clientRelayApiClient: AxiosInstance;
|
|
8
|
-
constructor({ environmentId, baseApiUrl, authToken, }: {
|
|
8
|
+
constructor({ environmentId, baseApiUrl, authToken, baseClientRelayApiUrl, }: {
|
|
9
9
|
environmentId: string;
|
|
10
10
|
baseApiUrl?: string;
|
|
11
11
|
authToken?: string;
|
|
12
|
+
baseClientRelayApiUrl?: string;
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
15
|
//# sourceMappingURL=client.d.ts.map
|
package/src/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAQlD,qBAAa,UAAU;IACd,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,aAAa,CAAC;gBAC/B,EACV,aAAa,EACb,UAAU,EACV,SAAS,EACT,qBAAqB,GACtB,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,qBAAqB,CAAC,EAAE,MAAM,CAAC;KAChC;CAyBF"}
|
package/src/constants.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
1
|
+
export declare const DYNAMIC_AUTH_PROD_BASE_API_URL = "https://app.dynamicauth.com";
|
|
2
|
+
export declare const DYNAMIC_AUTH_PREPROD_BASE_API_URL = "https://app.dynamic-preprod.xyz";
|
|
3
|
+
export declare const DYNAMIC_CLIENT_RELAY_PROD_BASE_API_URL = "https://app-dynamicauth-com-app-6e12fc400995.relay.evervault.app";
|
|
4
|
+
export declare const DYNAMIC_CLIENT_RELAY_PREPROD_BASE_API_URL = "https://app-dynamic-preprod-xyz-app-32d15525a875.relay.evervault.app";
|
|
5
|
+
export declare const MPC_RELAY_PROD_API_URL = "mpc-relay.dynamic-prod.xyz";
|
|
6
|
+
export declare const MPC_RELAY_PREPROD_API_URL = "relay.dynamic-preprod.xyz";
|
|
4
7
|
//# sourceMappingURL=constants.d.ts.map
|
package/src/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../packages/src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../packages/src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,gCAAgC,CAAC;AAC5E,eAAO,MAAM,iCAAiC,oCACX,CAAC;AAEpC,eAAO,MAAM,sCAAsC,qEACiB,CAAC;AACrE,eAAO,MAAM,yCAAyC,yEACkB,CAAC;AAEzE,eAAO,MAAM,sBAAsB,+BAA+B,CAAC;AACnE,eAAO,MAAM,yBAAyB,8BAA8B,CAAC"}
|