@imtbl/sdk 0.45.5 → 1.0.0-alpha.1
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/blockchain_data.js +24 -2
- package/dist/browser/checkout/sdk.js +6 -6
- package/dist/browser/checkout/widgets.js +61 -61
- package/dist/checkout.js +38 -9
- package/dist/config.js +9 -2
- package/dist/index.browser.js +12 -12
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +74 -12
- package/dist/index.js +74 -12
- package/dist/orderbook.js +23 -1
- package/dist/passport.js +59 -4
- package/dist/x.js +24 -2
- package/package.json +1 -1
package/dist/blockchain_data.js
CHANGED
|
@@ -4232,6 +4232,10 @@ const getDetail = (key) => {
|
|
|
4232
4232
|
const getAllDetails = () => RUNTIME_DETAILS;
|
|
4233
4233
|
// Events
|
|
4234
4234
|
const getEvents = () => EVENT_STORE;
|
|
4235
|
+
const addEvent = (event) => {
|
|
4236
|
+
EVENT_STORE.push(event);
|
|
4237
|
+
setItem(Store.EVENTS, EVENT_STORE);
|
|
4238
|
+
};
|
|
4235
4239
|
const removeSentEvents = (numberOfEvents) => {
|
|
4236
4240
|
EVENT_STORE = EVENT_STORE.slice(numberOfEvents);
|
|
4237
4241
|
setItem(Store.EVENTS, EVENT_STORE);
|
|
@@ -4239,7 +4243,10 @@ const removeSentEvents = (numberOfEvents) => {
|
|
|
4239
4243
|
const flattenProperties = (properties) => {
|
|
4240
4244
|
const propertyMap = [];
|
|
4241
4245
|
Object.entries(properties).forEach(([key, value]) => {
|
|
4242
|
-
if (typeof
|
|
4246
|
+
if (typeof key === 'string'
|
|
4247
|
+
|| typeof value === 'string'
|
|
4248
|
+
|| typeof value === 'number'
|
|
4249
|
+
|| typeof value === 'boolean') {
|
|
4243
4250
|
propertyMap.push([key, value.toString()]);
|
|
4244
4251
|
}
|
|
4245
4252
|
});
|
|
@@ -4326,6 +4333,17 @@ function isTestEnvironment() {
|
|
|
4326
4333
|
}
|
|
4327
4334
|
return process.env.JEST_WORKER_ID !== undefined;
|
|
4328
4335
|
}
|
|
4336
|
+
|
|
4337
|
+
// Store the event in the event store
|
|
4338
|
+
const trackFn = (moduleName, eventName, properties) => {
|
|
4339
|
+
const event = {
|
|
4340
|
+
event: `${moduleName}.${eventName}`,
|
|
4341
|
+
time: new Date().toISOString(),
|
|
4342
|
+
...(properties && { properties: flattenProperties(properties) }),
|
|
4343
|
+
};
|
|
4344
|
+
addEvent(event);
|
|
4345
|
+
};
|
|
4346
|
+
const track = errorBoundary(trackFn);
|
|
4329
4347
|
// Sending events to the server
|
|
4330
4348
|
const flushFn = async () => {
|
|
4331
4349
|
// Don't flush if not initialised
|
|
@@ -4366,6 +4384,10 @@ if (!isTestEnvironment()) {
|
|
|
4366
4384
|
errorBoundary(flushPoll)();
|
|
4367
4385
|
}
|
|
4368
4386
|
|
|
4387
|
+
track('metrics', 'sdk_version', {
|
|
4388
|
+
version: '1.0.0-alpha.1',
|
|
4389
|
+
});
|
|
4390
|
+
|
|
4369
4391
|
var Environment;
|
|
4370
4392
|
(function (Environment) {
|
|
4371
4393
|
Environment["PRODUCTION"] = "production";
|
|
@@ -4391,7 +4413,7 @@ class APIError extends Error {
|
|
|
4391
4413
|
|
|
4392
4414
|
/* eslint-disable implicit-arrow-linebreak */
|
|
4393
4415
|
const defaultHeaders = {
|
|
4394
|
-
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.
|
|
4416
|
+
sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.0.0-alpha.1',
|
|
4395
4417
|
};
|
|
4396
4418
|
/**
|
|
4397
4419
|
* createAPIConfiguration to create a custom Configuration
|