@formo/analytics 1.28.4 → 1.28.6
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/README.md +1 -2
- package/dist/cjs/src/FormoAnalytics.d.ts +7 -3
- package/dist/cjs/src/FormoAnalytics.js +24 -12
- package/dist/cjs/src/index.d.ts +3 -1
- package/dist/cjs/src/index.js +5 -1
- package/dist/cjs/src/solana/SolanaManager.d.ts +36 -11
- package/dist/cjs/src/solana/SolanaManager.js +47 -49
- package/dist/cjs/src/solana/SolanaStoreHandler.d.ts +88 -0
- package/dist/cjs/src/solana/SolanaStoreHandler.js +471 -0
- package/dist/cjs/src/solana/index.d.ts +8 -4
- package/dist/cjs/src/solana/index.js +10 -6
- package/dist/cjs/src/solana/storeTypes.d.ts +107 -0
- package/dist/cjs/src/solana/storeTypes.js +12 -0
- package/dist/cjs/src/solana/types.d.ts +23 -154
- package/dist/cjs/src/solana/types.js +4 -37
- package/dist/cjs/src/storage/StorageManager.d.ts +1 -0
- package/dist/cjs/src/storage/StorageManager.js +10 -2
- package/dist/cjs/src/types/base.d.ts +16 -5
- package/dist/cjs/src/version.d.ts +1 -1
- package/dist/cjs/src/version.js +1 -1
- package/dist/esm/src/FormoAnalytics.d.ts +7 -3
- package/dist/esm/src/FormoAnalytics.js +24 -12
- package/dist/esm/src/index.d.ts +3 -1
- package/dist/esm/src/index.js +1 -0
- package/dist/esm/src/solana/SolanaManager.d.ts +36 -11
- package/dist/esm/src/solana/SolanaManager.js +47 -49
- package/dist/esm/src/solana/SolanaStoreHandler.d.ts +88 -0
- package/dist/esm/src/solana/SolanaStoreHandler.js +468 -0
- package/dist/esm/src/solana/index.d.ts +8 -4
- package/dist/esm/src/solana/index.js +8 -4
- package/dist/esm/src/solana/storeTypes.d.ts +107 -0
- package/dist/esm/src/solana/storeTypes.js +11 -0
- package/dist/esm/src/solana/types.d.ts +23 -154
- package/dist/esm/src/solana/types.js +3 -34
- package/dist/esm/src/storage/StorageManager.d.ts +1 -0
- package/dist/esm/src/storage/StorageManager.js +10 -2
- package/dist/esm/src/types/base.d.ts +16 -5
- package/dist/esm/src/version.d.ts +1 -1
- package/dist/esm/src/version.js +1 -1
- package/dist/index.umd.min.js +1 -1
- package/package.json +5 -16
- package/dist/cjs/src/solana/SolanaAdapter.d.ts +0 -210
- package/dist/cjs/src/solana/SolanaAdapter.js +0 -988
- package/dist/esm/src/solana/SolanaAdapter.d.ts +0 -210
- package/dist/esm/src/solana/SolanaAdapter.js +0 -985
package/README.md
CHANGED
|
@@ -23,8 +23,7 @@ You can install Formo on:
|
|
|
23
23
|
- [Wagmi](https://docs.formo.so/install#wagmi) (recommended)
|
|
24
24
|
- [HTML Snippet](https://docs.formo.so/install#html-snippet)
|
|
25
25
|
- [React](https://docs.formo.so/install#react)
|
|
26
|
-
- [Next.js
|
|
27
|
-
- [Next.js pages router](https://docs.formo.so/install#next-js-pages-router)
|
|
26
|
+
- [Next.js](https://docs.formo.so/install#next-js)
|
|
28
27
|
|
|
29
28
|
## Configuration
|
|
30
29
|
|
|
@@ -45,6 +45,11 @@ export declare class FormoAnalytics implements IFormoAnalytics {
|
|
|
45
45
|
* When true, EIP-1193 provider wrapping is skipped
|
|
46
46
|
*/
|
|
47
47
|
private isWagmiMode;
|
|
48
|
+
/**
|
|
49
|
+
* Flag indicating if EVM provider tracking is disabled.
|
|
50
|
+
* When true, all EIP-1193/EIP-6963 detection and wrapping is skipped.
|
|
51
|
+
*/
|
|
52
|
+
private isEvmDisabled;
|
|
48
53
|
/** Instance-level flag so multiple SDK instances don't interfere. */
|
|
49
54
|
private crossSubdomainCookies;
|
|
50
55
|
config: Config;
|
|
@@ -294,10 +299,9 @@ export declare class FormoAnalytics implements IFormoAnalytics {
|
|
|
294
299
|
*
|
|
295
300
|
* @example
|
|
296
301
|
* ```tsx
|
|
297
|
-
* formo.solana.
|
|
298
|
-
* formo.solana.setConnection(connection);
|
|
302
|
+
* formo.solana.setStore(client.store);
|
|
299
303
|
* formo.solana.setCluster("devnet");
|
|
300
|
-
* formo.
|
|
304
|
+
* // For signatures, use formo.signature() directly
|
|
301
305
|
* ```
|
|
302
306
|
*/
|
|
303
307
|
get solana(): SolanaManager;
|
|
@@ -117,6 +117,11 @@ var FormoAnalytics = /** @class */ (function () {
|
|
|
117
117
|
* When true, EIP-1193 provider wrapping is skipped
|
|
118
118
|
*/
|
|
119
119
|
this.isWagmiMode = false;
|
|
120
|
+
/**
|
|
121
|
+
* Flag indicating if EVM provider tracking is disabled.
|
|
122
|
+
* When true, all EIP-1193/EIP-6963 detection and wrapping is skipped.
|
|
123
|
+
*/
|
|
124
|
+
this.isEvmDisabled = false;
|
|
120
125
|
this.currentUserId = "";
|
|
121
126
|
this.config = {
|
|
122
127
|
writeKey: writeKey,
|
|
@@ -124,6 +129,7 @@ var FormoAnalytics = /** @class */ (function () {
|
|
|
124
129
|
this.options = options;
|
|
125
130
|
// Check if Wagmi mode is enabled
|
|
126
131
|
this.isWagmiMode = !!options.wagmi;
|
|
132
|
+
this.isEvmDisabled = options.evm === false;
|
|
127
133
|
this.crossSubdomainCookies = (_a = options.crossSubdomainCookies) !== null && _a !== void 0 ? _a : true;
|
|
128
134
|
// Normalize so downstream consumers (EventFactory) read the resolved value.
|
|
129
135
|
options.crossSubdomainCookies = this.crossSubdomainCookies;
|
|
@@ -156,8 +162,11 @@ var FormoAnalytics = /** @class */ (function () {
|
|
|
156
162
|
if (this.hasOptedOutTracking()) {
|
|
157
163
|
logger_1.logger.info("User has previously opted out of tracking");
|
|
158
164
|
}
|
|
159
|
-
// Initialize
|
|
160
|
-
if (this.
|
|
165
|
+
// Initialize EVM provider tracking (unless explicitly disabled)
|
|
166
|
+
if (this.isEvmDisabled) {
|
|
167
|
+
logger_1.logger.info("FormoAnalytics: EVM provider tracking disabled");
|
|
168
|
+
}
|
|
169
|
+
else if (this.isWagmiMode && options.wagmi) {
|
|
161
170
|
logger_1.logger.info("FormoAnalytics: Initializing in Wagmi mode");
|
|
162
171
|
this.wagmiHandler = new wagmi_1.WagmiEventHandler(this, options.wagmi.config, options.wagmi.queryClient);
|
|
163
172
|
}
|
|
@@ -226,22 +235,26 @@ var FormoAnalytics = /** @class */ (function () {
|
|
|
226
235
|
case 0:
|
|
227
236
|
(0, storage_1.initStorageManager)(writeKey);
|
|
228
237
|
analytics = new FormoAnalytics(writeKey, options);
|
|
229
|
-
if (
|
|
238
|
+
if (!analytics.isEvmDisabled) return [3 /*break*/, 1];
|
|
239
|
+
logger_1.logger.info("FormoAnalytics: Skipping provider detection (EVM disabled)");
|
|
240
|
+
return [3 /*break*/, 5];
|
|
241
|
+
case 1:
|
|
242
|
+
if (!!analytics.isWagmiMode) return [3 /*break*/, 4];
|
|
230
243
|
// Auto-detect wallet provider
|
|
231
244
|
_a = analytics;
|
|
232
245
|
return [4 /*yield*/, analytics.getProviders()];
|
|
233
|
-
case
|
|
246
|
+
case 2:
|
|
234
247
|
// Auto-detect wallet provider
|
|
235
248
|
_a._providers = _b.sent();
|
|
236
249
|
return [4 /*yield*/, analytics.detectWallets(analytics._providers)];
|
|
237
|
-
case
|
|
250
|
+
case 3:
|
|
238
251
|
_b.sent();
|
|
239
252
|
analytics.trackProviders(analytics._providers);
|
|
240
|
-
return [3 /*break*/,
|
|
241
|
-
case
|
|
253
|
+
return [3 /*break*/, 5];
|
|
254
|
+
case 4:
|
|
242
255
|
logger_1.logger.info("FormoAnalytics: Skipping provider detection (Wagmi mode)");
|
|
243
|
-
_b.label =
|
|
244
|
-
case
|
|
256
|
+
_b.label = 5;
|
|
257
|
+
case 5: return [2 /*return*/, analytics];
|
|
245
258
|
}
|
|
246
259
|
});
|
|
247
260
|
});
|
|
@@ -1770,10 +1783,9 @@ var FormoAnalytics = /** @class */ (function () {
|
|
|
1770
1783
|
*
|
|
1771
1784
|
* @example
|
|
1772
1785
|
* ```tsx
|
|
1773
|
-
* formo.solana.
|
|
1774
|
-
* formo.solana.setConnection(connection);
|
|
1786
|
+
* formo.solana.setStore(client.store);
|
|
1775
1787
|
* formo.solana.setCluster("devnet");
|
|
1776
|
-
* formo.
|
|
1788
|
+
* // For signatures, use formo.signature() directly
|
|
1777
1789
|
* ```
|
|
1778
1790
|
*/
|
|
1779
1791
|
get: function () {
|
package/dist/cjs/src/index.d.ts
CHANGED
|
@@ -4,5 +4,7 @@ export * from "./types";
|
|
|
4
4
|
export { parsePrivyProperties } from "./privy";
|
|
5
5
|
export type { PrivyUser, PrivyLinkedAccount, PrivyAccountType, PrivyProfileProperties, PrivyWalletInfo } from "./privy";
|
|
6
6
|
export { SolanaManager } from "./solana";
|
|
7
|
-
export
|
|
7
|
+
export { SOLANA_CHAIN_IDS, DEFAULT_SOLANA_CHAIN_ID, isSolanaChainId } from "./solana";
|
|
8
|
+
export type { SolanaOptions, SolanaCluster, } from "./solana";
|
|
9
|
+
export type { SolanaClientStore, SolanaClientState, } from "./solana";
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cjs/src/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.SolanaManager = exports.parsePrivyProperties = void 0;
|
|
17
|
+
exports.isSolanaChainId = exports.DEFAULT_SOLANA_CHAIN_ID = exports.SOLANA_CHAIN_IDS = exports.SolanaManager = exports.parsePrivyProperties = void 0;
|
|
18
18
|
var initialization_1 = require("./initialization");
|
|
19
19
|
__exportStar(require("./FormoAnalyticsProvider"), exports);
|
|
20
20
|
__exportStar(require("./FormoAnalytics"), exports);
|
|
@@ -24,6 +24,10 @@ Object.defineProperty(exports, "parsePrivyProperties", { enumerable: true, get:
|
|
|
24
24
|
// Solana integration exports
|
|
25
25
|
var solana_1 = require("./solana");
|
|
26
26
|
Object.defineProperty(exports, "SolanaManager", { enumerable: true, get: function () { return solana_1.SolanaManager; } });
|
|
27
|
+
var solana_2 = require("./solana");
|
|
28
|
+
Object.defineProperty(exports, "SOLANA_CHAIN_IDS", { enumerable: true, get: function () { return solana_2.SOLANA_CHAIN_IDS; } });
|
|
29
|
+
Object.defineProperty(exports, "DEFAULT_SOLANA_CHAIN_ID", { enumerable: true, get: function () { return solana_2.DEFAULT_SOLANA_CHAIN_ID; } });
|
|
30
|
+
Object.defineProperty(exports, "isSolanaChainId", { enumerable: true, get: function () { return solana_2.isSolanaChainId; } });
|
|
27
31
|
if (typeof window !== "undefined")
|
|
28
32
|
window.formofy = initialization_1.formofy;
|
|
29
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,24 +1,49 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SolanaManager
|
|
3
3
|
*
|
|
4
|
-
* Manages the lifecycle of the
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Manages the lifecycle of the Solana store integration.
|
|
5
|
+
* Subscribes to framework-kit's zustand store for automatic event capture
|
|
6
|
+
* of wallet connect/disconnect and transaction lifecycle events.
|
|
7
|
+
*
|
|
8
|
+
* For signMessage/signTransaction tracking (not captured by the store),
|
|
9
|
+
* use formo.signature() directly with the address and chainId.
|
|
10
|
+
*
|
|
11
|
+
* For manual event tracking without the store, use the core API directly:
|
|
12
|
+
* formo.transaction(), formo.signature(), formo.connect(), formo.disconnect().
|
|
7
13
|
*/
|
|
8
14
|
import { FormoAnalytics } from "../FormoAnalytics";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
15
|
+
import { SolanaCluster, SolanaOptions } from "./types";
|
|
16
|
+
import { SolanaClientStore } from "./storeTypes";
|
|
11
17
|
export declare class SolanaManager {
|
|
12
18
|
private formo;
|
|
13
|
-
private
|
|
14
|
-
private pendingConnection?;
|
|
19
|
+
private storeHandler?;
|
|
15
20
|
private pendingCluster?;
|
|
16
21
|
constructor(formo: FormoAnalytics, options?: SolanaOptions);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Set the framework-kit zustand store for automatic event tracking.
|
|
24
|
+
* This enables autocapture mode — connect/disconnect and transaction events
|
|
25
|
+
* are tracked automatically by subscribing to store state changes.
|
|
26
|
+
*
|
|
27
|
+
* @param store - The framework-kit client store (client.store)
|
|
28
|
+
* @param options - Optional configuration
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* import { createClient } from '@solana-foundation/framework-kit';
|
|
33
|
+
*
|
|
34
|
+
* const client = createClient({ endpoint: '...', walletConnectors: autoDiscover() });
|
|
35
|
+
* formo.solana.setStore(client.store);
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
setStore(store: SolanaClientStore, options?: {
|
|
39
|
+
cluster?: SolanaCluster;
|
|
40
|
+
}): void;
|
|
41
|
+
/**
|
|
42
|
+
* Update the cluster/network. Only needed if the store endpoint doesn't
|
|
43
|
+
* contain a recognizable cluster name (e.g. custom RPC URLs).
|
|
44
|
+
* In most cases, the cluster is auto-detected from the store's endpoint.
|
|
45
|
+
*/
|
|
20
46
|
setCluster(cluster: SolanaCluster): void;
|
|
21
|
-
syncWalletState(): void;
|
|
22
47
|
cleanup(): void;
|
|
23
48
|
}
|
|
24
49
|
//# sourceMappingURL=SolanaManager.d.ts.map
|
|
@@ -2,77 +2,75 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* SolanaManager
|
|
4
4
|
*
|
|
5
|
-
* Manages the lifecycle of the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Manages the lifecycle of the Solana store integration.
|
|
6
|
+
* Subscribes to framework-kit's zustand store for automatic event capture
|
|
7
|
+
* of wallet connect/disconnect and transaction lifecycle events.
|
|
8
|
+
*
|
|
9
|
+
* For signMessage/signTransaction tracking (not captured by the store),
|
|
10
|
+
* use formo.signature() directly with the address and chainId.
|
|
11
|
+
*
|
|
12
|
+
* For manual event tracking without the store, use the core API directly:
|
|
13
|
+
* formo.transaction(), formo.signature(), formo.connect(), formo.disconnect().
|
|
8
14
|
*/
|
|
9
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
16
|
exports.SolanaManager = void 0;
|
|
11
17
|
var logger_1 = require("../logger");
|
|
12
|
-
var
|
|
18
|
+
var SolanaStoreHandler_1 = require("./SolanaStoreHandler");
|
|
13
19
|
var SolanaManager = /** @class */ (function () {
|
|
14
20
|
function SolanaManager(formo, options) {
|
|
15
21
|
this.formo = formo;
|
|
16
|
-
if (options === null || options === void 0 ? void 0 : options.
|
|
17
|
-
logger_1.logger.info("SolanaManager: Initializing Solana
|
|
18
|
-
this.
|
|
19
|
-
wallet: options.wallet,
|
|
20
|
-
connection: options.connection,
|
|
22
|
+
if (options === null || options === void 0 ? void 0 : options.store) {
|
|
23
|
+
logger_1.logger.info("SolanaManager: Initializing store-based Solana tracking");
|
|
24
|
+
this.storeHandler = new SolanaStoreHandler_1.SolanaStoreHandler(formo, options.store, {
|
|
21
25
|
cluster: options.cluster,
|
|
22
26
|
});
|
|
23
27
|
}
|
|
24
|
-
else if (options) {
|
|
25
|
-
// Store pending
|
|
26
|
-
this.pendingConnection = options.connection;
|
|
28
|
+
else if (options === null || options === void 0 ? void 0 : options.cluster) {
|
|
29
|
+
// Store pending cluster for when setStore is called later
|
|
27
30
|
this.pendingCluster = options.cluster;
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (this.handler) {
|
|
54
|
-
this.handler.setConnection(connection);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
this.pendingConnection = connection !== null && connection !== void 0 ? connection : undefined;
|
|
58
|
-
}
|
|
33
|
+
/**
|
|
34
|
+
* Set the framework-kit zustand store for automatic event tracking.
|
|
35
|
+
* This enables autocapture mode — connect/disconnect and transaction events
|
|
36
|
+
* are tracked automatically by subscribing to store state changes.
|
|
37
|
+
*
|
|
38
|
+
* @param store - The framework-kit client store (client.store)
|
|
39
|
+
* @param options - Optional configuration
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* import { createClient } from '@solana-foundation/framework-kit';
|
|
44
|
+
*
|
|
45
|
+
* const client = createClient({ endpoint: '...', walletConnectors: autoDiscover() });
|
|
46
|
+
* formo.solana.setStore(client.store);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
SolanaManager.prototype.setStore = function (store, options) {
|
|
50
|
+
var _a;
|
|
51
|
+
(_a = this.storeHandler) === null || _a === void 0 ? void 0 : _a.cleanup();
|
|
52
|
+
this.storeHandler = new SolanaStoreHandler_1.SolanaStoreHandler(this.formo, store, {
|
|
53
|
+
cluster: (options === null || options === void 0 ? void 0 : options.cluster) || this.pendingCluster,
|
|
54
|
+
});
|
|
55
|
+
this.pendingCluster = undefined;
|
|
59
56
|
};
|
|
57
|
+
/**
|
|
58
|
+
* Update the cluster/network. Only needed if the store endpoint doesn't
|
|
59
|
+
* contain a recognizable cluster name (e.g. custom RPC URLs).
|
|
60
|
+
* In most cases, the cluster is auto-detected from the store's endpoint.
|
|
61
|
+
*/
|
|
60
62
|
SolanaManager.prototype.setCluster = function (cluster) {
|
|
61
|
-
if (this.
|
|
62
|
-
this.
|
|
63
|
+
if (this.storeHandler) {
|
|
64
|
+
this.storeHandler.setCluster(cluster);
|
|
63
65
|
}
|
|
64
66
|
else {
|
|
65
67
|
this.pendingCluster = cluster;
|
|
66
68
|
}
|
|
67
69
|
};
|
|
68
|
-
SolanaManager.prototype.syncWalletState = function () {
|
|
69
|
-
var _a;
|
|
70
|
-
(_a = this.handler) === null || _a === void 0 ? void 0 : _a.syncWalletState();
|
|
71
|
-
};
|
|
72
70
|
SolanaManager.prototype.cleanup = function () {
|
|
73
71
|
var _a;
|
|
74
|
-
(_a = this.
|
|
75
|
-
this.
|
|
72
|
+
(_a = this.storeHandler) === null || _a === void 0 ? void 0 : _a.cleanup();
|
|
73
|
+
this.storeHandler = undefined;
|
|
76
74
|
};
|
|
77
75
|
return SolanaManager;
|
|
78
76
|
}());
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SolanaStoreHandler
|
|
3
|
+
*
|
|
4
|
+
* Handles wallet event tracking by subscribing to framework-kit's zustand store.
|
|
5
|
+
* This provides automatic event capture (autocapture) for Solana wallets without
|
|
6
|
+
* wrapping any wallet methods — similar to how WagmiEventHandler subscribes to
|
|
7
|
+
* TanStack Query's mutation/query caches.
|
|
8
|
+
*
|
|
9
|
+
* Subscribes to:
|
|
10
|
+
* - `state.wallet` — connect/disconnect events
|
|
11
|
+
* - `state.transactions` — transaction lifecycle events (sending → confirmed/failed)
|
|
12
|
+
*
|
|
13
|
+
* @see https://github.com/solana-foundation/framework-kit
|
|
14
|
+
*/
|
|
15
|
+
import { FormoAnalytics } from "../FormoAnalytics";
|
|
16
|
+
import { SolanaClientStore } from "./storeTypes";
|
|
17
|
+
import { SolanaCluster } from "./types";
|
|
18
|
+
export declare class SolanaStoreHandler {
|
|
19
|
+
private formo;
|
|
20
|
+
private store;
|
|
21
|
+
private unsubscribers;
|
|
22
|
+
private cluster;
|
|
23
|
+
private chainId;
|
|
24
|
+
/**
|
|
25
|
+
* Track last known wallet status to detect transitions.
|
|
26
|
+
*/
|
|
27
|
+
private lastWalletStatus;
|
|
28
|
+
private lastAddress?;
|
|
29
|
+
private lastChainId?;
|
|
30
|
+
/**
|
|
31
|
+
* Track processed transaction state changes to prevent duplicate events.
|
|
32
|
+
* Key format: `${signature}:${status}`
|
|
33
|
+
*/
|
|
34
|
+
private processedTransactions;
|
|
35
|
+
/**
|
|
36
|
+
* Track transactions we've emitted STARTED for (status was "sending").
|
|
37
|
+
* Ensures we only emit STARTED once per transaction key.
|
|
38
|
+
*/
|
|
39
|
+
private startedTransactions;
|
|
40
|
+
/**
|
|
41
|
+
* Per-transaction sender address captured at STARTED time.
|
|
42
|
+
* Ensures terminal events (confirmed/failed) are attributed correctly
|
|
43
|
+
* even if the wallet disconnects before the transaction settles.
|
|
44
|
+
*/
|
|
45
|
+
private transactionSenders;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the cluster was explicitly set (via options or setCluster).
|
|
48
|
+
* When true, auto-detection from the store endpoint is disabled.
|
|
49
|
+
*/
|
|
50
|
+
private explicitCluster;
|
|
51
|
+
constructor(formoAnalytics: FormoAnalytics, store: SolanaClientStore, options?: {
|
|
52
|
+
cluster?: SolanaCluster;
|
|
53
|
+
});
|
|
54
|
+
/**
|
|
55
|
+
* Update the cluster/network.
|
|
56
|
+
*/
|
|
57
|
+
setCluster(cluster: SolanaCluster): void;
|
|
58
|
+
/**
|
|
59
|
+
* Get the current chain ID.
|
|
60
|
+
*/
|
|
61
|
+
getChainId(): number;
|
|
62
|
+
/**
|
|
63
|
+
* Resolve the current chainId from the live store state.
|
|
64
|
+
* This ensures correctness when wallet and cluster change in the same tick
|
|
65
|
+
* (the cluster subscription may not have fired yet).
|
|
66
|
+
*/
|
|
67
|
+
private resolveCurrentChainId;
|
|
68
|
+
private setupWalletSubscription;
|
|
69
|
+
private checkInitialWalletState;
|
|
70
|
+
private handleWalletChange;
|
|
71
|
+
private handleConnect;
|
|
72
|
+
private handleDisconnect;
|
|
73
|
+
private setupClusterSubscription;
|
|
74
|
+
private handleClusterChange;
|
|
75
|
+
private setupTransactionSubscription;
|
|
76
|
+
private handleTransactionChanges;
|
|
77
|
+
private handleTransactionStatusChange;
|
|
78
|
+
/**
|
|
79
|
+
* Attempt to detect the Solana cluster from the store's endpoint URL.
|
|
80
|
+
*/
|
|
81
|
+
private detectClusterFromStore;
|
|
82
|
+
/**
|
|
83
|
+
* Detect cluster from an RPC endpoint URL.
|
|
84
|
+
*/
|
|
85
|
+
private detectClusterFromEndpoint;
|
|
86
|
+
cleanup(): void;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=SolanaStoreHandler.d.ts.map
|