@augustdigital/sdk 4.17.0 → 4.17.1-alpha.0
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/lib/core/analytics/constants.d.ts +38 -0
- package/lib/core/analytics/constants.js +49 -0
- package/lib/core/analytics/constants.js.map +1 -0
- package/lib/core/analytics/index.d.ts +34 -0
- package/lib/core/analytics/index.js +31 -0
- package/lib/core/analytics/index.js.map +1 -0
- package/lib/core/analytics/instrumentation.d.ts +7 -0
- package/lib/core/analytics/instrumentation.js +150 -0
- package/lib/core/analytics/instrumentation.js.map +1 -0
- package/lib/core/analytics/metrics.d.ts +21 -0
- package/lib/core/analytics/metrics.js +133 -0
- package/lib/core/analytics/metrics.js.map +1 -0
- package/lib/core/analytics/sentry.d.ts +17 -0
- package/lib/core/analytics/sentry.js +167 -0
- package/lib/core/analytics/sentry.js.map +1 -0
- package/lib/core/analytics/types.d.ts +21 -0
- package/lib/core/analytics/types.js +3 -0
- package/lib/core/analytics/types.js.map +1 -0
- package/lib/core/analytics/user-identity.d.ts +12 -0
- package/lib/core/analytics/user-identity.js +82 -0
- package/lib/core/analytics/user-identity.js.map +1 -0
- package/lib/core/analytics/version.d.ts +1 -0
- package/lib/core/analytics/version.js +5 -0
- package/lib/core/analytics/version.js.map +1 -0
- package/lib/core/constants/core.d.ts +1 -0
- package/lib/core/constants/core.js +2 -1
- package/lib/core/constants/core.js.map +1 -1
- package/lib/core/constants/vaults.d.ts +10 -2
- package/lib/core/constants/vaults.js +11 -3
- package/lib/core/constants/vaults.js.map +1 -1
- package/lib/modules/vaults/getters.js +46 -36
- package/lib/modules/vaults/getters.js.map +1 -1
- package/lib/services/debank/fetcher.d.ts +7 -0
- package/lib/services/debank/fetcher.js +16 -0
- package/lib/services/debank/fetcher.js.map +1 -1
- package/package.json +12 -12
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const SENTRY_DSN =
|
|
2
|
+
'https://d73b6a85fe14960b8dac8ac61a743a94@o4507215496609792.ingest.de.sentry.io/4510699327389776';
|
|
3
|
+
export declare const SENTRY_CONFIG: {
|
|
4
|
+
readonly tracesSampleRate: 0.1;
|
|
5
|
+
readonly enableTracing: true;
|
|
6
|
+
readonly environment: 'production';
|
|
7
|
+
};
|
|
8
|
+
export declare const METHOD_CATEGORIES: {
|
|
9
|
+
readonly read: readonly [
|
|
10
|
+
'getVaults',
|
|
11
|
+
'getVault',
|
|
12
|
+
'getVaultLoans',
|
|
13
|
+
'getVaultAllocations',
|
|
14
|
+
'getVaultApy',
|
|
15
|
+
'getVaultTvl',
|
|
16
|
+
'getVaultHistoricalTimeseries',
|
|
17
|
+
'getVaultPositions',
|
|
18
|
+
'getVaultUserHistory',
|
|
19
|
+
'getVaultUserTransfers',
|
|
20
|
+
'getVaultUserLifetimePnl',
|
|
21
|
+
'getVaultPnl',
|
|
22
|
+
'getVaultStakingPositions',
|
|
23
|
+
'getUserPoints',
|
|
24
|
+
'getPrice',
|
|
25
|
+
'getVaultAvailableRedemptions',
|
|
26
|
+
'getVaultBorrowerHealthFactor',
|
|
27
|
+
'fetchPointsLeaderboard',
|
|
28
|
+
'getVaultAnnualizedApy',
|
|
29
|
+
'getVaultSummary',
|
|
30
|
+
'getVaultWithdrawals',
|
|
31
|
+
'previewRedemption',
|
|
32
|
+
'getTotalDeposited',
|
|
33
|
+
'getYieldLastRealizedOn',
|
|
34
|
+
];
|
|
35
|
+
readonly write: readonly ['vaultDeposit', 'registerUserForPoints'];
|
|
36
|
+
readonly state: readonly ['switchNetwork', 'updateWallet', 'clearWallet'];
|
|
37
|
+
};
|
|
38
|
+
export declare function getMethodCategory(methodName: string): string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.METHOD_CATEGORIES = exports.SENTRY_CONFIG = exports.SENTRY_DSN = void 0;
|
|
4
|
+
exports.getMethodCategory = getMethodCategory;
|
|
5
|
+
exports.SENTRY_DSN = 'https://d73b6a85fe14960b8dac8ac61a743a94@o4507215496609792.ingest.de.sentry.io/4510699327389776';
|
|
6
|
+
exports.SENTRY_CONFIG = {
|
|
7
|
+
tracesSampleRate: 0.1,
|
|
8
|
+
enableTracing: true,
|
|
9
|
+
environment: 'production',
|
|
10
|
+
};
|
|
11
|
+
exports.METHOD_CATEGORIES = {
|
|
12
|
+
read: [
|
|
13
|
+
'getVaults',
|
|
14
|
+
'getVault',
|
|
15
|
+
'getVaultLoans',
|
|
16
|
+
'getVaultAllocations',
|
|
17
|
+
'getVaultApy',
|
|
18
|
+
'getVaultTvl',
|
|
19
|
+
'getVaultHistoricalTimeseries',
|
|
20
|
+
'getVaultPositions',
|
|
21
|
+
'getVaultUserHistory',
|
|
22
|
+
'getVaultUserTransfers',
|
|
23
|
+
'getVaultUserLifetimePnl',
|
|
24
|
+
'getVaultPnl',
|
|
25
|
+
'getVaultStakingPositions',
|
|
26
|
+
'getUserPoints',
|
|
27
|
+
'getPrice',
|
|
28
|
+
'getVaultAvailableRedemptions',
|
|
29
|
+
'getVaultBorrowerHealthFactor',
|
|
30
|
+
'fetchPointsLeaderboard',
|
|
31
|
+
'getVaultAnnualizedApy',
|
|
32
|
+
'getVaultSummary',
|
|
33
|
+
'getVaultWithdrawals',
|
|
34
|
+
'previewRedemption',
|
|
35
|
+
'getTotalDeposited',
|
|
36
|
+
'getYieldLastRealizedOn',
|
|
37
|
+
],
|
|
38
|
+
write: ['vaultDeposit', 'registerUserForPoints'],
|
|
39
|
+
state: ['switchNetwork', 'updateWallet', 'clearWallet'],
|
|
40
|
+
};
|
|
41
|
+
function getMethodCategory(methodName) {
|
|
42
|
+
for (const [category, methods] of Object.entries(exports.METHOD_CATEGORIES)) {
|
|
43
|
+
if (methods.includes(methodName)) {
|
|
44
|
+
return category;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return 'other';
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src.ts/core/analytics/constants.ts"],"names":[],"mappings":";;;AA2DA,8CAOC;AA9DY,QAAA,UAAU,GACrB,iGAAiG,CAAC;AAKvF,QAAA,aAAa,GAAG;IAE3B,gBAAgB,EAAE,GAAG;IAErB,aAAa,EAAE,IAAI;IAEnB,WAAW,EAAE,YAAY;CACjB,CAAC;AAKE,QAAA,iBAAiB,GAAG;IAE/B,IAAI,EAAE;QACJ,WAAW;QACX,UAAU;QACV,eAAe;QACf,qBAAqB;QACrB,aAAa;QACb,aAAa;QACb,8BAA8B;QAC9B,mBAAmB;QACnB,qBAAqB;QACrB,uBAAuB;QACvB,yBAAyB;QACzB,aAAa;QACb,0BAA0B;QAC1B,eAAe;QACf,UAAU;QACV,8BAA8B;QAC9B,8BAA8B;QAC9B,wBAAwB;QACxB,uBAAuB;QACvB,iBAAiB;QACjB,qBAAqB;QACrB,mBAAmB;QACnB,mBAAmB;QACnB,wBAAwB;KACzB;IAED,KAAK,EAAE,CAAC,cAAc,EAAE,uBAAuB,CAAC;IAEhD,KAAK,EAAE,CAAC,eAAe,EAAE,cAAc,EAAE,aAAa,CAAC;CAC/C,CAAC;AAKX,SAAgB,iBAAiB,CAAC,UAAkB;IAClD,KAAK,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,yBAAiB,CAAC,EAAE,CAAC;QACpE,IAAK,OAA6B,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACxD,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
IAnalyticsConfig,
|
|
3
|
+
IUserIdentity,
|
|
4
|
+
IMethodCallMetrics,
|
|
5
|
+
} from './types';
|
|
6
|
+
export {
|
|
7
|
+
SENTRY_CONFIG,
|
|
8
|
+
METHOD_CATEGORIES,
|
|
9
|
+
getMethodCategory,
|
|
10
|
+
} from './constants';
|
|
11
|
+
export {
|
|
12
|
+
hashApiKey,
|
|
13
|
+
getSessionId,
|
|
14
|
+
generateFingerprint,
|
|
15
|
+
createUserIdentity,
|
|
16
|
+
getUserId,
|
|
17
|
+
resetSession,
|
|
18
|
+
} from './user-identity';
|
|
19
|
+
export {
|
|
20
|
+
initializeSentry,
|
|
21
|
+
updateUser,
|
|
22
|
+
clearUser,
|
|
23
|
+
isAnalyticsEnabled,
|
|
24
|
+
getSentry,
|
|
25
|
+
resetAnalytics,
|
|
26
|
+
} from './sentry';
|
|
27
|
+
export {
|
|
28
|
+
trackCacheOperation,
|
|
29
|
+
trackApiCall,
|
|
30
|
+
trackNetworkSwitch,
|
|
31
|
+
getCacheStats,
|
|
32
|
+
resetCacheStats,
|
|
33
|
+
} from './metrics';
|
|
34
|
+
export { withMethodTracking, instrumentClass } from './instrumentation';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.instrumentClass = exports.withMethodTracking = exports.resetCacheStats = exports.getCacheStats = exports.trackNetworkSwitch = exports.trackApiCall = exports.trackCacheOperation = exports.resetAnalytics = exports.getSentry = exports.isAnalyticsEnabled = exports.clearUser = exports.updateUser = exports.initializeSentry = exports.resetSession = exports.getUserId = exports.createUserIdentity = exports.generateFingerprint = exports.getSessionId = exports.hashApiKey = exports.getMethodCategory = exports.METHOD_CATEGORIES = exports.SENTRY_CONFIG = void 0;
|
|
4
|
+
var constants_1 = require("./constants");
|
|
5
|
+
Object.defineProperty(exports, "SENTRY_CONFIG", { enumerable: true, get: function () { return constants_1.SENTRY_CONFIG; } });
|
|
6
|
+
Object.defineProperty(exports, "METHOD_CATEGORIES", { enumerable: true, get: function () { return constants_1.METHOD_CATEGORIES; } });
|
|
7
|
+
Object.defineProperty(exports, "getMethodCategory", { enumerable: true, get: function () { return constants_1.getMethodCategory; } });
|
|
8
|
+
var user_identity_1 = require("./user-identity");
|
|
9
|
+
Object.defineProperty(exports, "hashApiKey", { enumerable: true, get: function () { return user_identity_1.hashApiKey; } });
|
|
10
|
+
Object.defineProperty(exports, "getSessionId", { enumerable: true, get: function () { return user_identity_1.getSessionId; } });
|
|
11
|
+
Object.defineProperty(exports, "generateFingerprint", { enumerable: true, get: function () { return user_identity_1.generateFingerprint; } });
|
|
12
|
+
Object.defineProperty(exports, "createUserIdentity", { enumerable: true, get: function () { return user_identity_1.createUserIdentity; } });
|
|
13
|
+
Object.defineProperty(exports, "getUserId", { enumerable: true, get: function () { return user_identity_1.getUserId; } });
|
|
14
|
+
Object.defineProperty(exports, "resetSession", { enumerable: true, get: function () { return user_identity_1.resetSession; } });
|
|
15
|
+
var sentry_1 = require("./sentry");
|
|
16
|
+
Object.defineProperty(exports, "initializeSentry", { enumerable: true, get: function () { return sentry_1.initializeSentry; } });
|
|
17
|
+
Object.defineProperty(exports, "updateUser", { enumerable: true, get: function () { return sentry_1.updateUser; } });
|
|
18
|
+
Object.defineProperty(exports, "clearUser", { enumerable: true, get: function () { return sentry_1.clearUser; } });
|
|
19
|
+
Object.defineProperty(exports, "isAnalyticsEnabled", { enumerable: true, get: function () { return sentry_1.isAnalyticsEnabled; } });
|
|
20
|
+
Object.defineProperty(exports, "getSentry", { enumerable: true, get: function () { return sentry_1.getSentry; } });
|
|
21
|
+
Object.defineProperty(exports, "resetAnalytics", { enumerable: true, get: function () { return sentry_1.resetAnalytics; } });
|
|
22
|
+
var metrics_1 = require("./metrics");
|
|
23
|
+
Object.defineProperty(exports, "trackCacheOperation", { enumerable: true, get: function () { return metrics_1.trackCacheOperation; } });
|
|
24
|
+
Object.defineProperty(exports, "trackApiCall", { enumerable: true, get: function () { return metrics_1.trackApiCall; } });
|
|
25
|
+
Object.defineProperty(exports, "trackNetworkSwitch", { enumerable: true, get: function () { return metrics_1.trackNetworkSwitch; } });
|
|
26
|
+
Object.defineProperty(exports, "getCacheStats", { enumerable: true, get: function () { return metrics_1.getCacheStats; } });
|
|
27
|
+
Object.defineProperty(exports, "resetCacheStats", { enumerable: true, get: function () { return metrics_1.resetCacheStats; } });
|
|
28
|
+
var instrumentation_1 = require("./instrumentation");
|
|
29
|
+
Object.defineProperty(exports, "withMethodTracking", { enumerable: true, get: function () { return instrumentation_1.withMethodTracking; } });
|
|
30
|
+
Object.defineProperty(exports, "instrumentClass", { enumerable: true, get: function () { return instrumentation_1.instrumentClass; } });
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src.ts/core/analytics/index.ts"],"names":[],"mappings":";;;AAmCA,yCAIqB;AAHnB,0GAAA,aAAa,OAAA;AACb,8GAAA,iBAAiB,OAAA;AACjB,8GAAA,iBAAiB,OAAA;AAInB,iDAOyB;AANvB,2GAAA,UAAU,OAAA;AACV,6GAAA,YAAY,OAAA;AACZ,oHAAA,mBAAmB,OAAA;AACnB,mHAAA,kBAAkB,OAAA;AAClB,0GAAA,SAAS,OAAA;AACT,6GAAA,YAAY,OAAA;AAId,mCAOkB;AANhB,0GAAA,gBAAgB,OAAA;AAChB,oGAAA,UAAU,OAAA;AACV,mGAAA,SAAS,OAAA;AACT,4GAAA,kBAAkB,OAAA;AAClB,mGAAA,SAAS,OAAA;AACT,wGAAA,cAAc,OAAA;AAIhB,qCAMmB;AALjB,8GAAA,mBAAmB,OAAA;AACnB,uGAAA,YAAY,OAAA;AACZ,6GAAA,kBAAkB,OAAA;AAClB,wGAAA,aAAa,OAAA;AACb,0GAAA,eAAe,OAAA;AAIjB,qDAAwE;AAA/D,qHAAA,kBAAkB,OAAA;AAAE,kHAAA,eAAe,OAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function withMethodTracking<
|
|
2
|
+
T extends (...args: unknown[]) => Promise<unknown>,
|
|
3
|
+
>(methodName: string, method: T, getChainId?: () => number | undefined): T;
|
|
4
|
+
export declare function instrumentClass<T extends object>(
|
|
5
|
+
instance: T,
|
|
6
|
+
getChainId: () => number | undefined,
|
|
7
|
+
): T;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.withMethodTracking = withMethodTracking;
|
|
37
|
+
exports.instrumentClass = instrumentClass;
|
|
38
|
+
const Sentry = __importStar(require("@sentry/browser"));
|
|
39
|
+
const constants_1 = require("./constants");
|
|
40
|
+
const sentry_1 = require("./sentry");
|
|
41
|
+
function withMethodTracking(methodName, method, getChainId) {
|
|
42
|
+
return async function trackedMethod(...args) {
|
|
43
|
+
if (!(0, sentry_1.isAnalyticsEnabled)()) {
|
|
44
|
+
return method(...args);
|
|
45
|
+
}
|
|
46
|
+
const startTime = performance.now();
|
|
47
|
+
const chainId = getChainId?.();
|
|
48
|
+
const category = (0, constants_1.getMethodCategory)(methodName);
|
|
49
|
+
try {
|
|
50
|
+
return await Sentry.startSpan({
|
|
51
|
+
op: 'sdk.method',
|
|
52
|
+
name: methodName,
|
|
53
|
+
attributes: {
|
|
54
|
+
category,
|
|
55
|
+
chainId: chainId?.toString() || 'unknown',
|
|
56
|
+
},
|
|
57
|
+
}, async (span) => {
|
|
58
|
+
try {
|
|
59
|
+
const result = await method(...args);
|
|
60
|
+
const duration = performance.now() - startTime;
|
|
61
|
+
span?.setAttribute('duration', Math.round(duration));
|
|
62
|
+
span?.setAttribute('success', true);
|
|
63
|
+
trackMethodCall(methodName, {
|
|
64
|
+
method: methodName,
|
|
65
|
+
chainId,
|
|
66
|
+
duration,
|
|
67
|
+
success: true,
|
|
68
|
+
category,
|
|
69
|
+
});
|
|
70
|
+
span?.setStatus({ code: 1 });
|
|
71
|
+
return result;
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
const duration = performance.now() - startTime;
|
|
75
|
+
const errorType = error instanceof Error ? error.name : 'UnknownError';
|
|
76
|
+
span?.setAttribute('duration', Math.round(duration));
|
|
77
|
+
span?.setAttribute('success', false);
|
|
78
|
+
span?.setAttribute('error', error instanceof Error ? error.message : String(error));
|
|
79
|
+
trackMethodCall(methodName, {
|
|
80
|
+
method: methodName,
|
|
81
|
+
chainId,
|
|
82
|
+
duration,
|
|
83
|
+
success: false,
|
|
84
|
+
category,
|
|
85
|
+
errorType,
|
|
86
|
+
});
|
|
87
|
+
span?.setStatus({ code: 2, message: errorType });
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
if (error instanceof Error && error.message?.includes('Sentry')) {
|
|
94
|
+
return method(...args);
|
|
95
|
+
}
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function trackMethodCall(methodName, metrics) {
|
|
101
|
+
try {
|
|
102
|
+
Sentry.addBreadcrumb({
|
|
103
|
+
category: 'sdk.method',
|
|
104
|
+
message: methodName,
|
|
105
|
+
level: metrics.success ? 'info' : 'error',
|
|
106
|
+
data: {
|
|
107
|
+
chainId: metrics.chainId,
|
|
108
|
+
duration: Math.round(metrics.duration),
|
|
109
|
+
category: metrics.category,
|
|
110
|
+
errorType: metrics.errorType,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
Sentry.setMeasurement('sdk.method.duration', metrics.duration, 'millisecond');
|
|
114
|
+
Sentry.setTag('sdk.last_method', methodName);
|
|
115
|
+
Sentry.setTag('sdk.last_category', metrics.category);
|
|
116
|
+
if (metrics.chainId) {
|
|
117
|
+
Sentry.setTag('sdk.last_chainId', metrics.chainId.toString());
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function isAsyncMethod(fn) {
|
|
124
|
+
if (fn.constructor.name === 'AsyncFunction') {
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
const fnString = fn.toString();
|
|
128
|
+
return fnString.includes('__awaiter') || fnString.startsWith('async');
|
|
129
|
+
}
|
|
130
|
+
function instrumentClass(instance, getChainId) {
|
|
131
|
+
try {
|
|
132
|
+
const proto = Object.getPrototypeOf(instance);
|
|
133
|
+
const methodNames = Object.getOwnPropertyNames(proto).filter((name) => {
|
|
134
|
+
if (name === 'constructor' || name.startsWith('_'))
|
|
135
|
+
return false;
|
|
136
|
+
const descriptor = Object.getOwnPropertyDescriptor(proto, name);
|
|
137
|
+
return typeof descriptor?.value === 'function';
|
|
138
|
+
});
|
|
139
|
+
for (const methodName of methodNames) {
|
|
140
|
+
const original = instance[methodName];
|
|
141
|
+
if (typeof original === 'function' && isAsyncMethod(original)) {
|
|
142
|
+
instance[methodName] = withMethodTracking(methodName, original.bind(instance), getChainId);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
}
|
|
148
|
+
return instance;
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=instrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../../src.ts/core/analytics/instrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,gDAoFC;AA8DD,0CA6BC;AA7LD,wDAA0C;AAC1C,2CAAgD;AAChD,qCAA8C;AAY9C,SAAgB,kBAAkB,CAEhC,UAAkB,EAAE,MAAS,EAAE,UAAqC;IACpE,OAAO,KAAK,UAAU,aAAa,CACjC,GAAG,IAAmB;QAGtB,IAAI,CAAC,IAAA,2BAAkB,GAAE,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC,GAAG,IAAI,CAA2B,CAAC;QACnD,CAAC;QAED,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,UAAU,EAAE,EAAE,CAAC;QAC/B,MAAM,QAAQ,GAAG,IAAA,6BAAiB,EAAC,UAAU,CAAC,CAAC;QAE/C,IAAI,CAAC;YAEH,OAAO,MAAM,MAAM,CAAC,SAAS,CAC3B;gBACE,EAAE,EAAE,YAAY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AAU,CAAC,GAAG,kBAAkB,CACpE,UAAU,EACV,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAA6C,EACnE,UAAU,CACX,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;IAET,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ICacheOperation, ICacheType } from './types';
|
|
2
|
+
declare let cacheStats: {
|
|
3
|
+
hits: number;
|
|
4
|
+
misses: number;
|
|
5
|
+
sets: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function trackCacheOperation(
|
|
8
|
+
operation: ICacheOperation,
|
|
9
|
+
cacheType: ICacheType,
|
|
10
|
+
): void;
|
|
11
|
+
export declare function trackApiCall(
|
|
12
|
+
endpoint: string,
|
|
13
|
+
method: string,
|
|
14
|
+
startTime: number,
|
|
15
|
+
status: number,
|
|
16
|
+
server: string,
|
|
17
|
+
): void;
|
|
18
|
+
export declare function trackNetworkSwitch(chainId: number): void;
|
|
19
|
+
export declare function getCacheStats(): typeof cacheStats;
|
|
20
|
+
export declare function resetCacheStats(): void;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.trackCacheOperation = trackCacheOperation;
|
|
37
|
+
exports.trackApiCall = trackApiCall;
|
|
38
|
+
exports.trackNetworkSwitch = trackNetworkSwitch;
|
|
39
|
+
exports.getCacheStats = getCacheStats;
|
|
40
|
+
exports.resetCacheStats = resetCacheStats;
|
|
41
|
+
const Sentry = __importStar(require("@sentry/browser"));
|
|
42
|
+
const sentry_1 = require("./sentry");
|
|
43
|
+
let cacheStats = {
|
|
44
|
+
hits: 0,
|
|
45
|
+
misses: 0,
|
|
46
|
+
sets: 0,
|
|
47
|
+
};
|
|
48
|
+
function trackCacheOperation(operation, cacheType) {
|
|
49
|
+
if (!(0, sentry_1.isAnalyticsEnabled)())
|
|
50
|
+
return;
|
|
51
|
+
try {
|
|
52
|
+
switch (operation) {
|
|
53
|
+
case 'hit':
|
|
54
|
+
cacheStats.hits++;
|
|
55
|
+
break;
|
|
56
|
+
case 'miss':
|
|
57
|
+
cacheStats.misses++;
|
|
58
|
+
break;
|
|
59
|
+
case 'set':
|
|
60
|
+
cacheStats.sets++;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
const totalLookups = cacheStats.hits + cacheStats.misses;
|
|
64
|
+
const hitRate = totalLookups > 0 ? cacheStats.hits / totalLookups : 0;
|
|
65
|
+
Sentry.addBreadcrumb({
|
|
66
|
+
category: 'cache',
|
|
67
|
+
message: `${cacheType}:${operation}`,
|
|
68
|
+
level: 'debug',
|
|
69
|
+
data: {
|
|
70
|
+
cacheType,
|
|
71
|
+
operation,
|
|
72
|
+
hitRate: hitRate.toFixed(3),
|
|
73
|
+
totalOperations: cacheStats.hits + cacheStats.misses + cacheStats.sets,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
catch {
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function trackApiCall(endpoint, method, startTime, status, server) {
|
|
81
|
+
if (!(0, sentry_1.isAnalyticsEnabled)())
|
|
82
|
+
return;
|
|
83
|
+
try {
|
|
84
|
+
const duration = performance.now() - startTime;
|
|
85
|
+
const normalizedEndpoint = normalizeEndpoint(endpoint);
|
|
86
|
+
Sentry.addBreadcrumb({
|
|
87
|
+
category: 'api',
|
|
88
|
+
message: `${method} ${normalizedEndpoint}`,
|
|
89
|
+
level: status >= 400 || status === 0 ? 'error' : 'info',
|
|
90
|
+
data: {
|
|
91
|
+
endpoint: normalizedEndpoint,
|
|
92
|
+
method,
|
|
93
|
+
duration: Math.round(duration),
|
|
94
|
+
status,
|
|
95
|
+
server,
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
Sentry.setMeasurement('api.duration', duration, 'millisecond');
|
|
99
|
+
Sentry.setTag('api.last_endpoint', normalizedEndpoint);
|
|
100
|
+
Sentry.setTag('api.server', server);
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function trackNetworkSwitch(chainId) {
|
|
106
|
+
if (!(0, sentry_1.isAnalyticsEnabled)())
|
|
107
|
+
return;
|
|
108
|
+
try {
|
|
109
|
+
Sentry.addBreadcrumb({
|
|
110
|
+
category: 'network',
|
|
111
|
+
message: `Switched to chain ${chainId}`,
|
|
112
|
+
level: 'info',
|
|
113
|
+
data: { chainId },
|
|
114
|
+
});
|
|
115
|
+
Sentry.setTag('active.chainId', chainId.toString());
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function normalizeEndpoint(endpoint) {
|
|
121
|
+
return (endpoint
|
|
122
|
+
.replace(/0x[a-fA-F0-9]{40}/g, ':address')
|
|
123
|
+
.replace(/\/\d{5,}/g, '/:chainId')
|
|
124
|
+
.replace(/[a-f0-9-]{36}/gi, ':uuid')
|
|
125
|
+
.replace(/\/\d+(?=\/|$)/g, '/:id'));
|
|
126
|
+
}
|
|
127
|
+
function getCacheStats() {
|
|
128
|
+
return { ...cacheStats };
|
|
129
|
+
}
|
|
130
|
+
function resetCacheStats() {
|
|
131
|
+
cacheStats = { hits: 0, misses: 0, sets: 0 };
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../src.ts/core/analytics/metrics.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,kDAuCC;AAWD,oCAsCC;AAOD,gDAeC;AA0BD,sCAEC;AAKD,0CAEC;AApKD,wDAA0C;AAC1C,qCAA8C;AAM9C,IAAI,UAAU,GAAG;IACf,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;CACR,CAAC;AAQF,SAAgB,mBAAmB,CACjC,SAA0B,EAC1B,SAAqB;IAErB,IAAI,CAAC,IAAA,2BAAkB,GAAE;QAAE,OAAO;IAElC,IAAI,CAAC;QAEH,QAAQ,S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AgB,eAAe;IAC7B,UAAU,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as Sentry from '@sentry/browser';
|
|
2
|
+
import { IEnv } from '../../types';
|
|
3
|
+
import { IAnalyticsConfig } from './types';
|
|
4
|
+
export declare function initializeSentry(
|
|
5
|
+
config: IAnalyticsConfig,
|
|
6
|
+
environment: IEnv,
|
|
7
|
+
walletAddress?: string,
|
|
8
|
+
apiKey?: string,
|
|
9
|
+
): void;
|
|
10
|
+
export declare function updateUser(
|
|
11
|
+
walletAddress?: string,
|
|
12
|
+
environment?: IEnv,
|
|
13
|
+
): void;
|
|
14
|
+
export declare function clearUser(): void;
|
|
15
|
+
export declare function isAnalyticsEnabled(): boolean;
|
|
16
|
+
export declare function getSentry(): typeof Sentry | null;
|
|
17
|
+
export declare function resetAnalytics(): void;
|