@ledgerhq/ledger-wallet-provider-core 2.0.0 → 2.0.2
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/api/blockchain-provider/model/types.d.ts +9 -0
- package/dist/api/blockchain-provider/model/types.d.ts.map +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/index.js +1057 -1029
- package/dist/internal/blockchain-provider/service/DefaultCoreFacadeService.d.ts.map +1 -1
- package/dist/internal/config/model/config.d.ts +7 -1
- package/dist/internal/config/model/config.d.ts.map +1 -1
- package/dist/internal/diTypes.d.ts +2 -1
- package/dist/internal/diTypes.d.ts.map +1 -1
- package/dist/internal/ledgersync/service/DefaultLedgerSyncService.d.ts +1 -0
- package/dist/internal/ledgersync/service/DefaultLedgerSyncService.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,26 +11,26 @@ import { webBleIdentifier as Le, webBleTransportFactory as Re } from "@ledgerhq/
|
|
|
11
11
|
import { webHidIdentifier as ze, webHidTransportFactory as Be } from "@ledgerhq/device-transport-kit-web-hid";
|
|
12
12
|
import { sha256 as Ve } from "ethers";
|
|
13
13
|
import He from "pako";
|
|
14
|
-
import
|
|
14
|
+
import b from "chalk";
|
|
15
15
|
//#region src/api/blockchain-provider/utils/createOpenAppConfig.ts
|
|
16
|
-
var
|
|
17
|
-
function
|
|
16
|
+
var Ue = /^(>=|<=|>|<|=|\^|~)/, We = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
17
|
+
function Ge(e) {
|
|
18
18
|
let t = e.trim();
|
|
19
19
|
if (t.length === 0) return;
|
|
20
|
-
let n = t.replace(
|
|
20
|
+
let n = t.replace(Ue, "").trim();
|
|
21
21
|
if (n === "latest") return "latest";
|
|
22
|
-
if (
|
|
22
|
+
if (We.test(n)) return n;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Ke({ name: e, minVersion: t }) {
|
|
25
25
|
if (!t) return { name: e };
|
|
26
|
-
let n =
|
|
26
|
+
let n = Ge(t);
|
|
27
27
|
return n ? {
|
|
28
28
|
name: e,
|
|
29
29
|
constraints: [{ minVersion: n }]
|
|
30
30
|
} : { name: e };
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
let { appName: t, dependencies: n } = e.appDependencies, r = n.map(
|
|
32
|
+
function qe(e) {
|
|
33
|
+
let { appName: t, dependencies: n } = e.appDependencies, r = n.map(Ke);
|
|
34
34
|
return {
|
|
35
35
|
application: r.find((e) => e.name === t) ?? { name: t },
|
|
36
36
|
dependencies: r,
|
|
@@ -39,7 +39,7 @@ function Je(e) {
|
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/api/errors/LedgerButtonError.ts
|
|
42
|
-
var
|
|
42
|
+
var x = class extends Error {
|
|
43
43
|
context;
|
|
44
44
|
timestamp;
|
|
45
45
|
constructor(e, t = "LedgerButtonError", n) {
|
|
@@ -57,59 +57,59 @@ var b = class extends Error {
|
|
|
57
57
|
stack: this.stack
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
},
|
|
60
|
+
}, Je = class extends x {
|
|
61
61
|
constructor(e, t) {
|
|
62
62
|
super(e, "DeviceNotSupportedError", t);
|
|
63
63
|
}
|
|
64
|
-
},
|
|
64
|
+
}, Ye = class extends x {
|
|
65
65
|
constructor(e, t) {
|
|
66
66
|
super(e, "DeviceNotOnboardedError", t);
|
|
67
67
|
}
|
|
68
|
-
},
|
|
68
|
+
}, Xe = class extends x {
|
|
69
69
|
constructor(e, t) {
|
|
70
70
|
super(e, "DeviceDisconnectedError", t);
|
|
71
71
|
}
|
|
72
|
-
},
|
|
72
|
+
}, Ze = class extends x {
|
|
73
73
|
constructor(e, t) {
|
|
74
74
|
super(e, "IncorrectSeedError", t);
|
|
75
75
|
}
|
|
76
|
-
},
|
|
76
|
+
}, Qe = class extends x {
|
|
77
77
|
constructor(e, t) {
|
|
78
78
|
super(e, "BlindSigningDisabledError", t);
|
|
79
79
|
}
|
|
80
|
-
},
|
|
80
|
+
}, $e = class extends x {
|
|
81
81
|
constructor(e, t) {
|
|
82
82
|
super(e, "UserRejectedTransactionError", t);
|
|
83
83
|
}
|
|
84
|
-
},
|
|
84
|
+
}, et = class extends x {
|
|
85
85
|
constructor(e, t) {
|
|
86
86
|
super(e, "DeviceOutOfMemoryError", t);
|
|
87
87
|
}
|
|
88
|
-
},
|
|
88
|
+
}, tt = class extends x {
|
|
89
89
|
constructor(e, t) {
|
|
90
90
|
super(e, "DeviceFirmwareOutdatedError", t);
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region src/api/blockchain-provider/utils/mapOpenAppDeviceActionError.ts
|
|
95
|
-
function
|
|
96
|
-
return e instanceof ee ? new
|
|
95
|
+
function nt(e, t) {
|
|
96
|
+
return e instanceof ee ? new et("Not enough memory on device to process the request", { appName: t }) : e instanceof te ? new tt("Device firmware is too old to install or update the required application", { appName: t }) : e;
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
99
|
//#region src/api/blockchain-provider/utils/normalizeDeviceError.ts
|
|
100
|
-
var
|
|
100
|
+
var rt = /* @__PURE__ */ new Set([
|
|
101
101
|
"DeviceDisconnectedWhileSendingError",
|
|
102
102
|
"DeviceDisconnectedBeforeSendingApdu",
|
|
103
103
|
"ReconnectionFailedError"
|
|
104
104
|
]);
|
|
105
|
-
function
|
|
106
|
-
if (e instanceof
|
|
105
|
+
function it(e) {
|
|
106
|
+
if (e instanceof Xe) return e;
|
|
107
107
|
let t = e?._tag;
|
|
108
|
-
return typeof t == "string" &&
|
|
108
|
+
return typeof t == "string" && rt.has(t) ? new Xe("Device disconnected during signing") : e;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function at(e) {
|
|
111
111
|
if (e.status !== "error") return e;
|
|
112
|
-
let t =
|
|
112
|
+
let t = it(e.error);
|
|
113
113
|
return t === e.error ? e : {
|
|
114
114
|
...e,
|
|
115
115
|
error: t
|
|
@@ -117,132 +117,132 @@ function ot(e) {
|
|
|
117
117
|
}
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region src/api/blockchain-provider/utils/waitForDeviceSession.ts
|
|
120
|
-
var
|
|
121
|
-
function
|
|
120
|
+
var ot = 200, st = 6e4;
|
|
121
|
+
function ct(e, t = ot, n = st) {
|
|
122
122
|
return we(0, t).pipe(l(() => e.getDeviceSession()), ue((e) => !!e.sessionId && e.isConnected), de(), Ce({
|
|
123
123
|
first: n,
|
|
124
|
-
with: () => Se(() => new
|
|
124
|
+
with: () => Se(() => new Xe("Timed out waiting for a connected device session"))
|
|
125
125
|
}));
|
|
126
126
|
}
|
|
127
127
|
//#endregion
|
|
128
128
|
//#region src/api/blockchain-provider/wallet-provider/ledgerProviderIcon.ts
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme:dark)").matches ?
|
|
129
|
+
var lt = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjAuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMTQ5LjA0IDEwNDkuNDciIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNGRkZGRkY7fQo8L3N0eWxlPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTkwLjA2LDY2OS4zNXYxOTAuMDZoMjg5LjIydi00Mi4xNEgyMzIuMjFWNjY5LjM1SDE5MC4wNnogTTkxNi44Myw2NjkuMzV2MTQ3LjkySDY2OS43NXY0Mi4xNGgyODkuMjJWNjY5LjM1CglIOTE2LjgzeiBNNDc5LjcsMzgwLjEydjI4OS4yMmgxOTAuMDV2LTM4LjAxSDUyMS44NFYzODAuMTJINDc5Ljd6IE0xOTAuMDYsMTkwLjA2djE5MC4wNmg0Mi4xNFYyMzIuMjFoMjQ3LjA4di00Mi4xNEgxOTAuMDZ6CgkgTTY2OS43NSwxOTAuMDZ2NDIuMTRoMjQ3LjA4djE0Ny45Mmg0Mi4xNFYxOTAuMDZINjY5Ljc1eiIvPgo8L3N2Zz4K", ut = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIzLjAuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMTQ5LjA0IDEwNDkuNDciIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiMwMDAwMDA7fQo8L3N0eWxlPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTkwLjA2LDY2OS4zNXYxOTAuMDZoMjg5LjIydi00Mi4xNEgyMzIuMjFWNjY5LjM1SDE5MC4wNnogTTkxNi44Myw2NjkuMzV2MTQ3LjkySDY2OS43NXY0Mi4xNGgyODkuMjJWNjY5LjM1CglIOTE2LjgzeiBNNDc5LjcsMzgwLjEydjI4OS4yMmgxOTAuMDV2LTM4LjAxSDUyMS44NFYzODAuMTJINDc5Ljd6IE0xOTAuMDYsMTkwLjA2djE5MC4wNmg0Mi4xNFYyMzIuMjFoMjQ3LjA4di00Mi4xNEgxOTAuMDZ6CgkgTTY2OS43NSwxOTAuMDZ2NDIuMTRoMjQ3LjA4djE0Ny45Mmg0Mi4xNFYxOTAuMDZINjY5Ljc1eiIvPgo8L3N2Zz4K";
|
|
130
|
+
function dt() {
|
|
131
|
+
return typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme:dark)").matches ? lt : ut;
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/api/errors/DeviceFlowErrors.ts
|
|
135
|
-
var
|
|
135
|
+
var ft = class extends x {
|
|
136
136
|
constructor(e, t) {
|
|
137
137
|
super(e, "DeviceConnectionError", t);
|
|
138
138
|
}
|
|
139
|
-
},
|
|
139
|
+
}, pt = class extends x {
|
|
140
140
|
constructor(e, t) {
|
|
141
141
|
super(e, "SignTransactionError", t);
|
|
142
142
|
}
|
|
143
|
-
},
|
|
143
|
+
}, mt = class extends x {
|
|
144
144
|
constructor(e, t) {
|
|
145
145
|
super(e, "AccountNotSelectedError", t);
|
|
146
146
|
}
|
|
147
|
-
},
|
|
147
|
+
}, ht = class extends x {
|
|
148
148
|
constructor(e, t) {
|
|
149
149
|
super(e, "FailToOpenAppError", t);
|
|
150
150
|
}
|
|
151
|
-
},
|
|
151
|
+
}, gt = class extends x {
|
|
152
152
|
constructor(e, t = { networks: [] }) {
|
|
153
153
|
super(e, "NoCompatibleAccountsError", t);
|
|
154
154
|
}
|
|
155
|
-
},
|
|
155
|
+
}, _t = class extends x {
|
|
156
156
|
constructor(e, t) {
|
|
157
157
|
super(e, "NoAccountInSyncError", t);
|
|
158
158
|
}
|
|
159
|
-
},
|
|
159
|
+
}, vt = class extends x {
|
|
160
160
|
constructor(e, t) {
|
|
161
161
|
super(e, "FailedToFetchEncryptedAccountsError", t);
|
|
162
162
|
}
|
|
163
|
-
},
|
|
163
|
+
}, yt = class extends x {
|
|
164
164
|
constructor(e = "No account selected in context") {
|
|
165
165
|
super(e, "NoSelectedAccountError");
|
|
166
166
|
}
|
|
167
|
-
},
|
|
167
|
+
}, bt = class extends x {
|
|
168
168
|
constructor(e, t) {
|
|
169
169
|
super(e, "AccountNotFoundError", t);
|
|
170
170
|
}
|
|
171
|
-
},
|
|
171
|
+
}, xt = class extends x {
|
|
172
172
|
constructor(e, t) {
|
|
173
173
|
super(e, "BroadcastTransactionError", t);
|
|
174
174
|
}
|
|
175
|
-
},
|
|
175
|
+
}, St = class extends x {
|
|
176
176
|
constructor(e, t) {
|
|
177
177
|
super(e, "NetworkError", t);
|
|
178
178
|
}
|
|
179
|
-
},
|
|
179
|
+
}, Ct = class extends x {
|
|
180
180
|
constructor(e, t) {
|
|
181
181
|
super(e, "ModalClosedError", t);
|
|
182
182
|
}
|
|
183
|
-
},
|
|
183
|
+
}, wt = class extends x {
|
|
184
184
|
constructor(e, t) {
|
|
185
185
|
super(e, "NoBlockchainProviderError", t);
|
|
186
186
|
}
|
|
187
|
-
},
|
|
187
|
+
}, Tt = class extends x {
|
|
188
188
|
constructor(e, t) {
|
|
189
189
|
super(e, "LedgerSyncError", t);
|
|
190
190
|
}
|
|
191
|
-
},
|
|
191
|
+
}, Et = class extends x {
|
|
192
192
|
constructor(e, t) {
|
|
193
193
|
super(e, "LedgerSyncAuthContextMissingError", t);
|
|
194
194
|
}
|
|
195
|
-
},
|
|
195
|
+
}, Dt = class extends x {
|
|
196
196
|
constructor(e, t) {
|
|
197
197
|
super(e, "LedgerSyncNoSessionIdError", t);
|
|
198
198
|
}
|
|
199
|
-
},
|
|
199
|
+
}, Ot = class extends x {
|
|
200
200
|
constructor(e, t) {
|
|
201
201
|
super(e, "LedgerSyncConnectionFailedError", t);
|
|
202
202
|
}
|
|
203
|
-
},
|
|
203
|
+
}, kt = class extends x {
|
|
204
204
|
constructor(e, t) {
|
|
205
205
|
super(e, "LedgerKeyringProtocolError", t);
|
|
206
206
|
}
|
|
207
|
-
},
|
|
207
|
+
}, At = class extends x {
|
|
208
208
|
constructor(e, t) {
|
|
209
209
|
super(e, "StorageIDBOpenError", t);
|
|
210
210
|
}
|
|
211
|
-
},
|
|
211
|
+
}, jt = class extends x {
|
|
212
212
|
constructor(e, t) {
|
|
213
213
|
super(e, "StorageIDBNotInitializedError", t);
|
|
214
214
|
}
|
|
215
|
-
},
|
|
215
|
+
}, S = class extends x {
|
|
216
216
|
constructor(e, t) {
|
|
217
217
|
super(e, "StorageIDBStoreError", t);
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, C = class extends x {
|
|
220
220
|
constructor(e, t) {
|
|
221
221
|
super(e, "StorageIDBGetError", t);
|
|
222
222
|
}
|
|
223
|
-
},
|
|
223
|
+
}, Mt = class extends x {
|
|
224
224
|
constructor(e, t) {
|
|
225
225
|
super(e, "StorageIDBRemoveError", t);
|
|
226
226
|
}
|
|
227
|
-
},
|
|
228
|
-
function
|
|
227
|
+
}, w = "ethereum";
|
|
228
|
+
function T(e, t = w) {
|
|
229
229
|
return e.selectedAccounts.get(t);
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function Nt(e) {
|
|
232
232
|
return Array.from(e.selectedAccounts.keys());
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
let t =
|
|
234
|
+
function Pt(e) {
|
|
235
|
+
let t = Ft(e);
|
|
236
236
|
return t ? e.selectedAccounts.get(t) : void 0;
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function Ft(e) {
|
|
239
239
|
if (e.activeFamily && e.selectedAccounts.has(e.activeFamily)) return e.activeFamily;
|
|
240
|
-
if (e.selectedAccounts.has("ethereum")) return
|
|
240
|
+
if (e.selectedAccounts.has("ethereum")) return w;
|
|
241
241
|
for (let t of e.selectedAccounts.keys()) return t;
|
|
242
242
|
}
|
|
243
243
|
//#endregion
|
|
244
244
|
//#region src/internal/account/di/accountModuleTypes.ts
|
|
245
|
-
var
|
|
245
|
+
var E = {
|
|
246
246
|
AccountService: Symbol.for("AccountService"),
|
|
247
247
|
BuildNetworksUseCase: Symbol.for("BuildNetworksUseCase"),
|
|
248
248
|
FindAccountForNetworkUseCase: Symbol.for("FindAccountForNetworkUseCase"),
|
|
@@ -259,15 +259,15 @@ var T = {
|
|
|
259
259
|
ObserveAccountsWithFiatUseCase: Symbol.for("ObserveAccountsWithFiatUseCase"),
|
|
260
260
|
ObserveNetworksForSelectedAddressUseCase: Symbol.for("ObserveNetworksForSelectedAddressUseCase"),
|
|
261
261
|
SortAccountsByFiatUseCase: Symbol.for("SortAccountsByFiatUseCase")
|
|
262
|
-
},
|
|
262
|
+
}, D = {
|
|
263
263
|
BalanceService: Symbol.for("BalanceService"),
|
|
264
264
|
CoinServiceDataSource: Symbol.for("CoinServiceDataSource"),
|
|
265
265
|
CalDataSource: Symbol.for("CalDataSource"),
|
|
266
266
|
CounterValueDataSource: Symbol.for("CounterValueDataSource")
|
|
267
|
-
},
|
|
267
|
+
}, O = {
|
|
268
268
|
BlockchainProviderManager: Symbol.for("BlockchainProviderManager"),
|
|
269
269
|
CoreFacadeService: Symbol.for("CoreFacadeService")
|
|
270
|
-
},
|
|
270
|
+
}, k = { Config: Symbol.for("Config") }, It = { ConsentService: Symbol.for("ConsentService") }, A = { ContextService: Symbol.for("ContextService") }, Lt = [
|
|
271
271
|
{
|
|
272
272
|
code: "USD",
|
|
273
273
|
name: "US Dollar"
|
|
@@ -280,14 +280,14 @@ var T = {
|
|
|
280
280
|
code: "GBP",
|
|
281
281
|
name: "Pound Sterling"
|
|
282
282
|
}
|
|
283
|
-
],
|
|
283
|
+
], j = {
|
|
284
284
|
CurrencyService: Symbol.for("CurrencyService"),
|
|
285
285
|
FiatCurrencyDataSource: Symbol.for("FiatCurrencyDataSource"),
|
|
286
286
|
ResolveCurrencyDecimalsUseCase: Symbol.for("ResolveCurrencyDecimalsUseCase")
|
|
287
|
-
},
|
|
287
|
+
}, Rt = {
|
|
288
288
|
DAppConfigDataSource: Symbol.for("DAppConfigDataSource"),
|
|
289
289
|
GetDAppConfigUseCase: Symbol.for("GetDAppConfigUseCase")
|
|
290
|
-
},
|
|
290
|
+
}, M = {
|
|
291
291
|
DeviceManagementKitService: Symbol.for("DeviceManagementKitService"),
|
|
292
292
|
DmkConfig: Symbol.for("DmkConfig"),
|
|
293
293
|
DmkLogLevel: Symbol.for("DmkLogLevel"),
|
|
@@ -295,10 +295,10 @@ var T = {
|
|
|
295
295
|
DisconnectDeviceUseCase: Symbol.for("DisconnectDeviceUseCase"),
|
|
296
296
|
SwitchDeviceUseCase: Symbol.for("SwitchDeviceUseCase"),
|
|
297
297
|
ListAvailableDevicesUseCase: Symbol.for("ListAvailableDevicesUseCase")
|
|
298
|
-
},
|
|
298
|
+
}, N = {
|
|
299
299
|
LoggerPublisher: Symbol.for("LoggerPublisher"),
|
|
300
300
|
LoggerSubscriber: Symbol.for("LoggerSubscriber")
|
|
301
|
-
},
|
|
301
|
+
}, P = {
|
|
302
302
|
StorageService: Symbol.for("StorageService"),
|
|
303
303
|
IndexedDbService: Symbol.for("IndexedDbService"),
|
|
304
304
|
MigrateDbUseCase: Symbol.for("MigrateDbUseCase"),
|
|
@@ -306,19 +306,19 @@ var T = {
|
|
|
306
306
|
};
|
|
307
307
|
//#endregion
|
|
308
308
|
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/decorateMetadata.js
|
|
309
|
-
function
|
|
309
|
+
function F(e, t) {
|
|
310
310
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
311
311
|
}
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/decorateParam.js
|
|
314
|
-
function
|
|
314
|
+
function I(e, t) {
|
|
315
315
|
return function(n, r) {
|
|
316
316
|
t(n, r, e);
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
319
|
//#endregion
|
|
320
320
|
//#region \0@oxc-project+runtime@0.148.0/helpers/esm/decorate.js
|
|
321
|
-
function
|
|
321
|
+
function L(e, t, n, r) {
|
|
322
322
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
323
323
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
324
324
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
@@ -326,7 +326,7 @@ function I(e, t, n, r) {
|
|
|
326
326
|
}
|
|
327
327
|
//#endregion
|
|
328
328
|
//#region src/internal/account/service/DefaultAccountService.ts
|
|
329
|
-
var
|
|
329
|
+
var zt = class {
|
|
330
330
|
loggerFactory;
|
|
331
331
|
storageService;
|
|
332
332
|
blockchainProviderManager;
|
|
@@ -365,29 +365,29 @@ var Bt = class {
|
|
|
365
365
|
tokens: []
|
|
366
366
|
} : void 0;
|
|
367
367
|
}).filter((e) => e !== void 0);
|
|
368
|
-
if (i.length === 0) throw new
|
|
368
|
+
if (i.length === 0) throw new gt("No accounts found", { networks: r.map((e) => e.currencyName) });
|
|
369
369
|
return i;
|
|
370
370
|
}
|
|
371
371
|
async getBalanceAndTokensForAccount(e, t) {
|
|
372
372
|
return this.hydrateAccountWithBalanceUseCase.execute(e, t);
|
|
373
373
|
}
|
|
374
374
|
};
|
|
375
|
-
|
|
375
|
+
zt = L([
|
|
376
376
|
v(),
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
377
|
+
I(0, _(N.LoggerPublisher)),
|
|
378
|
+
I(1, _(P.StorageService)),
|
|
379
|
+
I(2, _(O.BlockchainProviderManager)),
|
|
380
|
+
I(3, _(E.HydrateAccountWithBalanceUseCase)),
|
|
381
|
+
F("design:paramtypes", [
|
|
382
382
|
Object,
|
|
383
383
|
Object,
|
|
384
384
|
Object,
|
|
385
385
|
Object
|
|
386
386
|
])
|
|
387
|
-
],
|
|
387
|
+
], zt);
|
|
388
388
|
//#endregion
|
|
389
389
|
//#region src/internal/account/use-case/buildNetworksUseCase.ts
|
|
390
|
-
var
|
|
390
|
+
var Bt = class {
|
|
391
391
|
calDataSource;
|
|
392
392
|
currencyInformationCache = /* @__PURE__ */ new Map();
|
|
393
393
|
constructor(e) {
|
|
@@ -430,19 +430,19 @@ var Vt = class {
|
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
432
|
};
|
|
433
|
-
|
|
433
|
+
Bt = L([
|
|
434
434
|
v(),
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
],
|
|
435
|
+
I(0, _(D.CalDataSource)),
|
|
436
|
+
F("design:paramtypes", [Object])
|
|
437
|
+
], Bt);
|
|
438
438
|
//#endregion
|
|
439
439
|
//#region src/api/utils/base64Utils.ts
|
|
440
|
-
function
|
|
440
|
+
function Vt(e) {
|
|
441
441
|
return Uint8Array.from(atob(e), (e) => e.charCodeAt(0));
|
|
442
442
|
}
|
|
443
443
|
//#endregion
|
|
444
444
|
//#region src/internal/cloudsync/di/cloudSyncModuleTypes.ts
|
|
445
|
-
var
|
|
445
|
+
var Ht = { CloudSyncService: Symbol.for("CloudSyncService") }, Ut = { LedgerSyncService: Symbol.for("LedgerSyncService") }, Wt = class {
|
|
446
446
|
ledgerSyncService;
|
|
447
447
|
cloudSyncService;
|
|
448
448
|
logger;
|
|
@@ -457,7 +457,7 @@ var Ut = { CloudSyncService: Symbol.for("CloudSyncService") }, Wt = { LedgerSync
|
|
|
457
457
|
getAuthContextOrThrow() {
|
|
458
458
|
let e = this.ledgerSyncService.authContext;
|
|
459
459
|
if (!e) {
|
|
460
|
-
let e = new
|
|
460
|
+
let e = new Et("No auth context available");
|
|
461
461
|
throw this.logger.error("Missing auth context for fetching accounts", { error: e }), e;
|
|
462
462
|
}
|
|
463
463
|
return e;
|
|
@@ -466,24 +466,24 @@ var Ut = { CloudSyncService: Symbol.for("CloudSyncService") }, Wt = { LedgerSync
|
|
|
466
466
|
await me(this.ledgerSyncService.authenticate());
|
|
467
467
|
}
|
|
468
468
|
async fetchAndDecryptAccounts(e) {
|
|
469
|
-
let t =
|
|
469
|
+
let t = Vt((await this.cloudSyncService.fetchEncryptedAccounts(e)).payload), n = await this.ledgerSyncService.decrypt(t);
|
|
470
470
|
return JSON.parse(new TextDecoder().decode(n));
|
|
471
471
|
}
|
|
472
472
|
};
|
|
473
|
-
|
|
473
|
+
Wt = L([
|
|
474
474
|
v(),
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
475
|
+
I(0, _(N.LoggerPublisher)),
|
|
476
|
+
I(1, _(Ut.LedgerSyncService)),
|
|
477
|
+
I(2, _(Ht.CloudSyncService)),
|
|
478
|
+
F("design:paramtypes", [
|
|
479
479
|
Object,
|
|
480
480
|
Object,
|
|
481
481
|
Object
|
|
482
482
|
])
|
|
483
|
-
],
|
|
483
|
+
], Wt);
|
|
484
484
|
//#endregion
|
|
485
485
|
//#region src/internal/account/use-case/fetchAccountsUseCase.ts
|
|
486
|
-
var
|
|
486
|
+
var Gt = class {
|
|
487
487
|
fetchCloudSyncAccountsUseCase;
|
|
488
488
|
accountService;
|
|
489
489
|
constructor(e, t) {
|
|
@@ -494,15 +494,15 @@ var Kt = class {
|
|
|
494
494
|
return await this.accountService.setAccountsFromCloudSyncData(e), this.accountService.getAccounts();
|
|
495
495
|
}
|
|
496
496
|
};
|
|
497
|
-
|
|
497
|
+
Gt = L([
|
|
498
498
|
v(),
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
],
|
|
499
|
+
I(0, _(E.FetchCloudSyncAccountsUseCase)),
|
|
500
|
+
I(1, _(E.AccountService)),
|
|
501
|
+
F("design:paramtypes", [Wt === void 0 ? Object : Wt, Object])
|
|
502
|
+
], Gt);
|
|
503
503
|
//#endregion
|
|
504
504
|
//#region src/internal/account/use-case/filterAccountsByFamilyUseCase.ts
|
|
505
|
-
var
|
|
505
|
+
var Kt = class {
|
|
506
506
|
blockchainProviderManager;
|
|
507
507
|
constructor(e) {
|
|
508
508
|
this.blockchainProviderManager = e;
|
|
@@ -514,14 +514,14 @@ var qt = class {
|
|
|
514
514
|
return this.blockchainProviderManager.describeCurrency(e).map((e) => e.family === t).orDefault(!1);
|
|
515
515
|
}
|
|
516
516
|
};
|
|
517
|
-
|
|
517
|
+
Kt = L([
|
|
518
518
|
v(),
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
],
|
|
519
|
+
I(0, _(O.BlockchainProviderManager)),
|
|
520
|
+
F("design:paramtypes", [Object])
|
|
521
|
+
], Kt);
|
|
522
522
|
//#endregion
|
|
523
523
|
//#region src/internal/currency/currencyUtils.ts
|
|
524
|
-
function
|
|
524
|
+
function qt(e, t, n, r = {}) {
|
|
525
525
|
let i = {
|
|
526
526
|
name: n,
|
|
527
527
|
code: n,
|
|
@@ -531,7 +531,7 @@ function Jt(e, t, n, r = {}) {
|
|
|
531
531
|
}
|
|
532
532
|
//#endregion
|
|
533
533
|
//#region src/internal/account/use-case/HydrateAccountWithBalanceUseCase.ts
|
|
534
|
-
var
|
|
534
|
+
var Jt = class {
|
|
535
535
|
balanceService;
|
|
536
536
|
resolveCurrencyDecimals;
|
|
537
537
|
logger;
|
|
@@ -547,7 +547,7 @@ var Yt = class {
|
|
|
547
547
|
return n.isRight() ? this.formatSuccessfulBalanceResult(e, n.extract()) : this.handleBalanceServiceFailure(e, n.extract());
|
|
548
548
|
}
|
|
549
549
|
async formatSuccessfulBalanceResult(e, t) {
|
|
550
|
-
let n = await this.resolveDecimals(e.currencyId), r =
|
|
550
|
+
let n = await this.resolveDecimals(e.currencyId), r = qt(t.nativeBalance.balance, n, e.ticker), i = this.mapTokenBalances(t.tokenBalances);
|
|
551
551
|
return this.logger.debug("Successfully hydrated account with balance and tokens", {
|
|
552
552
|
address: e.freshAddress,
|
|
553
553
|
balance: r,
|
|
@@ -583,20 +583,20 @@ var Yt = class {
|
|
|
583
583
|
}));
|
|
584
584
|
}
|
|
585
585
|
};
|
|
586
|
-
|
|
586
|
+
Jt = L([
|
|
587
587
|
v(),
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
588
|
+
I(0, _(N.LoggerPublisher)),
|
|
589
|
+
I(1, _(D.BalanceService)),
|
|
590
|
+
I(2, _(j.ResolveCurrencyDecimalsUseCase)),
|
|
591
|
+
F("design:paramtypes", [
|
|
592
592
|
Object,
|
|
593
593
|
Object,
|
|
594
594
|
Object
|
|
595
595
|
])
|
|
596
|
-
],
|
|
596
|
+
], Jt);
|
|
597
597
|
//#endregion
|
|
598
598
|
//#region src/internal/account/use-case/fetchAccountsWithBalanceUseCase.ts
|
|
599
|
-
var
|
|
599
|
+
var Yt = class {
|
|
600
600
|
accountService;
|
|
601
601
|
fetchAccountsUseCase;
|
|
602
602
|
hydrateAccountWithBalanceUseCase;
|
|
@@ -642,40 +642,40 @@ var Xt = class {
|
|
|
642
642
|
return e;
|
|
643
643
|
}
|
|
644
644
|
};
|
|
645
|
-
|
|
645
|
+
Yt = L([
|
|
646
646
|
v(),
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
647
|
+
I(0, _(N.LoggerPublisher)),
|
|
648
|
+
I(1, _(E.AccountService)),
|
|
649
|
+
I(2, _(E.FetchAccountsUseCase)),
|
|
650
|
+
I(3, _(E.HydrateAccountWithBalanceUseCase)),
|
|
651
|
+
I(4, _(E.FilterAccountsByFamilyUseCase)),
|
|
652
|
+
F("design:paramtypes", [
|
|
653
653
|
Object,
|
|
654
654
|
Object,
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
655
|
+
Gt === void 0 ? Object : Gt,
|
|
656
|
+
Jt === void 0 ? Object : Jt,
|
|
657
|
+
Kt === void 0 ? Object : Kt
|
|
658
658
|
])
|
|
659
|
-
],
|
|
659
|
+
], Yt);
|
|
660
660
|
//#endregion
|
|
661
661
|
//#region src/internal/account/accountFiatUtils.ts
|
|
662
|
-
var
|
|
663
|
-
function
|
|
662
|
+
var Xt = .01;
|
|
663
|
+
function R(e) {
|
|
664
664
|
return {
|
|
665
665
|
...e,
|
|
666
666
|
fiatBalance: e.fiatBalance,
|
|
667
667
|
fiatError: e.fiatError ?? !1,
|
|
668
|
-
balanceLoadingState:
|
|
669
|
-
fiatLoadingState:
|
|
668
|
+
balanceLoadingState: Zt(e),
|
|
669
|
+
fiatLoadingState: Qt(e)
|
|
670
670
|
};
|
|
671
671
|
}
|
|
672
|
-
function
|
|
672
|
+
function Zt(e) {
|
|
673
673
|
return e.balanceError ? "error" : e.balance === void 0 ? "loading" : "loaded";
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Qt(e) {
|
|
676
676
|
return e.balanceError ? "loaded" : e.fiatError ? "error" : e.fiatBalance === void 0 ? "loading" : "loaded";
|
|
677
677
|
}
|
|
678
|
-
function
|
|
678
|
+
function $t(e) {
|
|
679
679
|
let t = (e.fiatBalance?.value ? parseFloat(e.fiatBalance.value) : 0) + e.tokens.reduce((e, t) => e + (t.fiatBalance?.value ? parseFloat(t.fiatBalance.value) : 0), 0);
|
|
680
680
|
if (t === 0 && !e.fiatBalance) return;
|
|
681
681
|
let n = e.fiatBalance?.currency ?? "USD";
|
|
@@ -684,8 +684,8 @@ function en(e) {
|
|
|
684
684
|
currency: n
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
function
|
|
688
|
-
return parseFloat(e.fiatBalance?.value ?? "0") <=
|
|
687
|
+
function en(e) {
|
|
688
|
+
return parseFloat(e.fiatBalance?.value ?? "0") <= Xt ? e.tokens : [{
|
|
689
689
|
ledgerId: e.currencyId,
|
|
690
690
|
ticker: e.ticker,
|
|
691
691
|
name: e.ticker,
|
|
@@ -693,18 +693,18 @@ function tn(e) {
|
|
|
693
693
|
fiatBalance: e.fiatBalance
|
|
694
694
|
}, ...e.tokens];
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function tn(e, t) {
|
|
697
697
|
let n = t.toLowerCase().trim();
|
|
698
698
|
return !n || e.name.toLowerCase().includes(n) || e.freshAddress.toLowerCase().includes(n) || e.ticker.toLowerCase().includes(n) || e.tokens.some((e) => e.ticker.toLowerCase().includes(n) || e.name.toLowerCase().includes(n));
|
|
699
699
|
}
|
|
700
|
-
function
|
|
700
|
+
function nn(e) {
|
|
701
701
|
return {
|
|
702
702
|
...e,
|
|
703
|
-
totalFiatValue:
|
|
704
|
-
displayTokens:
|
|
703
|
+
totalFiatValue: $t(e),
|
|
704
|
+
displayTokens: en(e)
|
|
705
705
|
};
|
|
706
706
|
}
|
|
707
|
-
function
|
|
707
|
+
function rn(e) {
|
|
708
708
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
709
709
|
for (let r of e) {
|
|
710
710
|
let e = t.get(r.freshAddress) ?? [];
|
|
@@ -714,11 +714,11 @@ function an(e) {
|
|
|
714
714
|
}
|
|
715
715
|
return Array.from(t.entries()).sort(([e], [t]) => (n.get(t) ?? 0) - (n.get(e) ?? 0)).map(([e, t]) => ({
|
|
716
716
|
freshAddress: e,
|
|
717
|
-
totalFiatValue:
|
|
717
|
+
totalFiatValue: an(t, n.get(e) ?? 0),
|
|
718
718
|
accounts: t
|
|
719
719
|
}));
|
|
720
720
|
}
|
|
721
|
-
function
|
|
721
|
+
function an(e, t) {
|
|
722
722
|
let n = e.find((e) => e.totalFiatValue)?.totalFiatValue?.currency;
|
|
723
723
|
if (n) return {
|
|
724
724
|
value: t.toFixed(2),
|
|
@@ -727,7 +727,7 @@ function on(e, t) {
|
|
|
727
727
|
}
|
|
728
728
|
//#endregion
|
|
729
729
|
//#region src/internal/account/use-case/hydrateAccountWithFiatUseCase.ts
|
|
730
|
-
var
|
|
730
|
+
var on = class {
|
|
731
731
|
counterValueDataSource;
|
|
732
732
|
contextService;
|
|
733
733
|
logger;
|
|
@@ -736,13 +736,13 @@ var sn = class {
|
|
|
736
736
|
}
|
|
737
737
|
async execute(e) {
|
|
738
738
|
let t = this.contextService.getContext().preferredFiatCurrency;
|
|
739
|
-
if (this.logHydrationStart(e), e.balanceError) return
|
|
739
|
+
if (this.logHydrationStart(e), e.balanceError) return R({
|
|
740
740
|
...e,
|
|
741
741
|
fiatBalance: void 0,
|
|
742
742
|
fiatError: !1
|
|
743
743
|
});
|
|
744
744
|
let n = e.balance ?? "0", r = this.parseBalance(n);
|
|
745
|
-
return (Number.isNaN(r) || r === 0) && e.tokens.length === 0 ?
|
|
745
|
+
return (Number.isNaN(r) || r === 0) && e.tokens.length === 0 ? R({
|
|
746
746
|
...e,
|
|
747
747
|
fiatBalance: {
|
|
748
748
|
value: "0.00",
|
|
@@ -750,14 +750,14 @@ var sn = class {
|
|
|
750
750
|
},
|
|
751
751
|
fiatError: !1
|
|
752
752
|
}) : (await this.fetchCounterValues(e, t)).caseOf({
|
|
753
|
-
Left: (t) => (this.logger.warn("Failed to fetch counter values", { error: t }),
|
|
753
|
+
Left: (t) => (this.logger.warn("Failed to fetch counter values", { error: t }), R({
|
|
754
754
|
...e,
|
|
755
755
|
fiatBalance: void 0,
|
|
756
756
|
fiatError: !0
|
|
757
757
|
})),
|
|
758
758
|
Right: (r) => {
|
|
759
759
|
let i = this.calculateAccountFiat(n, r[0]?.rate, t), a = this.hydrateTokensWithFiat(e.tokens, r.slice(1), t);
|
|
760
|
-
return this.logHydrationSuccess(i, a, t),
|
|
760
|
+
return this.logHydrationSuccess(i, a, t), R({
|
|
761
761
|
...e,
|
|
762
762
|
fiatBalance: i,
|
|
763
763
|
fiatError: !1,
|
|
@@ -821,20 +821,20 @@ var sn = class {
|
|
|
821
821
|
return parseFloat(e.replace(/,/g, ""));
|
|
822
822
|
}
|
|
823
823
|
};
|
|
824
|
-
|
|
824
|
+
on = L([
|
|
825
825
|
v(),
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
826
|
+
I(0, _(N.LoggerPublisher)),
|
|
827
|
+
I(1, _(D.CounterValueDataSource)),
|
|
828
|
+
I(2, _(A.ContextService)),
|
|
829
|
+
F("design:paramtypes", [
|
|
830
830
|
Object,
|
|
831
831
|
Object,
|
|
832
832
|
Object
|
|
833
833
|
])
|
|
834
|
-
],
|
|
834
|
+
], on);
|
|
835
835
|
//#endregion
|
|
836
836
|
//#region src/internal/account/use-case/fetchAccountsWithFiatUseCase.ts
|
|
837
|
-
var
|
|
837
|
+
var sn = class {
|
|
838
838
|
hydrateAccountWithFiatUseCase;
|
|
839
839
|
contextService;
|
|
840
840
|
logger;
|
|
@@ -849,7 +849,7 @@ var cn = class {
|
|
|
849
849
|
return he(...n).pipe(_e((e, t) => this.mergeAccountUpdate(e, t), t), ye(t));
|
|
850
850
|
}
|
|
851
851
|
initializeAccountsWithoutFiat(e) {
|
|
852
|
-
return e.map((e) =>
|
|
852
|
+
return e.map((e) => R({
|
|
853
853
|
...e,
|
|
854
854
|
fiatBalance: void 0,
|
|
855
855
|
fiatError: !1
|
|
@@ -859,7 +859,7 @@ var cn = class {
|
|
|
859
859
|
return pe(this.hydrateAccountWithFiatUseCase.execute(e)).pipe(oe((t) => (this.logger.warn("Failed to fetch fiat value for account, keeping original", {
|
|
860
860
|
accountId: e.id,
|
|
861
861
|
error: t
|
|
862
|
-
}), u(
|
|
862
|
+
}), u(R({
|
|
863
863
|
...e,
|
|
864
864
|
fiatBalance: void 0,
|
|
865
865
|
fiatError: !0
|
|
@@ -872,25 +872,25 @@ var cn = class {
|
|
|
872
872
|
let n = e.findIndex((e) => e.id === t.accountId);
|
|
873
873
|
if (n !== -1) {
|
|
874
874
|
let r = [...e];
|
|
875
|
-
return r[n] =
|
|
875
|
+
return r[n] = R(t.account), r;
|
|
876
876
|
}
|
|
877
877
|
return e;
|
|
878
878
|
}
|
|
879
879
|
};
|
|
880
|
-
|
|
880
|
+
sn = L([
|
|
881
881
|
v(),
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
882
|
+
I(0, _(N.LoggerPublisher)),
|
|
883
|
+
I(1, _(E.HydrateAccountWithFiatUseCase)),
|
|
884
|
+
I(2, _(A.ContextService)),
|
|
885
|
+
F("design:paramtypes", [
|
|
886
886
|
Object,
|
|
887
|
-
|
|
887
|
+
on === void 0 ? Object : on,
|
|
888
888
|
Object
|
|
889
889
|
])
|
|
890
|
-
],
|
|
890
|
+
], sn);
|
|
891
891
|
//#endregion
|
|
892
892
|
//#region src/internal/account/use-case/fetchSelectedAccountUseCase.ts
|
|
893
|
-
var
|
|
893
|
+
var cn = class {
|
|
894
894
|
contextService;
|
|
895
895
|
ledgerSyncService;
|
|
896
896
|
fetchAccountsUseCase;
|
|
@@ -902,7 +902,7 @@ var ln = class {
|
|
|
902
902
|
constructor(e, t, n, r, i, a, o, s) {
|
|
903
903
|
this.contextService = t, this.ledgerSyncService = n, this.fetchAccountsUseCase = r, this.hydrateWithBalanceUseCase = i, this.hydrateWithFiatUseCase = a, this.hydrateWithTxHistoryUseCase = o, this.buildNetworksUseCase = s, this.logger = e("FetchSelectedAccountUseCase");
|
|
904
904
|
}
|
|
905
|
-
async execute(e =
|
|
905
|
+
async execute(e = w) {
|
|
906
906
|
let t = await this.getSelectedAccountFromContext(e);
|
|
907
907
|
if (t.isLeft()) return t;
|
|
908
908
|
let { selected: n, allAccounts: r } = t.unsafeCoerce(), i = await this.hydrateDetailedAccount(n, r);
|
|
@@ -917,14 +917,14 @@ var ln = class {
|
|
|
917
917
|
}), h(i);
|
|
918
918
|
}
|
|
919
919
|
async getSelectedAccountFromContext(e) {
|
|
920
|
-
let t =
|
|
921
|
-
if (!t) return f(new
|
|
920
|
+
let t = T(this.contextService.getContext(), e);
|
|
921
|
+
if (!t) return f(new yt());
|
|
922
922
|
await me(this.ledgerSyncService.authenticate());
|
|
923
923
|
let n = await this.fetchAccountsUseCase.execute(), r = n.find((e) => e.freshAddress === t.freshAddress && e.currencyId === t.currencyId);
|
|
924
924
|
return r ? h({
|
|
925
925
|
selected: r,
|
|
926
926
|
allAccounts: n
|
|
927
|
-
}) : (this.logger.error("Selected account not found in Ledger Sync accounts", { address: t.freshAddress }), f(new
|
|
927
|
+
}) : (this.logger.error("Selected account not found in Ledger Sync accounts", { address: t.freshAddress }), f(new bt("Selected account not found in Ledger Sync accounts", { address: t.freshAddress })));
|
|
928
928
|
}
|
|
929
929
|
async hydrateDetailedAccount(e, t) {
|
|
930
930
|
let n = await this.hydrateWithBalanceUseCase.execute(e), [r, i, a] = await Promise.all([
|
|
@@ -939,7 +939,7 @@ var ln = class {
|
|
|
939
939
|
return this.buildNetworksUseCase.execute(r);
|
|
940
940
|
}
|
|
941
941
|
mergeHydrations(e, t, n, r) {
|
|
942
|
-
let i =
|
|
942
|
+
let i = $t(t);
|
|
943
943
|
return {
|
|
944
944
|
...e,
|
|
945
945
|
fiatBalance: t.fiatBalance,
|
|
@@ -951,17 +951,17 @@ var ln = class {
|
|
|
951
951
|
};
|
|
952
952
|
}
|
|
953
953
|
};
|
|
954
|
-
|
|
954
|
+
cn = L([
|
|
955
955
|
v(),
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
956
|
+
I(0, _(N.LoggerPublisher)),
|
|
957
|
+
I(1, _(A.ContextService)),
|
|
958
|
+
I(2, _(Ut.LedgerSyncService)),
|
|
959
|
+
I(3, _(E.FetchAccountsUseCase)),
|
|
960
|
+
I(4, _(E.HydrateAccountWithBalanceUseCase)),
|
|
961
|
+
I(5, _(E.HydrateAccountWithFiatUseCase)),
|
|
962
|
+
I(6, _(E.HydrateAccountWithTxHistoryUseCase)),
|
|
963
|
+
I(7, _(E.BuildNetworksUseCase)),
|
|
964
|
+
F("design:paramtypes", [
|
|
965
965
|
Object,
|
|
966
966
|
Object,
|
|
967
967
|
Object,
|
|
@@ -971,33 +971,33 @@ ln = I([
|
|
|
971
971
|
Object,
|
|
972
972
|
Object
|
|
973
973
|
])
|
|
974
|
-
],
|
|
974
|
+
], cn);
|
|
975
975
|
//#endregion
|
|
976
976
|
//#region src/internal/account/use-case/findAccountForNetworkUseCase.ts
|
|
977
|
-
var
|
|
977
|
+
var ln = class {
|
|
978
978
|
contextService;
|
|
979
979
|
accountService;
|
|
980
980
|
constructor(e, t) {
|
|
981
981
|
this.contextService = e, this.accountService = t;
|
|
982
982
|
}
|
|
983
983
|
execute(e) {
|
|
984
|
-
let t =
|
|
984
|
+
let t = Pt(this.contextService.getContext())?.freshAddress;
|
|
985
985
|
return t ? p.fromNullable(this.accountService.getAccounts().find((n) => n.freshAddress === t && n.currencyId === e)) : p.empty();
|
|
986
986
|
}
|
|
987
987
|
};
|
|
988
|
-
|
|
988
|
+
ln = L([
|
|
989
989
|
v(),
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
],
|
|
990
|
+
I(0, _(A.ContextService)),
|
|
991
|
+
I(1, _(E.AccountService)),
|
|
992
|
+
F("design:paramtypes", [Object, Object])
|
|
993
|
+
], ln);
|
|
994
994
|
//#endregion
|
|
995
995
|
//#region src/internal/transaction-history/di/transactionHistoryModuleTypes.ts
|
|
996
|
-
var
|
|
996
|
+
var z = {
|
|
997
997
|
TransactionHistoryDataSource: Symbol.for("TransactionHistoryDataSource"),
|
|
998
998
|
FetchTransactionHistoryUseCase: Symbol.for("FetchTransactionHistoryUseCase"),
|
|
999
999
|
HydrateTransactionsWithFiatUseCase: Symbol.for("HydrateTransactionsWithFiatUseCase")
|
|
1000
|
-
},
|
|
1000
|
+
}, un = class {
|
|
1001
1001
|
fetchTransactionHistoryUseCase;
|
|
1002
1002
|
hydrateTransactionsWithFiatUseCase;
|
|
1003
1003
|
contextService;
|
|
@@ -1033,22 +1033,22 @@ var R = {
|
|
|
1033
1033
|
});
|
|
1034
1034
|
}
|
|
1035
1035
|
};
|
|
1036
|
-
|
|
1036
|
+
un = L([
|
|
1037
1037
|
v(),
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1038
|
+
I(0, _(N.LoggerPublisher)),
|
|
1039
|
+
I(1, _(z.FetchTransactionHistoryUseCase)),
|
|
1040
|
+
I(2, _(z.HydrateTransactionsWithFiatUseCase)),
|
|
1041
|
+
I(3, _(A.ContextService)),
|
|
1042
|
+
F("design:paramtypes", [
|
|
1043
1043
|
Object,
|
|
1044
1044
|
Object,
|
|
1045
1045
|
Object,
|
|
1046
1046
|
Object
|
|
1047
1047
|
])
|
|
1048
|
-
],
|
|
1048
|
+
], un);
|
|
1049
1049
|
//#endregion
|
|
1050
1050
|
//#region src/internal/account/use-case/sortAccountsByFiatUseCase.ts
|
|
1051
|
-
var
|
|
1051
|
+
var dn = class {
|
|
1052
1052
|
execute(e) {
|
|
1053
1053
|
return e.pipe(l((e) => this.sortByFiat(e)));
|
|
1054
1054
|
}
|
|
@@ -1063,12 +1063,12 @@ var fn = class {
|
|
|
1063
1063
|
});
|
|
1064
1064
|
}
|
|
1065
1065
|
};
|
|
1066
|
-
|
|
1066
|
+
dn = L([v()], dn);
|
|
1067
1067
|
//#endregion
|
|
1068
1068
|
//#region src/internal/account/use-case/observeAccountsWithFiatUseCase.ts
|
|
1069
|
-
var
|
|
1069
|
+
var fn, B = class {
|
|
1070
1070
|
static {
|
|
1071
|
-
|
|
1071
|
+
fn = this;
|
|
1072
1072
|
}
|
|
1073
1073
|
fetchAccountsWithBalanceUseCase;
|
|
1074
1074
|
fetchAccountsWithFiatUseCase;
|
|
@@ -1091,28 +1091,28 @@ var pn, z = class {
|
|
|
1091
1091
|
return this.streamsByFamily.set(t, r), r;
|
|
1092
1092
|
}
|
|
1093
1093
|
cacheKey(e) {
|
|
1094
|
-
return e ??
|
|
1094
|
+
return e ?? fn.ALL_FAMILIES_KEY;
|
|
1095
1095
|
}
|
|
1096
1096
|
buildPipeline(e) {
|
|
1097
1097
|
return this.sortAccountsByFiatUseCase.execute(this.fetchAccountsWithBalanceUseCase.execute(e).pipe(be((e) => this.fetchAccountsWithFiatUseCase.execute(e))));
|
|
1098
1098
|
}
|
|
1099
1099
|
};
|
|
1100
|
-
|
|
1100
|
+
B = fn = L([
|
|
1101
1101
|
v(),
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1102
|
+
I(0, _(N.LoggerPublisher)),
|
|
1103
|
+
I(1, _(E.FetchAccountsWithBalanceUseCase)),
|
|
1104
|
+
I(2, _(E.FetchAccountsWithFiatUseCase)),
|
|
1105
|
+
I(3, _(E.SortAccountsByFiatUseCase)),
|
|
1106
|
+
F("design:paramtypes", [
|
|
1107
1107
|
Object,
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1108
|
+
Yt === void 0 ? Object : Yt,
|
|
1109
|
+
sn === void 0 ? Object : sn,
|
|
1110
|
+
dn === void 0 ? Object : dn
|
|
1111
1111
|
])
|
|
1112
|
-
],
|
|
1112
|
+
], B);
|
|
1113
1113
|
//#endregion
|
|
1114
1114
|
//#region src/internal/account/use-case/observeAccountGroupsUseCase.ts
|
|
1115
|
-
var
|
|
1115
|
+
var pn = 200, mn = class {
|
|
1116
1116
|
observeAccountsWithFiatUseCase;
|
|
1117
1117
|
logger;
|
|
1118
1118
|
constructor(e, t) {
|
|
@@ -1127,22 +1127,22 @@ var mn = 200, hn = class {
|
|
|
1127
1127
|
forceRefresh: e?.forceRefresh,
|
|
1128
1128
|
family: e?.family
|
|
1129
1129
|
});
|
|
1130
|
-
return se([t.pipe(ce(this.throttleAfterFirstEmission())), e?.searchQuery$ ?? u("")]).pipe(l(([e, t]) =>
|
|
1130
|
+
return se([t.pipe(ce(this.throttleAfterFirstEmission())), e?.searchQuery$ ?? u("")]).pipe(l(([e, t]) => rn(e.filter((e) => tn(e, t)).map(nn))));
|
|
1131
1131
|
}
|
|
1132
1132
|
throttleAfterFirstEmission() {
|
|
1133
1133
|
let e = !0;
|
|
1134
|
-
return () => e ? (e = !1, u(0)) : we(
|
|
1134
|
+
return () => e ? (e = !1, u(0)) : we(pn);
|
|
1135
1135
|
}
|
|
1136
1136
|
};
|
|
1137
|
-
|
|
1137
|
+
mn = L([
|
|
1138
1138
|
v(),
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
],
|
|
1139
|
+
I(0, _(N.LoggerPublisher)),
|
|
1140
|
+
I(1, _(E.ObserveAccountsWithFiatUseCase)),
|
|
1141
|
+
F("design:paramtypes", [Object, B === void 0 ? Object : B])
|
|
1142
|
+
], mn);
|
|
1143
1143
|
//#endregion
|
|
1144
1144
|
//#region src/internal/account/use-case/observeNetworksForSelectedAddressUseCase.ts
|
|
1145
|
-
var
|
|
1145
|
+
var hn = 200, gn = class {
|
|
1146
1146
|
contextService;
|
|
1147
1147
|
observeAccountsWithFiatUseCase;
|
|
1148
1148
|
buildNetworksUseCase;
|
|
@@ -1154,39 +1154,39 @@ var gn = 200, _n = class {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
debounceAfterFirstEmission() {
|
|
1156
1156
|
let e = !0;
|
|
1157
|
-
return () => e ? (e = !1, u(0)) : we(
|
|
1157
|
+
return () => e ? (e = !1, u(0)) : we(hn);
|
|
1158
1158
|
}
|
|
1159
1159
|
observeSelectedAddress() {
|
|
1160
|
-
return this.contextService.observeContext().pipe(l((e) =>
|
|
1160
|
+
return this.contextService.observeContext().pipe(l((e) => Pt(e)?.freshAddress), le());
|
|
1161
1161
|
}
|
|
1162
1162
|
};
|
|
1163
|
-
|
|
1163
|
+
gn = L([
|
|
1164
1164
|
v(),
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1165
|
+
I(0, _(A.ContextService)),
|
|
1166
|
+
I(1, _(E.ObserveAccountsWithFiatUseCase)),
|
|
1167
|
+
I(2, _(E.BuildNetworksUseCase)),
|
|
1168
|
+
F("design:paramtypes", [
|
|
1169
1169
|
Object,
|
|
1170
|
-
|
|
1171
|
-
|
|
1170
|
+
B === void 0 ? Object : B,
|
|
1171
|
+
Bt === void 0 ? Object : Bt
|
|
1172
1172
|
])
|
|
1173
|
-
],
|
|
1173
|
+
], gn);
|
|
1174
1174
|
//#endregion
|
|
1175
1175
|
//#region src/internal/account/di/accountModule.ts
|
|
1176
|
-
function
|
|
1176
|
+
function _n(e) {
|
|
1177
1177
|
return new g(({ bind: e }) => {
|
|
1178
|
-
e(
|
|
1178
|
+
e(E.AccountService).to(zt).inSingletonScope(), e(E.FetchAccountsUseCase).to(Gt), e(E.FetchAccountsWithBalanceUseCase).to(Yt), e(E.FetchCloudSyncAccountsUseCase).to(Wt), e(E.FetchSelectedAccountUseCase).to(cn), e(E.HydrateAccountWithTxHistoryUseCase).to(un), e(E.HydrateAccountWithFiatUseCase).to(on), e(E.HydrateAccountWithBalanceUseCase).to(Jt), e(E.FetchAccountsWithFiatUseCase).to(sn), e(E.FilterAccountsByFamilyUseCase).to(Kt), e(E.FindAccountForNetworkUseCase).to(ln), e(E.BuildNetworksUseCase).to(Bt).inSingletonScope(), e(E.ObserveAccountGroupsUseCase).to(mn).inSingletonScope(), e(E.ObserveAccountsWithFiatUseCase).to(B).inSingletonScope(), e(E.ObserveNetworksForSelectedAddressUseCase).to(gn), e(E.SortAccountsByFiatUseCase).to(dn);
|
|
1179
1179
|
});
|
|
1180
1180
|
}
|
|
1181
1181
|
//#endregion
|
|
1182
1182
|
//#region src/internal/logger/model/constant.ts
|
|
1183
|
-
var
|
|
1183
|
+
var V = {
|
|
1184
1184
|
fatal: 0,
|
|
1185
1185
|
error: 1,
|
|
1186
1186
|
warn: 2,
|
|
1187
1187
|
info: 3,
|
|
1188
1188
|
debug: 4
|
|
1189
|
-
},
|
|
1189
|
+
}, vn = {
|
|
1190
1190
|
dependencies: {
|
|
1191
1191
|
"@ledgerhq/coin-framework": "catalog:",
|
|
1192
1192
|
"@ledgerhq/device-management-kit": "catalog:",
|
|
@@ -1229,8 +1229,8 @@ var B = {
|
|
|
1229
1229
|
},
|
|
1230
1230
|
type: "module",
|
|
1231
1231
|
types: "./dist/index.d.ts",
|
|
1232
|
-
version: "2.0.
|
|
1233
|
-
},
|
|
1232
|
+
version: "2.0.2"
|
|
1233
|
+
}, yn = "https://connect.api.prd.ledger.com", H = class {
|
|
1234
1234
|
originToken;
|
|
1235
1235
|
dAppIdentifier;
|
|
1236
1236
|
logLevel;
|
|
@@ -1238,22 +1238,41 @@ var B = {
|
|
|
1238
1238
|
lkrp;
|
|
1239
1239
|
version;
|
|
1240
1240
|
constructor({ originToken: e, dAppIdentifier: t, logLevel: n = "info", environment: r = "production" }) {
|
|
1241
|
-
this.originToken = e, this.dAppIdentifier = t, this.logLevel =
|
|
1241
|
+
this.originToken = e, this.dAppIdentifier = t, this.logLevel = V[n], this.environment = r, this.lkrp = { cloudSyncUrl: this.getCloudSyncUrl() }, this.version = vn.version;
|
|
1242
1242
|
}
|
|
1243
1243
|
getCloudSyncUrl() {
|
|
1244
|
-
|
|
1244
|
+
switch (this.environment) {
|
|
1245
|
+
case "staging": return "https://cloud-sync-backend.api.aws.stg.ldg-tech.com";
|
|
1246
|
+
default: return "https://cloud-sync-backend.api.aws.prd.ldg-tech.com";
|
|
1247
|
+
}
|
|
1245
1248
|
}
|
|
1246
1249
|
setLogLevel(e) {
|
|
1247
|
-
this.logLevel =
|
|
1250
|
+
this.logLevel = V[e];
|
|
1248
1251
|
}
|
|
1249
1252
|
getCoinServiceUrl() {
|
|
1250
1253
|
return "https://coin-service.api.ledger.com";
|
|
1251
1254
|
}
|
|
1252
1255
|
getCalUrl() {
|
|
1253
|
-
|
|
1256
|
+
switch (this.environment) {
|
|
1257
|
+
case "staging": return "https://crypto-assets-service.api.ledger-test.com";
|
|
1258
|
+
case "trial": return `${yn}/cal`;
|
|
1259
|
+
default: return "https://crypto-assets-service.api.ledger.com";
|
|
1260
|
+
}
|
|
1254
1261
|
}
|
|
1255
1262
|
getBackendUrl() {
|
|
1256
|
-
|
|
1263
|
+
switch (this.environment) {
|
|
1264
|
+
case "staging": return "https://ledgerb.api.ledger-test.com";
|
|
1265
|
+
default: return "https://ledgerb.api.ledger.com";
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
getClearSigningEndpoints() {
|
|
1269
|
+
switch (this.environment) {
|
|
1270
|
+
case "trial": return {
|
|
1271
|
+
calUrl: `${yn}/cal/v1`,
|
|
1272
|
+
transactionCheckUrl: `${yn}/transaction-checks/v3`
|
|
1273
|
+
};
|
|
1274
|
+
default: return;
|
|
1275
|
+
}
|
|
1257
1276
|
}
|
|
1258
1277
|
getCounterValueUrl() {
|
|
1259
1278
|
return "https://countervalues.live.ledger.com";
|
|
@@ -1265,10 +1284,10 @@ var B = {
|
|
|
1265
1284
|
this.environment = e, this.lkrp = { cloudSyncUrl: this.getCloudSyncUrl() };
|
|
1266
1285
|
}
|
|
1267
1286
|
};
|
|
1268
|
-
|
|
1287
|
+
H = L([v(), F("design:paramtypes", [Object])], H);
|
|
1269
1288
|
//#endregion
|
|
1270
1289
|
//#region src/internal/network/di/networkModuleTypes.ts
|
|
1271
|
-
var
|
|
1290
|
+
var U = { NetworkService: Symbol.for("NetworkService") }, bn = y.object({
|
|
1272
1291
|
id: y.string(),
|
|
1273
1292
|
currencyId: y.string(),
|
|
1274
1293
|
currencyName: y.string(),
|
|
@@ -1307,7 +1326,7 @@ var H = { NetworkService: Symbol.for("NetworkService") }, bn = y.object({
|
|
|
1307
1326
|
"X-Ledger-client-origin": this.config.originToken,
|
|
1308
1327
|
"X-Ledger-Domain": t
|
|
1309
1328
|
} };
|
|
1310
|
-
return (await this.networkService.post(n, JSON.stringify(e), r)).mapLeft((e) => new
|
|
1329
|
+
return (await this.networkService.post(n, JSON.stringify(e), r)).mapLeft((e) => new xt(`Broadcast failed: ${e.message}`, { error: e }));
|
|
1311
1330
|
}
|
|
1312
1331
|
async getConfigV2(e, t = this.config.dAppIdentifier) {
|
|
1313
1332
|
let n = `${this.config.getBackendUrl()}/v2/config?dAppIdentifier=${encodeURIComponent(e.dAppIdentifier)}`, r = { headers: {
|
|
@@ -1324,11 +1343,11 @@ var H = { NetworkService: Symbol.for("NetworkService") }, bn = y.object({
|
|
|
1324
1343
|
return (await this.networkService.post(n, JSON.stringify(e), r)).mapLeft((e) => /* @__PURE__ */ Error(`Event tracking failed: ${e.message}`));
|
|
1325
1344
|
}
|
|
1326
1345
|
};
|
|
1327
|
-
Tn =
|
|
1346
|
+
Tn = L([
|
|
1328
1347
|
v(),
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1348
|
+
I(0, _(U.NetworkService)),
|
|
1349
|
+
I(1, _(k.Config)),
|
|
1350
|
+
F("design:paramtypes", [Object, H === void 0 ? Object : H])
|
|
1332
1351
|
], Tn);
|
|
1333
1352
|
//#endregion
|
|
1334
1353
|
//#region src/internal/backend/di/backendModuleTypes.ts
|
|
@@ -1391,40 +1410,40 @@ var On = class {
|
|
|
1391
1410
|
});
|
|
1392
1411
|
}
|
|
1393
1412
|
};
|
|
1394
|
-
On =
|
|
1413
|
+
On = L([
|
|
1395
1414
|
v(),
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1415
|
+
I(0, _(U.NetworkService)),
|
|
1416
|
+
I(1, _(k.Config)),
|
|
1417
|
+
F("design:paramtypes", [Object, H === void 0 ? Object : H])
|
|
1399
1418
|
], On);
|
|
1400
1419
|
function kn(e) {
|
|
1401
1420
|
return e?.explorers?.[0]?.transaction;
|
|
1402
1421
|
}
|
|
1403
1422
|
//#endregion
|
|
1404
1423
|
//#region src/internal/balance/model/error.ts
|
|
1405
|
-
var An = class extends
|
|
1424
|
+
var An = class extends x {
|
|
1406
1425
|
constructor(e, t) {
|
|
1407
1426
|
super(e, "CoinServiceNetworkError", t);
|
|
1408
1427
|
}
|
|
1409
|
-
}, jn = class extends
|
|
1428
|
+
}, jn = class extends x {
|
|
1410
1429
|
constructor(e, t) {
|
|
1411
1430
|
super(`Invalid address format: ${e}`, "CoinServiceInvalidAddressError", {
|
|
1412
1431
|
address: e,
|
|
1413
1432
|
...t
|
|
1414
1433
|
});
|
|
1415
1434
|
}
|
|
1416
|
-
}, Mn = class extends
|
|
1435
|
+
}, Mn = class extends x {
|
|
1417
1436
|
constructor(e, t) {
|
|
1418
1437
|
super(`Unsupported chain: ${e}`, "CoinServiceUnsupportedChainError", {
|
|
1419
1438
|
currencyId: e,
|
|
1420
1439
|
...t
|
|
1421
1440
|
});
|
|
1422
1441
|
}
|
|
1423
|
-
}, Nn = class extends
|
|
1442
|
+
}, Nn = class extends x {
|
|
1424
1443
|
constructor(e, t) {
|
|
1425
1444
|
super(e, "CoinServiceApiError", t);
|
|
1426
1445
|
}
|
|
1427
|
-
}, Pn = class extends
|
|
1446
|
+
}, Pn = class extends x {
|
|
1428
1447
|
constructor(e, t, n) {
|
|
1429
1448
|
super(`Failed to fetch balance for address ${e} on ${t}`, "CoinServiceBalanceFetchError", {
|
|
1430
1449
|
address: e,
|
|
@@ -1432,7 +1451,7 @@ var An = class extends b {
|
|
|
1432
1451
|
...n
|
|
1433
1452
|
});
|
|
1434
1453
|
}
|
|
1435
|
-
}, Fn = class extends
|
|
1454
|
+
}, Fn = class extends x {
|
|
1436
1455
|
constructor(e, t, n) {
|
|
1437
1456
|
super(`Failed to fetch token balances for address ${e} on ${t}`, "CoinServiceTokenFetchError", {
|
|
1438
1457
|
address: e,
|
|
@@ -1440,11 +1459,11 @@ var An = class extends b {
|
|
|
1440
1459
|
...n
|
|
1441
1460
|
});
|
|
1442
1461
|
}
|
|
1443
|
-
}, In = class extends
|
|
1462
|
+
}, In = class extends x {
|
|
1444
1463
|
constructor(e, t) {
|
|
1445
1464
|
super(e, "CoinServiceUnknownError", t);
|
|
1446
1465
|
}
|
|
1447
|
-
}, Ln = class extends
|
|
1466
|
+
}, Ln = class extends x {
|
|
1448
1467
|
constructor(e, t) {
|
|
1449
1468
|
super(`Failed to estimate transaction fee for ${e}`, "CoinServiceFeeEstimationError", {
|
|
1450
1469
|
network: e,
|
|
@@ -1483,11 +1502,11 @@ var An = class extends b {
|
|
|
1483
1502
|
return (await this.networkService.post(n, JSON.stringify(r))).mapLeft((t) => Rn.feeEstimationError(e, t));
|
|
1484
1503
|
}
|
|
1485
1504
|
};
|
|
1486
|
-
zn =
|
|
1505
|
+
zn = L([
|
|
1487
1506
|
v(),
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1507
|
+
I(0, _(U.NetworkService)),
|
|
1508
|
+
I(1, _(k.Config)),
|
|
1509
|
+
F("design:paramtypes", [Object, H === void 0 ? Object : H])
|
|
1491
1510
|
], zn);
|
|
1492
1511
|
//#endregion
|
|
1493
1512
|
//#region src/internal/balance/datasource/countervalue/DefaultCounterValueDataSource.ts
|
|
@@ -1515,11 +1534,11 @@ var Bn = class {
|
|
|
1515
1534
|
return h(o);
|
|
1516
1535
|
}
|
|
1517
1536
|
};
|
|
1518
|
-
Bn =
|
|
1537
|
+
Bn = L([
|
|
1519
1538
|
v(),
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1539
|
+
I(0, _(U.NetworkService)),
|
|
1540
|
+
I(1, _(k.Config)),
|
|
1541
|
+
F("design:paramtypes", [Object, Object])
|
|
1523
1542
|
], Bn);
|
|
1524
1543
|
//#endregion
|
|
1525
1544
|
//#region src/internal/balance/model/types.ts
|
|
@@ -1533,7 +1552,7 @@ var Vn = class {
|
|
|
1533
1552
|
this.ledgerId = e, this.decimals = t, this.balance = n, this.name = r, this.ticker = i;
|
|
1534
1553
|
}
|
|
1535
1554
|
get balanceFormatted() {
|
|
1536
|
-
return
|
|
1555
|
+
return qt(this.balance, this.decimals, this.ticker);
|
|
1537
1556
|
}
|
|
1538
1557
|
}, Hn = class {
|
|
1539
1558
|
loggerFactory;
|
|
@@ -1575,12 +1594,12 @@ var Vn = class {
|
|
|
1575
1594
|
return f(/* @__PURE__ */ Error("Failed to fetch balance from CoinService"));
|
|
1576
1595
|
}
|
|
1577
1596
|
};
|
|
1578
|
-
Hn =
|
|
1597
|
+
Hn = L([
|
|
1579
1598
|
v(),
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1599
|
+
I(0, _(N.LoggerPublisher)),
|
|
1600
|
+
I(1, _(D.CoinServiceDataSource)),
|
|
1601
|
+
I(2, _(D.CalDataSource)),
|
|
1602
|
+
F("design:paramtypes", [
|
|
1584
1603
|
Object,
|
|
1585
1604
|
Object,
|
|
1586
1605
|
Object
|
|
@@ -1590,7 +1609,7 @@ Hn = I([
|
|
|
1590
1609
|
//#region src/internal/balance/di/balanceModule.ts
|
|
1591
1610
|
function Un({ stub: e }) {
|
|
1592
1611
|
return new g(({ bind: e }) => {
|
|
1593
|
-
e(
|
|
1612
|
+
e(D.BalanceService).to(Hn).inSingletonScope(), e(D.CoinServiceDataSource).to(zn).inSingletonScope(), e(D.CalDataSource).to(On).inSingletonScope(), e(D.CounterValueDataSource).to(Bn).inSingletonScope();
|
|
1594
1613
|
});
|
|
1595
1614
|
}
|
|
1596
1615
|
//#endregion
|
|
@@ -1613,31 +1632,31 @@ var Wn = class {
|
|
|
1613
1632
|
"x-ledger-client-version": "ll-web-tools/0.0.0"
|
|
1614
1633
|
} })).caseOf({
|
|
1615
1634
|
Right: (e) => {
|
|
1616
|
-
if (e.status === "no-data") throw new
|
|
1635
|
+
if (e.status === "no-data") throw new _t("No data found");
|
|
1617
1636
|
return e;
|
|
1618
1637
|
},
|
|
1619
1638
|
Left: (e) => {
|
|
1620
|
-
throw this.logger.error("Failed to fetch encrypted accounts", { error: e }), new
|
|
1639
|
+
throw this.logger.error("Failed to fetch encrypted accounts", { error: e }), new vt("Failed to fetch encrypted accounts");
|
|
1621
1640
|
}
|
|
1622
1641
|
});
|
|
1623
1642
|
}
|
|
1624
1643
|
};
|
|
1625
|
-
Wn =
|
|
1644
|
+
Wn = L([
|
|
1626
1645
|
v(),
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1646
|
+
I(0, _(N.LoggerPublisher)),
|
|
1647
|
+
I(1, _(U.NetworkService)),
|
|
1648
|
+
I(2, _(k.Config)),
|
|
1649
|
+
F("design:paramtypes", [
|
|
1631
1650
|
Object,
|
|
1632
1651
|
Object,
|
|
1633
|
-
|
|
1652
|
+
H === void 0 ? Object : H
|
|
1634
1653
|
])
|
|
1635
1654
|
], Wn);
|
|
1636
1655
|
//#endregion
|
|
1637
1656
|
//#region src/internal/cloudsync/di/cloudsyncModule.ts
|
|
1638
1657
|
function Gn({ stub: e }) {
|
|
1639
1658
|
return new g(({ bind: e }) => {
|
|
1640
|
-
e(
|
|
1659
|
+
e(Ht.CloudSyncService).to(Wn).inSingletonScope();
|
|
1641
1660
|
});
|
|
1642
1661
|
}
|
|
1643
1662
|
//#endregion
|
|
@@ -1645,7 +1664,7 @@ function Gn({ stub: e }) {
|
|
|
1645
1664
|
var Kn = "1e55ba3959f4543af24809d9066a2120bd2ac9246e626e26a1ff77eb109ca0e5";
|
|
1646
1665
|
function qn({ loggerLevel: e, apiKey: t, dAppIdentifier: n, environment: r }) {
|
|
1647
1666
|
return new g(({ bind: i }) => {
|
|
1648
|
-
i(
|
|
1667
|
+
i(k.Config).toResolvedValue(() => new H({
|
|
1649
1668
|
logLevel: e,
|
|
1650
1669
|
originToken: t || Kn,
|
|
1651
1670
|
dAppIdentifier: n || "",
|
|
@@ -1655,7 +1674,7 @@ function qn({ loggerLevel: e, apiKey: t, dAppIdentifier: n, environment: r }) {
|
|
|
1655
1674
|
}
|
|
1656
1675
|
//#endregion
|
|
1657
1676
|
//#region src/internal/event-tracking/di/eventTrackingModuleTypes.ts
|
|
1658
|
-
var
|
|
1677
|
+
var W = {
|
|
1659
1678
|
EventTrackingService: Symbol.for("EventTrackingService"),
|
|
1660
1679
|
TrackConsentGiven: Symbol.for("TrackConsentGiven"),
|
|
1661
1680
|
TrackConsentRemoved: Symbol.for("TrackConsentRemoved"),
|
|
@@ -1709,12 +1728,12 @@ var U = {
|
|
|
1709
1728
|
return e.isJust() ? e.extract() : void 0;
|
|
1710
1729
|
}
|
|
1711
1730
|
};
|
|
1712
|
-
Jn =
|
|
1731
|
+
Jn = L([
|
|
1713
1732
|
v(),
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1733
|
+
I(0, _(P.StorageService)),
|
|
1734
|
+
I(1, _(W.TrackConsentGiven)),
|
|
1735
|
+
I(2, _(W.TrackConsentRemoved)),
|
|
1736
|
+
F("design:paramtypes", [
|
|
1718
1737
|
Object,
|
|
1719
1738
|
Object,
|
|
1720
1739
|
Object
|
|
@@ -1724,7 +1743,7 @@ Jn = I([
|
|
|
1724
1743
|
//#region src/internal/consent/di/consentModule.ts
|
|
1725
1744
|
function Yn() {
|
|
1726
1745
|
return new g(({ bind: e }) => {
|
|
1727
|
-
e(
|
|
1746
|
+
e(It.ConsentService).to(Jn).inSingletonScope();
|
|
1728
1747
|
});
|
|
1729
1748
|
}
|
|
1730
1749
|
//#endregion
|
|
@@ -1762,8 +1781,8 @@ var Xn = class {
|
|
|
1762
1781
|
break;
|
|
1763
1782
|
case "chain_changed": {
|
|
1764
1783
|
this.context.chainId = e.chainId;
|
|
1765
|
-
let t = this.context.selectedAccounts.get(
|
|
1766
|
-
t && e.currencyId && this.context.selectedAccounts.set(
|
|
1784
|
+
let t = this.context.selectedAccounts.get(w);
|
|
1785
|
+
t && e.currencyId && this.context.selectedAccounts.set(w, {
|
|
1767
1786
|
...t,
|
|
1768
1787
|
currencyId: e.currencyId
|
|
1769
1788
|
});
|
|
@@ -1829,16 +1848,16 @@ var Xn = class {
|
|
|
1829
1848
|
return this.context.selectedAccounts.keys().next().value;
|
|
1830
1849
|
}
|
|
1831
1850
|
};
|
|
1832
|
-
Xn =
|
|
1851
|
+
Xn = L([
|
|
1833
1852
|
v(),
|
|
1834
|
-
|
|
1835
|
-
|
|
1853
|
+
I(0, _(N.LoggerPublisher)),
|
|
1854
|
+
F("design:paramtypes", [Object])
|
|
1836
1855
|
], Xn);
|
|
1837
1856
|
//#endregion
|
|
1838
1857
|
//#region src/internal/context/di/contextModule.ts
|
|
1839
1858
|
function Zn() {
|
|
1840
1859
|
return new g(({ bind: e }) => {
|
|
1841
|
-
e(
|
|
1860
|
+
e(A.ContextService).to(Xn).inSingletonScope();
|
|
1842
1861
|
});
|
|
1843
1862
|
}
|
|
1844
1863
|
//#endregion
|
|
@@ -1858,10 +1877,10 @@ var Qn = class {
|
|
|
1858
1877
|
return new Uint8Array(i);
|
|
1859
1878
|
}
|
|
1860
1879
|
};
|
|
1861
|
-
Qn =
|
|
1880
|
+
Qn = L([
|
|
1862
1881
|
v(),
|
|
1863
|
-
|
|
1864
|
-
|
|
1882
|
+
I(0, _(N.LoggerPublisher)),
|
|
1883
|
+
F("design:paramtypes", [Object])
|
|
1865
1884
|
], Qn);
|
|
1866
1885
|
//#endregion
|
|
1867
1886
|
//#region src/internal/cryptographic/use-case/EncryptKeyPairUseCase.ts
|
|
@@ -1883,10 +1902,10 @@ var $n = class {
|
|
|
1883
1902
|
return o.set(i, 0), o.set(new Uint8Array(a), i.length), this.logger.info("KeyPair encrypted", { encryptedKeyPair: c(o) }), o;
|
|
1884
1903
|
}
|
|
1885
1904
|
};
|
|
1886
|
-
$n =
|
|
1905
|
+
$n = L([
|
|
1887
1906
|
v(),
|
|
1888
|
-
|
|
1889
|
-
|
|
1907
|
+
I(0, _(N.LoggerPublisher)),
|
|
1908
|
+
F("design:paramtypes", [Object])
|
|
1890
1909
|
], $n);
|
|
1891
1910
|
//#endregion
|
|
1892
1911
|
//#region src/internal/cryptographic/use-case/GenerateKeyPairUseCase.ts
|
|
@@ -1902,10 +1921,10 @@ var er = class {
|
|
|
1902
1921
|
return this.logger.info("KeyPair public key", { keyPair: e.getPublicKeyToHex() }), e;
|
|
1903
1922
|
}
|
|
1904
1923
|
};
|
|
1905
|
-
er =
|
|
1924
|
+
er = L([
|
|
1906
1925
|
v(),
|
|
1907
|
-
|
|
1908
|
-
|
|
1926
|
+
I(0, _(N.LoggerPublisher)),
|
|
1927
|
+
F("design:paramtypes", [Object])
|
|
1909
1928
|
], er);
|
|
1910
1929
|
//#endregion
|
|
1911
1930
|
//#region src/internal/cryptographic/use-case/GetEncryptionKey.ts
|
|
@@ -1937,14 +1956,14 @@ var tr = class {
|
|
|
1937
1956
|
return await this.storeEncryptionKey(e), e;
|
|
1938
1957
|
}
|
|
1939
1958
|
};
|
|
1940
|
-
tr =
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1959
|
+
tr = L([
|
|
1960
|
+
I(0, _(N.LoggerPublisher)),
|
|
1961
|
+
I(1, _(P.StorageService)),
|
|
1962
|
+
F("design:paramtypes", [Object, Object])
|
|
1944
1963
|
], tr);
|
|
1945
1964
|
//#endregion
|
|
1946
1965
|
//#region src/internal/cryptographic/di/cryptographicModuleTypes.ts
|
|
1947
|
-
var
|
|
1966
|
+
var G = {
|
|
1948
1967
|
GenerateKeyPairUseCase: Symbol.for("GenerateKeyPairUseCase"),
|
|
1949
1968
|
EncryptKeyPairUseCase: Symbol.for("EncryptKeyPairUseCase"),
|
|
1950
1969
|
GetEncryptionKeyUseCase: Symbol.for("GetEncryptionKeyUseCase"),
|
|
@@ -1977,15 +1996,15 @@ var W = {
|
|
|
1977
1996
|
return this.logger.info("KeyPair retrieved with public key", { keypair: e.getPublicKeyToHex() }), e;
|
|
1978
1997
|
}
|
|
1979
1998
|
};
|
|
1980
|
-
nr =
|
|
1999
|
+
nr = L([
|
|
1981
2000
|
v(),
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
2001
|
+
I(0, _(N.LoggerPublisher)),
|
|
2002
|
+
I(1, _(P.StorageService)),
|
|
2003
|
+
I(2, _(G.GenerateKeyPairUseCase)),
|
|
2004
|
+
I(3, _(G.GetEncryptionKeyUseCase)),
|
|
2005
|
+
I(4, _(G.EncryptKeyPairUseCase)),
|
|
2006
|
+
I(5, _(G.DecryptKeyPairUseCase)),
|
|
2007
|
+
F("design:paramtypes", [
|
|
1989
2008
|
Object,
|
|
1990
2009
|
Object,
|
|
1991
2010
|
er === void 0 ? Object : er,
|
|
@@ -1998,7 +2017,7 @@ nr = I([
|
|
|
1998
2017
|
//#region src/internal/cryptographic/di/cryptographicModule.ts
|
|
1999
2018
|
function rr({ stub: e }) {
|
|
2000
2019
|
return new g(({ bind: e }) => {
|
|
2001
|
-
e(
|
|
2020
|
+
e(G.GenerateKeyPairUseCase).to(er), e(G.EncryptKeyPairUseCase).to($n), e(G.GetEncryptionKeyUseCase).to(tr), e(G.GetOrCreateKeyPairUseCase).to(nr), e(G.DecryptKeyPairUseCase).to(Qn);
|
|
2002
2021
|
});
|
|
2003
2022
|
}
|
|
2004
2023
|
//#endregion
|
|
@@ -2014,24 +2033,24 @@ var ir = class {
|
|
|
2014
2033
|
return t.isLeft() ? f(/* @__PURE__ */ Error("Failed to fetch supported fiat currencies")) : h(t.extract());
|
|
2015
2034
|
}
|
|
2016
2035
|
};
|
|
2017
|
-
ir =
|
|
2036
|
+
ir = L([
|
|
2018
2037
|
v(),
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2038
|
+
I(0, _(U.NetworkService)),
|
|
2039
|
+
I(1, _(k.Config)),
|
|
2040
|
+
F("design:paramtypes", [Object, H === void 0 ? Object : H])
|
|
2022
2041
|
], ir);
|
|
2023
2042
|
//#endregion
|
|
2024
2043
|
//#region src/internal/currency/service/DefaultCurrencyService.ts
|
|
2025
2044
|
var ar = class {
|
|
2026
2045
|
fiatCurrencyDataSource;
|
|
2027
2046
|
storageService;
|
|
2028
|
-
supportedFiatCurrencies =
|
|
2047
|
+
supportedFiatCurrencies = Lt;
|
|
2029
2048
|
constructor(e, t) {
|
|
2030
2049
|
this.fiatCurrencyDataSource = e, this.storageService = t;
|
|
2031
2050
|
}
|
|
2032
2051
|
async initialize() {
|
|
2033
2052
|
let e = await this.fiatCurrencyDataSource.getSupportedFiatCurrencies();
|
|
2034
|
-
return this.supportedFiatCurrencies = e.orDefault(
|
|
2053
|
+
return this.supportedFiatCurrencies = e.orDefault(Lt), (await this.storageService.getPreferredFiatCurrency()).filter((e) => this.supportedFiatCurrencies.some((t) => t.code === e)).orDefault("USD");
|
|
2035
2054
|
}
|
|
2036
2055
|
getSupportedFiatCurrencies() {
|
|
2037
2056
|
return this.supportedFiatCurrencies;
|
|
@@ -2040,11 +2059,11 @@ var ar = class {
|
|
|
2040
2059
|
await this.storageService.savePreferredFiatCurrency(e);
|
|
2041
2060
|
}
|
|
2042
2061
|
};
|
|
2043
|
-
ar =
|
|
2062
|
+
ar = L([
|
|
2044
2063
|
v(),
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2064
|
+
I(0, _(j.FiatCurrencyDataSource)),
|
|
2065
|
+
I(1, _(P.StorageService)),
|
|
2066
|
+
F("design:paramtypes", [Object, Object])
|
|
2048
2067
|
], ar);
|
|
2049
2068
|
//#endregion
|
|
2050
2069
|
//#region src/internal/currency/use-case/ResolveCurrencyDecimalsUseCase.ts
|
|
@@ -2070,12 +2089,12 @@ var or = class {
|
|
|
2070
2089
|
return t.isNothing() && this.logger.warn("No registered provider claims currency", { currencyId: e }), t;
|
|
2071
2090
|
}
|
|
2072
2091
|
};
|
|
2073
|
-
or =
|
|
2092
|
+
or = L([
|
|
2074
2093
|
v(),
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2094
|
+
I(0, _(D.CalDataSource)),
|
|
2095
|
+
I(1, _(O.BlockchainProviderManager)),
|
|
2096
|
+
I(2, _(N.LoggerPublisher)),
|
|
2097
|
+
F("design:paramtypes", [
|
|
2079
2098
|
Object,
|
|
2080
2099
|
Object,
|
|
2081
2100
|
Object
|
|
@@ -2085,7 +2104,7 @@ or = I([
|
|
|
2085
2104
|
//#region src/internal/currency/di/currencyModule.ts
|
|
2086
2105
|
function sr() {
|
|
2087
2106
|
return new g(({ bind: e }) => {
|
|
2088
|
-
e(
|
|
2107
|
+
e(j.FiatCurrencyDataSource).to(ir).inSingletonScope(), e(j.CurrencyService).to(ar).inSingletonScope(), e(j.ResolveCurrencyDecimalsUseCase).to(or).inSingletonScope();
|
|
2089
2108
|
});
|
|
2090
2109
|
}
|
|
2091
2110
|
//#endregion
|
|
@@ -2134,11 +2153,11 @@ var dr = class {
|
|
|
2134
2153
|
return this.dAppConfig = ur(t.extract()), this.dAppConfig;
|
|
2135
2154
|
}
|
|
2136
2155
|
};
|
|
2137
|
-
dr =
|
|
2156
|
+
dr = L([
|
|
2138
2157
|
v(),
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2158
|
+
I(0, _(k.Config)),
|
|
2159
|
+
I(1, _(En.BackendService)),
|
|
2160
|
+
F("design:paramtypes", [H === void 0 ? Object : H, Object])
|
|
2142
2161
|
], dr);
|
|
2143
2162
|
//#endregion
|
|
2144
2163
|
//#region src/internal/dAppConfig/datasource/StubDAppConfigDataSource.ts
|
|
@@ -2379,10 +2398,10 @@ var fr = [
|
|
|
2379
2398
|
return hr[this.config.dAppIdentifier] ?? hr.ledger;
|
|
2380
2399
|
}
|
|
2381
2400
|
};
|
|
2382
|
-
gr =
|
|
2401
|
+
gr = L([
|
|
2383
2402
|
v(),
|
|
2384
|
-
|
|
2385
|
-
|
|
2403
|
+
I(0, _(k.Config)),
|
|
2404
|
+
F("design:paramtypes", [H === void 0 ? Object : H])
|
|
2386
2405
|
], gr);
|
|
2387
2406
|
//#endregion
|
|
2388
2407
|
//#region src/internal/dAppConfig/use-case/GetDAppConfigUseCase.ts
|
|
@@ -2401,17 +2420,17 @@ var _r = class {
|
|
|
2401
2420
|
}
|
|
2402
2421
|
}
|
|
2403
2422
|
};
|
|
2404
|
-
_r =
|
|
2423
|
+
_r = L([
|
|
2405
2424
|
v(),
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2425
|
+
I(0, _(N.LoggerPublisher)),
|
|
2426
|
+
I(1, _(Rt.DAppConfigDataSource)),
|
|
2427
|
+
F("design:paramtypes", [Object, Object])
|
|
2409
2428
|
], _r);
|
|
2410
2429
|
//#endregion
|
|
2411
2430
|
//#region src/internal/dAppConfig/di/dAppConfigModule.ts
|
|
2412
2431
|
function vr({ stub: e } = {}) {
|
|
2413
2432
|
return new g(({ bind: t, rebindSync: n }) => {
|
|
2414
|
-
t(
|
|
2433
|
+
t(Rt.DAppConfigDataSource).to(dr).inSingletonScope(), t(Rt.GetDAppConfigUseCase).to(_r).inSingletonScope(), e && n(Rt.DAppConfigDataSource).to(gr).inSingletonScope();
|
|
2415
2434
|
});
|
|
2416
2435
|
}
|
|
2417
2436
|
//#endregion
|
|
@@ -2477,10 +2496,10 @@ var yr = class {
|
|
|
2477
2496
|
try {
|
|
2478
2497
|
r = await fe(n.startDiscovering({ transport: t })), await n.stopDiscovering();
|
|
2479
2498
|
} catch (e) {
|
|
2480
|
-
throw this.logger.error("Failed to start discovery", { error: e }), e instanceof s ? new
|
|
2499
|
+
throw this.logger.error("Failed to start discovery", { error: e }), e instanceof s ? new ft("No accessible device", {
|
|
2481
2500
|
type: "no-accessible-device",
|
|
2482
2501
|
error: e
|
|
2483
|
-
}) : new
|
|
2502
|
+
}) : new ft("Failed to start discovery", {
|
|
2484
2503
|
type: "failed-to-start-discovery",
|
|
2485
2504
|
error: e
|
|
2486
2505
|
});
|
|
@@ -2492,7 +2511,7 @@ var yr = class {
|
|
|
2492
2511
|
});
|
|
2493
2512
|
return this._currentSessionId = e, this._connectedDevice = new yr(await n.getConnectedDevice({ sessionId: e })), this._connectedDevice;
|
|
2494
2513
|
} catch (e) {
|
|
2495
|
-
throw this.logger.error("Failed to connect to device", { error: e }), new
|
|
2514
|
+
throw this.logger.error("Failed to connect to device", { error: e }), new ft("Failed to connect to device", {
|
|
2496
2515
|
type: "failed-to-connect",
|
|
2497
2516
|
error: e
|
|
2498
2517
|
});
|
|
@@ -2527,7 +2546,7 @@ var yr = class {
|
|
|
2527
2546
|
try {
|
|
2528
2547
|
await this.dmk.disconnect({ sessionId: e });
|
|
2529
2548
|
} catch (e) {
|
|
2530
|
-
throw this.logger.error("Failed to disconnect from device", { error: e }), new
|
|
2549
|
+
throw this.logger.error("Failed to disconnect from device", { error: e }), new ft("Failed to disconnect from device", {
|
|
2531
2550
|
type: "failed-to-disconnect",
|
|
2532
2551
|
error: e
|
|
2533
2552
|
});
|
|
@@ -2548,12 +2567,12 @@ var yr = class {
|
|
|
2548
2567
|
e && this._currentSessionId !== e || (this._currentSessionId = void 0, this._connectedDevice = void 0);
|
|
2549
2568
|
}
|
|
2550
2569
|
};
|
|
2551
|
-
xr =
|
|
2570
|
+
xr = L([
|
|
2552
2571
|
v(),
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2572
|
+
I(0, _(N.LoggerPublisher)),
|
|
2573
|
+
I(1, _(M.DmkConfig)),
|
|
2574
|
+
I(2, _(M.DmkLogLevel)),
|
|
2575
|
+
F("design:paramtypes", [
|
|
2557
2576
|
Object,
|
|
2558
2577
|
Object,
|
|
2559
2578
|
Object
|
|
@@ -2594,7 +2613,7 @@ var Sr = class {
|
|
|
2594
2613
|
transport: "USB"
|
|
2595
2614
|
}]);
|
|
2596
2615
|
};
|
|
2597
|
-
Sr =
|
|
2616
|
+
Sr = L([v()], Sr);
|
|
2598
2617
|
//#endregion
|
|
2599
2618
|
//#region src/internal/device/use-case/ConnectDevice.ts
|
|
2600
2619
|
var Cr = class {
|
|
@@ -2611,14 +2630,14 @@ var Cr = class {
|
|
|
2611
2630
|
async rejectUnsupportedDevice(e) {
|
|
2612
2631
|
if (e.modelId !== r.NANO_S) return;
|
|
2613
2632
|
await this.deviceManagementKitService.disconnectFromDevice();
|
|
2614
|
-
let t = new
|
|
2633
|
+
let t = new Je("Device not supported", { modelId: e.modelId });
|
|
2615
2634
|
throw this.logger.error("Device not supported", { error: t }), t;
|
|
2616
2635
|
}
|
|
2617
2636
|
async assertDeviceOnboarded(e) {
|
|
2618
2637
|
let t = await this.getOsVersionResult(e);
|
|
2619
2638
|
if (re(t) && !t.data.secureElementFlags.isOnboarded) {
|
|
2620
2639
|
await this.deviceManagementKitService.disconnectFromDevice();
|
|
2621
|
-
let t = new
|
|
2640
|
+
let t = new Ye("Device not onboarded", { modelId: e.modelId });
|
|
2622
2641
|
throw this.logger.error("Device not onboarded", { error: t }), t;
|
|
2623
2642
|
}
|
|
2624
2643
|
re(t) || this.logger.warn("Failed to get OS version after connect", { error: t.error });
|
|
@@ -2630,11 +2649,11 @@ var Cr = class {
|
|
|
2630
2649
|
});
|
|
2631
2650
|
}
|
|
2632
2651
|
};
|
|
2633
|
-
Cr =
|
|
2652
|
+
Cr = L([
|
|
2634
2653
|
v(),
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2654
|
+
I(0, _(N.LoggerPublisher)),
|
|
2655
|
+
I(1, _(M.DeviceManagementKitService)),
|
|
2656
|
+
F("design:paramtypes", [Object, Object])
|
|
2638
2657
|
], Cr);
|
|
2639
2658
|
//#endregion
|
|
2640
2659
|
//#region src/internal/device/use-case/DisconnectDevice.ts
|
|
@@ -2648,11 +2667,11 @@ var wr = class {
|
|
|
2648
2667
|
return this.logger.info("Disconnecting from device"), this.deviceManagementKitService.disconnectFromDevice();
|
|
2649
2668
|
}
|
|
2650
2669
|
};
|
|
2651
|
-
wr =
|
|
2670
|
+
wr = L([
|
|
2652
2671
|
v(),
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2672
|
+
I(0, _(N.LoggerPublisher)),
|
|
2673
|
+
I(1, _(M.DeviceManagementKitService)),
|
|
2674
|
+
F("design:paramtypes", [Object, Object])
|
|
2656
2675
|
], wr);
|
|
2657
2676
|
//#endregion
|
|
2658
2677
|
//#region src/internal/device/use-case/ListAvailableDevices.ts
|
|
@@ -2666,11 +2685,11 @@ var Tr = class {
|
|
|
2666
2685
|
return this.logger.info("Listing available devices"), this.deviceManagementKitService.listAvailableDevices();
|
|
2667
2686
|
}
|
|
2668
2687
|
};
|
|
2669
|
-
Tr =
|
|
2688
|
+
Tr = L([
|
|
2670
2689
|
v(),
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2690
|
+
I(0, _(N.LoggerPublisher)),
|
|
2691
|
+
I(1, _(M.DeviceManagementKitService)),
|
|
2692
|
+
F("design:paramtypes", [Object, Object])
|
|
2674
2693
|
], Tr);
|
|
2675
2694
|
//#endregion
|
|
2676
2695
|
//#region src/internal/device/use-case/SwitchDevice.ts
|
|
@@ -2688,17 +2707,17 @@ var Er = class {
|
|
|
2688
2707
|
}
|
|
2689
2708
|
}
|
|
2690
2709
|
};
|
|
2691
|
-
Er =
|
|
2710
|
+
Er = L([
|
|
2692
2711
|
v(),
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2712
|
+
I(0, _(N.LoggerPublisher)),
|
|
2713
|
+
I(1, _(M.DeviceManagementKitService)),
|
|
2714
|
+
F("design:paramtypes", [Object, Object])
|
|
2696
2715
|
], Er);
|
|
2697
2716
|
//#endregion
|
|
2698
2717
|
//#region src/internal/device/di/deviceModule.ts
|
|
2699
2718
|
function Dr({ stub: e, dmkConfig: t, dmkLogLevel: n = "error" }) {
|
|
2700
2719
|
return new g(({ bind: r, rebindSync: i }) => {
|
|
2701
|
-
r(
|
|
2720
|
+
r(M.DmkConfig).toConstantValue(t), r(M.DmkLogLevel).toConstantValue(n), r(M.DeviceManagementKitService).to(xr).inSingletonScope(), r(M.ConnectDeviceUseCase).to(Cr), r(M.DisconnectDeviceUseCase).to(wr), r(M.SwitchDeviceUseCase).to(Er), r(M.ListAvailableDevicesUseCase).to(Tr), e && i(M.DeviceManagementKitService).to(Sr);
|
|
2702
2721
|
});
|
|
2703
2722
|
}
|
|
2704
2723
|
//#endregion
|
|
@@ -2732,9 +2751,9 @@ var Ar = {
|
|
|
2732
2751
|
enabled: !0,
|
|
2733
2752
|
useWhitelist: !0,
|
|
2734
2753
|
whitelist: Or
|
|
2735
|
-
},
|
|
2754
|
+
}, K = /* @__PURE__ */ function(e) {
|
|
2736
2755
|
return e.ConsentGiven = "consent_given", e.ConsentRemoved = "consent_removed", e.ErrorOccurred = "error_occurred", e.FloatingButtonClick = "floating_button_clicked", e.InvoicingTransactionSigned = "invoicing_transaction_signed", e.LedgerSyncActivated = "ledger_sync_activated", e.Onboarding = "onboarding", e.OpenLedgerSync = "open_ledger_sync", e.OpenSession = "open_session", e.TransactionFlowCompletion = "transaction_flow_completion", e.TransactionFlowInitialization = "transaction_flow_initialization", e.TypedMessageFlowCompletion = "typed_message_flow_completion", e.TypedMessageFlowInitialization = "typed_message_flow_initialization", e.ViewTransactionDetailsClicked = "view_transaction_details_clicked", e.ViewAllTransactionsClicked = "view_all_transactions_clicked", e.ViewAllTransactionsRedirectConfirmed = "view_all_transactions_redirect_confirmed", e.ViewAllTransactionsRedirectCancelled = "view_all_transactions_redirect_cancelled", e.WalletActionClicked = "wallet_action_clicked", e.WalletRedirectConfirmed = "wallet_redirect_confirmed", e.WalletRedirectCancelled = "wallet_redirect_cancelled", e.MobileRedirectLedgerWallet = "mobile_redirect_ledger_wallet", e.LanguageChanged = "language_changed", e.CurrencyChanged = "currency_changed", e;
|
|
2737
|
-
}({}),
|
|
2756
|
+
}({}), q = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/, jr = /^[0-9a-f]+$/, Mr = /^[1-9A-HJ-NP-Za-km-z]+$/, Nr = y.enum(["ethereum", "solana"]), Pr = {
|
|
2738
2757
|
ethereum: {
|
|
2739
2758
|
pattern: jr,
|
|
2740
2759
|
message: "Transaction hash must be lowercase hex without 0x prefix"
|
|
@@ -2752,11 +2771,11 @@ function Fr(e, t) {
|
|
|
2752
2771
|
message: r
|
|
2753
2772
|
});
|
|
2754
2773
|
}
|
|
2755
|
-
var
|
|
2756
|
-
event_id: y.string().regex(
|
|
2774
|
+
var J = y.object({
|
|
2775
|
+
event_id: y.string().regex(q, "Invalid UUID format"),
|
|
2757
2776
|
transaction_dapp_id: y.string(),
|
|
2758
2777
|
timestamp_ms: y.number().int().nonnegative()
|
|
2759
|
-
}), Ir =
|
|
2778
|
+
}), Ir = J.extend({
|
|
2760
2779
|
event_type: y.literal("invoicing_transaction_signed"),
|
|
2761
2780
|
ledger_sync_user_id: y.string().optional(),
|
|
2762
2781
|
blockchain_network_selected: Nr,
|
|
@@ -2764,50 +2783,50 @@ var q = y.object({
|
|
|
2764
2783
|
transaction_hash: y.string(),
|
|
2765
2784
|
recipient_address: y.string(),
|
|
2766
2785
|
unsigned_transaction_hash: y.string().regex(jr, "Sha256 hash without 0x prefix")
|
|
2767
|
-
}).strict().superRefine(Fr), Lr =
|
|
2786
|
+
}).strict().superRefine(Fr), Lr = J.extend({ event_type: y.literal("consent_given") }).strict(), Rr = J.extend({
|
|
2768
2787
|
event_type: y.literal("consent_removed"),
|
|
2769
2788
|
ledger_sync_user_id: y.string().optional()
|
|
2770
|
-
}).strict(), zr =
|
|
2789
|
+
}).strict(), zr = J.extend({
|
|
2771
2790
|
event_type: y.literal("floating_button_clicked"),
|
|
2772
|
-
session_id: y.string().regex(
|
|
2773
|
-
}).strict(), Br =
|
|
2791
|
+
session_id: y.string().regex(q, "Invalid UUID format")
|
|
2792
|
+
}).strict(), Br = J.extend({
|
|
2774
2793
|
event_type: y.literal("open_session"),
|
|
2775
|
-
session_id: y.string().regex(
|
|
2776
|
-
}).strict(), Vr =
|
|
2794
|
+
session_id: y.string().regex(q, "Invalid UUID format")
|
|
2795
|
+
}).strict(), Vr = J.extend({
|
|
2777
2796
|
event_type: y.literal("open_ledger_sync"),
|
|
2778
|
-
session_id: y.string().regex(
|
|
2779
|
-
}).strict(), Hr =
|
|
2797
|
+
session_id: y.string().regex(q, "Invalid UUID format")
|
|
2798
|
+
}).strict(), Hr = J.extend({
|
|
2780
2799
|
event_type: y.literal("ledger_sync_activated"),
|
|
2781
|
-
session_id: y.string().regex(
|
|
2800
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2782
2801
|
ledger_sync_user_id: y.string().optional()
|
|
2783
|
-
}).strict(), Ur =
|
|
2802
|
+
}).strict(), Ur = J.extend({
|
|
2784
2803
|
event_type: y.literal("onboarding"),
|
|
2785
|
-
session_id: y.string().regex(
|
|
2804
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2786
2805
|
ledger_sync_user_id: y.string().optional(),
|
|
2787
2806
|
blockchain_network_selected: Nr,
|
|
2788
2807
|
chain_id: y.string().nullable()
|
|
2789
|
-
}).strict(), Wr =
|
|
2808
|
+
}).strict(), Wr = J.extend({
|
|
2790
2809
|
event_type: y.literal("transaction_flow_initialization"),
|
|
2791
|
-
session_id: y.string().regex(
|
|
2810
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2792
2811
|
ledger_sync_user_id: y.string().optional(),
|
|
2793
2812
|
blockchain_network_selected: Nr,
|
|
2794
2813
|
chain_id: y.string().nullable()
|
|
2795
|
-
}).strict(), Gr =
|
|
2814
|
+
}).strict(), Gr = J.extend({
|
|
2796
2815
|
event_type: y.literal("transaction_flow_completion"),
|
|
2797
|
-
session_id: y.string().regex(
|
|
2816
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2798
2817
|
ledger_sync_user_id: y.string().optional(),
|
|
2799
2818
|
blockchain_network_selected: Nr,
|
|
2800
2819
|
chain_id: y.string().nullable()
|
|
2801
|
-
}).strict(), Kr =
|
|
2820
|
+
}).strict(), Kr = J.extend({
|
|
2802
2821
|
event_type: y.literal("typed_message_flow_initialization"),
|
|
2803
|
-
session_id: y.string().regex(
|
|
2822
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2804
2823
|
ledger_sync_user_id: y.string().optional(),
|
|
2805
2824
|
blockchain_network_selected: y.literal("ethereum"),
|
|
2806
2825
|
chain_id: y.string().nullable(),
|
|
2807
2826
|
typed_message_hash: y.string().regex(jr, "Sha256 hash without 0x prefix")
|
|
2808
|
-
}).strict(), qr =
|
|
2827
|
+
}).strict(), qr = J.extend({
|
|
2809
2828
|
event_type: y.literal("typed_message_flow_completion"),
|
|
2810
|
-
session_id: y.string().regex(
|
|
2829
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2811
2830
|
ledger_sync_user_id: y.string().optional(),
|
|
2812
2831
|
blockchain_network_selected: y.literal("ethereum"),
|
|
2813
2832
|
chain_id: y.string().nullable(),
|
|
@@ -2819,50 +2838,50 @@ var q = y.object({
|
|
|
2819
2838
|
"buy",
|
|
2820
2839
|
"earn",
|
|
2821
2840
|
"sell"
|
|
2822
|
-
]), Yr =
|
|
2841
|
+
]), Yr = J.extend({
|
|
2823
2842
|
event_type: y.literal("wallet_action_clicked"),
|
|
2824
|
-
session_id: y.string().regex(
|
|
2843
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2825
2844
|
wallet_action: Jr
|
|
2826
|
-
}).strict(), Xr =
|
|
2845
|
+
}).strict(), Xr = J.extend({
|
|
2827
2846
|
event_type: y.literal("wallet_redirect_confirmed"),
|
|
2828
|
-
session_id: y.string().regex(
|
|
2847
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2829
2848
|
wallet_action: Jr
|
|
2830
|
-
}).strict(), Zr =
|
|
2849
|
+
}).strict(), Zr = J.extend({
|
|
2831
2850
|
event_type: y.literal("wallet_redirect_cancelled"),
|
|
2832
|
-
session_id: y.string().regex(
|
|
2851
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2833
2852
|
wallet_action: Jr
|
|
2834
|
-
}).strict(), Qr =
|
|
2853
|
+
}).strict(), Qr = J.extend({ event_type: y.literal("mobile_redirect_ledger_wallet") }).strict(), $r = J.extend({
|
|
2835
2854
|
event_type: y.literal("view_transaction_details_clicked"),
|
|
2836
|
-
session_id: y.string().regex(
|
|
2855
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2837
2856
|
ledger_sync_user_id: y.string().optional(),
|
|
2838
2857
|
blockchain_network_selected: Nr,
|
|
2839
2858
|
chain_id: y.string().nullable(),
|
|
2840
2859
|
transaction_hash: y.string()
|
|
2841
|
-
}).strict().superRefine(Fr), ei =
|
|
2860
|
+
}).strict().superRefine(Fr), ei = J.extend({
|
|
2842
2861
|
event_type: y.literal("view_all_transactions_clicked"),
|
|
2843
|
-
session_id: y.string().regex(
|
|
2862
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2844
2863
|
ledger_sync_user_id: y.string().optional(),
|
|
2845
2864
|
currency_id: y.string().min(1),
|
|
2846
2865
|
account_address: y.string().min(1)
|
|
2847
|
-
}).strict(), ti =
|
|
2866
|
+
}).strict(), ti = J.extend({
|
|
2848
2867
|
event_type: y.literal("view_all_transactions_redirect_confirmed"),
|
|
2849
|
-
session_id: y.string().regex(
|
|
2868
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2850
2869
|
ledger_sync_user_id: y.string().optional(),
|
|
2851
2870
|
currency_id: y.string().min(1),
|
|
2852
2871
|
account_address: y.string().min(1)
|
|
2853
|
-
}).strict(), ni =
|
|
2872
|
+
}).strict(), ni = J.extend({
|
|
2854
2873
|
event_type: y.literal("view_all_transactions_redirect_cancelled"),
|
|
2855
|
-
session_id: y.string().regex(
|
|
2874
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2856
2875
|
ledger_sync_user_id: y.string().optional(),
|
|
2857
2876
|
currency_id: y.string().min(1),
|
|
2858
2877
|
account_address: y.string().min(1)
|
|
2859
|
-
}).strict(), ri =
|
|
2878
|
+
}).strict(), ri = J.extend({
|
|
2860
2879
|
event_type: y.literal("language_changed"),
|
|
2861
|
-
session_id: y.string().regex(
|
|
2880
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2862
2881
|
language_key: y.string().min(1)
|
|
2863
|
-
}).strict(), ii =
|
|
2882
|
+
}).strict(), ii = J.extend({
|
|
2864
2883
|
event_type: y.literal("currency_changed"),
|
|
2865
|
-
session_id: y.string().regex(
|
|
2884
|
+
session_id: y.string().regex(q, "Invalid UUID format"),
|
|
2866
2885
|
currency_code: y.string().min(1)
|
|
2867
2886
|
}).strict(), ai = y.discriminatedUnion("event_type", [
|
|
2868
2887
|
Ir,
|
|
@@ -2895,7 +2914,7 @@ function oi(e, t) {
|
|
|
2895
2914
|
}
|
|
2896
2915
|
//#endregion
|
|
2897
2916
|
//#region src/internal/event-tracking/utils.ts
|
|
2898
|
-
function
|
|
2917
|
+
function Y() {
|
|
2899
2918
|
return crypto.randomUUID();
|
|
2900
2919
|
}
|
|
2901
2920
|
//#endregion
|
|
@@ -2910,7 +2929,7 @@ function li(e) {
|
|
|
2910
2929
|
let t = new TextEncoder().encode(e), n = c(t);
|
|
2911
2930
|
return Ve(n);
|
|
2912
2931
|
}
|
|
2913
|
-
var
|
|
2932
|
+
var X = class {
|
|
2914
2933
|
static validateEvent(e) {
|
|
2915
2934
|
let t = ai.safeParse(e.data);
|
|
2916
2935
|
return t.success ? { success: !0 } : {
|
|
@@ -2923,145 +2942,145 @@ var Y = class {
|
|
|
2923
2942
|
}
|
|
2924
2943
|
static createOpenSessionEvent(e) {
|
|
2925
2944
|
let t = {
|
|
2926
|
-
event_id:
|
|
2945
|
+
event_id: Y(),
|
|
2927
2946
|
transaction_dapp_id: e.dAppId,
|
|
2928
2947
|
timestamp_ms: Date.now(),
|
|
2929
|
-
event_type:
|
|
2948
|
+
event_type: K.OpenSession,
|
|
2930
2949
|
session_id: e.sessionId
|
|
2931
2950
|
};
|
|
2932
2951
|
return {
|
|
2933
|
-
name:
|
|
2934
|
-
type:
|
|
2952
|
+
name: K.OpenSession,
|
|
2953
|
+
type: K.OpenSession,
|
|
2935
2954
|
data: t
|
|
2936
2955
|
};
|
|
2937
2956
|
}
|
|
2938
2957
|
static createOpenLedgerSyncEvent(e) {
|
|
2939
2958
|
let t = {
|
|
2940
|
-
event_id:
|
|
2959
|
+
event_id: Y(),
|
|
2941
2960
|
transaction_dapp_id: e.dAppId,
|
|
2942
2961
|
timestamp_ms: Date.now(),
|
|
2943
|
-
event_type:
|
|
2962
|
+
event_type: K.OpenLedgerSync,
|
|
2944
2963
|
session_id: e.sessionId
|
|
2945
2964
|
};
|
|
2946
2965
|
return {
|
|
2947
|
-
name:
|
|
2948
|
-
type:
|
|
2966
|
+
name: K.OpenLedgerSync,
|
|
2967
|
+
type: K.OpenLedgerSync,
|
|
2949
2968
|
data: t
|
|
2950
2969
|
};
|
|
2951
2970
|
}
|
|
2952
2971
|
static createLedgerSyncActivatedEvent(e) {
|
|
2953
2972
|
let t = {
|
|
2954
|
-
event_id:
|
|
2973
|
+
event_id: Y(),
|
|
2955
2974
|
transaction_dapp_id: e.dAppId,
|
|
2956
2975
|
timestamp_ms: Date.now(),
|
|
2957
|
-
event_type:
|
|
2976
|
+
event_type: K.LedgerSyncActivated,
|
|
2958
2977
|
session_id: e.sessionId,
|
|
2959
2978
|
ledger_sync_user_id: e.trustChainId
|
|
2960
2979
|
};
|
|
2961
2980
|
return {
|
|
2962
|
-
name:
|
|
2963
|
-
type:
|
|
2981
|
+
name: K.LedgerSyncActivated,
|
|
2982
|
+
type: K.LedgerSyncActivated,
|
|
2964
2983
|
data: t
|
|
2965
2984
|
};
|
|
2966
2985
|
}
|
|
2967
2986
|
static createConsentGivenEvent(e) {
|
|
2968
2987
|
let t = {
|
|
2969
|
-
event_id:
|
|
2988
|
+
event_id: Y(),
|
|
2970
2989
|
transaction_dapp_id: e.dAppId,
|
|
2971
2990
|
timestamp_ms: Date.now(),
|
|
2972
|
-
event_type:
|
|
2991
|
+
event_type: K.ConsentGiven
|
|
2973
2992
|
};
|
|
2974
2993
|
return {
|
|
2975
|
-
name:
|
|
2976
|
-
type:
|
|
2994
|
+
name: K.ConsentGiven,
|
|
2995
|
+
type: K.ConsentGiven,
|
|
2977
2996
|
data: t
|
|
2978
2997
|
};
|
|
2979
2998
|
}
|
|
2980
2999
|
static createConsentRemovedEvent(e) {
|
|
2981
3000
|
let t = {
|
|
2982
|
-
event_id:
|
|
3001
|
+
event_id: Y(),
|
|
2983
3002
|
transaction_dapp_id: e.dAppId,
|
|
2984
3003
|
timestamp_ms: Date.now(),
|
|
2985
|
-
event_type:
|
|
3004
|
+
event_type: K.ConsentRemoved,
|
|
2986
3005
|
ledger_sync_user_id: e.trustChainId
|
|
2987
3006
|
};
|
|
2988
3007
|
return {
|
|
2989
|
-
name:
|
|
2990
|
-
type:
|
|
3008
|
+
name: K.ConsentRemoved,
|
|
3009
|
+
type: K.ConsentRemoved,
|
|
2991
3010
|
data: t
|
|
2992
3011
|
};
|
|
2993
3012
|
}
|
|
2994
3013
|
static createFloatingButtonClickEvent(e) {
|
|
2995
3014
|
let t = {
|
|
2996
|
-
event_id:
|
|
3015
|
+
event_id: Y(),
|
|
2997
3016
|
transaction_dapp_id: e.dAppId,
|
|
2998
3017
|
timestamp_ms: Date.now(),
|
|
2999
|
-
event_type:
|
|
3018
|
+
event_type: K.FloatingButtonClick,
|
|
3000
3019
|
session_id: e.sessionId
|
|
3001
3020
|
};
|
|
3002
3021
|
return {
|
|
3003
|
-
name:
|
|
3004
|
-
type:
|
|
3022
|
+
name: K.FloatingButtonClick,
|
|
3023
|
+
type: K.FloatingButtonClick,
|
|
3005
3024
|
data: t
|
|
3006
3025
|
};
|
|
3007
3026
|
}
|
|
3008
3027
|
static createOnboardingEvent(e) {
|
|
3009
3028
|
let t = {
|
|
3010
|
-
event_id:
|
|
3029
|
+
event_id: Y(),
|
|
3011
3030
|
transaction_dapp_id: e.dAppId,
|
|
3012
3031
|
timestamp_ms: Date.now(),
|
|
3013
|
-
event_type:
|
|
3032
|
+
event_type: K.Onboarding,
|
|
3014
3033
|
session_id: e.sessionId,
|
|
3015
3034
|
ledger_sync_user_id: e.trustChainId,
|
|
3016
3035
|
blockchain_network_selected: e.family,
|
|
3017
3036
|
chain_id: e.chainId
|
|
3018
3037
|
};
|
|
3019
3038
|
return {
|
|
3020
|
-
name:
|
|
3021
|
-
type:
|
|
3039
|
+
name: K.Onboarding,
|
|
3040
|
+
type: K.Onboarding,
|
|
3022
3041
|
data: t
|
|
3023
3042
|
};
|
|
3024
3043
|
}
|
|
3025
3044
|
static createTransactionFlowInitializationEvent(e) {
|
|
3026
3045
|
let t = {
|
|
3027
|
-
event_id:
|
|
3046
|
+
event_id: Y(),
|
|
3028
3047
|
transaction_dapp_id: e.dAppId,
|
|
3029
3048
|
timestamp_ms: Date.now(),
|
|
3030
|
-
event_type:
|
|
3049
|
+
event_type: K.TransactionFlowInitialization,
|
|
3031
3050
|
session_id: e.sessionId,
|
|
3032
3051
|
ledger_sync_user_id: e.trustChainId,
|
|
3033
3052
|
blockchain_network_selected: e.family,
|
|
3034
3053
|
chain_id: e.chainId
|
|
3035
3054
|
};
|
|
3036
3055
|
return {
|
|
3037
|
-
name:
|
|
3038
|
-
type:
|
|
3056
|
+
name: K.TransactionFlowInitialization,
|
|
3057
|
+
type: K.TransactionFlowInitialization,
|
|
3039
3058
|
data: t
|
|
3040
3059
|
};
|
|
3041
3060
|
}
|
|
3042
3061
|
static createTransactionFlowCompletionEvent(e) {
|
|
3043
3062
|
let t = {
|
|
3044
|
-
event_id:
|
|
3063
|
+
event_id: Y(),
|
|
3045
3064
|
transaction_dapp_id: e.dAppId,
|
|
3046
3065
|
timestamp_ms: Date.now(),
|
|
3047
|
-
event_type:
|
|
3066
|
+
event_type: K.TransactionFlowCompletion,
|
|
3048
3067
|
session_id: e.sessionId,
|
|
3049
3068
|
ledger_sync_user_id: e.trustChainId,
|
|
3050
3069
|
blockchain_network_selected: e.family,
|
|
3051
3070
|
chain_id: e.chainId
|
|
3052
3071
|
};
|
|
3053
3072
|
return {
|
|
3054
|
-
name:
|
|
3055
|
-
type:
|
|
3073
|
+
name: K.TransactionFlowCompletion,
|
|
3074
|
+
type: K.TransactionFlowCompletion,
|
|
3056
3075
|
data: t
|
|
3057
3076
|
};
|
|
3058
3077
|
}
|
|
3059
3078
|
static createInvoicingTransactionSignedEvent(e) {
|
|
3060
3079
|
let t = {
|
|
3061
|
-
event_id:
|
|
3080
|
+
event_id: Y(),
|
|
3062
3081
|
transaction_dapp_id: e.dAppId,
|
|
3063
3082
|
timestamp_ms: Date.now(),
|
|
3064
|
-
event_type:
|
|
3083
|
+
event_type: K.InvoicingTransactionSigned,
|
|
3065
3084
|
blockchain_network_selected: e.family,
|
|
3066
3085
|
chain_id: e.chainId,
|
|
3067
3086
|
transaction_hash: ci(e.transactionHash, e.family),
|
|
@@ -3069,17 +3088,17 @@ var Y = class {
|
|
|
3069
3088
|
unsigned_transaction_hash: si(e.unsignedTransactionHash)
|
|
3070
3089
|
};
|
|
3071
3090
|
return {
|
|
3072
|
-
name:
|
|
3073
|
-
type:
|
|
3091
|
+
name: K.InvoicingTransactionSigned,
|
|
3092
|
+
type: K.InvoicingTransactionSigned,
|
|
3074
3093
|
data: t
|
|
3075
3094
|
};
|
|
3076
3095
|
}
|
|
3077
3096
|
static createViewTransactionDetailsClickedEvent(e) {
|
|
3078
3097
|
let t = {
|
|
3079
|
-
event_id:
|
|
3098
|
+
event_id: Y(),
|
|
3080
3099
|
transaction_dapp_id: e.dAppId,
|
|
3081
3100
|
timestamp_ms: Date.now(),
|
|
3082
|
-
event_type:
|
|
3101
|
+
event_type: K.ViewTransactionDetailsClicked,
|
|
3083
3102
|
session_id: e.sessionId,
|
|
3084
3103
|
ledger_sync_user_id: e.trustChainId,
|
|
3085
3104
|
blockchain_network_selected: e.family,
|
|
@@ -3087,68 +3106,68 @@ var Y = class {
|
|
|
3087
3106
|
transaction_hash: ci(e.transactionHash, e.family)
|
|
3088
3107
|
};
|
|
3089
3108
|
return {
|
|
3090
|
-
name:
|
|
3091
|
-
type:
|
|
3109
|
+
name: K.ViewTransactionDetailsClicked,
|
|
3110
|
+
type: K.ViewTransactionDetailsClicked,
|
|
3092
3111
|
data: t
|
|
3093
3112
|
};
|
|
3094
3113
|
}
|
|
3095
3114
|
static createViewAllTransactionsClickedEvent(e) {
|
|
3096
3115
|
let t = {
|
|
3097
|
-
event_id:
|
|
3116
|
+
event_id: Y(),
|
|
3098
3117
|
transaction_dapp_id: e.dAppId,
|
|
3099
3118
|
timestamp_ms: Date.now(),
|
|
3100
|
-
event_type:
|
|
3119
|
+
event_type: K.ViewAllTransactionsClicked,
|
|
3101
3120
|
session_id: e.sessionId,
|
|
3102
3121
|
ledger_sync_user_id: e.trustChainId,
|
|
3103
3122
|
currency_id: e.currencyId,
|
|
3104
3123
|
account_address: e.accountAddress.toLowerCase()
|
|
3105
3124
|
};
|
|
3106
3125
|
return {
|
|
3107
|
-
name:
|
|
3108
|
-
type:
|
|
3126
|
+
name: K.ViewAllTransactionsClicked,
|
|
3127
|
+
type: K.ViewAllTransactionsClicked,
|
|
3109
3128
|
data: t
|
|
3110
3129
|
};
|
|
3111
3130
|
}
|
|
3112
3131
|
static createViewAllTransactionsRedirectConfirmedEvent(e) {
|
|
3113
3132
|
let t = {
|
|
3114
|
-
event_id:
|
|
3133
|
+
event_id: Y(),
|
|
3115
3134
|
transaction_dapp_id: e.dAppId,
|
|
3116
3135
|
timestamp_ms: Date.now(),
|
|
3117
|
-
event_type:
|
|
3136
|
+
event_type: K.ViewAllTransactionsRedirectConfirmed,
|
|
3118
3137
|
session_id: e.sessionId,
|
|
3119
3138
|
ledger_sync_user_id: e.trustChainId,
|
|
3120
3139
|
currency_id: e.currencyId,
|
|
3121
3140
|
account_address: e.accountAddress.toLowerCase()
|
|
3122
3141
|
};
|
|
3123
3142
|
return {
|
|
3124
|
-
name:
|
|
3125
|
-
type:
|
|
3143
|
+
name: K.ViewAllTransactionsRedirectConfirmed,
|
|
3144
|
+
type: K.ViewAllTransactionsRedirectConfirmed,
|
|
3126
3145
|
data: t
|
|
3127
3146
|
};
|
|
3128
3147
|
}
|
|
3129
3148
|
static createViewAllTransactionsRedirectCancelledEvent(e) {
|
|
3130
3149
|
let t = {
|
|
3131
|
-
event_id:
|
|
3150
|
+
event_id: Y(),
|
|
3132
3151
|
transaction_dapp_id: e.dAppId,
|
|
3133
3152
|
timestamp_ms: Date.now(),
|
|
3134
|
-
event_type:
|
|
3153
|
+
event_type: K.ViewAllTransactionsRedirectCancelled,
|
|
3135
3154
|
session_id: e.sessionId,
|
|
3136
3155
|
ledger_sync_user_id: e.trustChainId,
|
|
3137
3156
|
currency_id: e.currencyId,
|
|
3138
3157
|
account_address: e.accountAddress.toLowerCase()
|
|
3139
3158
|
};
|
|
3140
3159
|
return {
|
|
3141
|
-
name:
|
|
3142
|
-
type:
|
|
3160
|
+
name: K.ViewAllTransactionsRedirectCancelled,
|
|
3161
|
+
type: K.ViewAllTransactionsRedirectCancelled,
|
|
3143
3162
|
data: t
|
|
3144
3163
|
};
|
|
3145
3164
|
}
|
|
3146
3165
|
static createTypedMessageFlowInitializationEvent(e) {
|
|
3147
3166
|
let t = {
|
|
3148
|
-
event_id:
|
|
3167
|
+
event_id: Y(),
|
|
3149
3168
|
transaction_dapp_id: e.dAppId,
|
|
3150
3169
|
timestamp_ms: Date.now(),
|
|
3151
|
-
event_type:
|
|
3170
|
+
event_type: K.TypedMessageFlowInitialization,
|
|
3152
3171
|
session_id: e.sessionId,
|
|
3153
3172
|
ledger_sync_user_id: e.trustChainId,
|
|
3154
3173
|
blockchain_network_selected: e.family,
|
|
@@ -3156,17 +3175,17 @@ var Y = class {
|
|
|
3156
3175
|
typed_message_hash: si(e.typedMessageHash)
|
|
3157
3176
|
};
|
|
3158
3177
|
return {
|
|
3159
|
-
name:
|
|
3160
|
-
type:
|
|
3178
|
+
name: K.TypedMessageFlowInitialization,
|
|
3179
|
+
type: K.TypedMessageFlowInitialization,
|
|
3161
3180
|
data: t
|
|
3162
3181
|
};
|
|
3163
3182
|
}
|
|
3164
3183
|
static createTypedMessageFlowCompletionEvent(e) {
|
|
3165
3184
|
let t = {
|
|
3166
|
-
event_id:
|
|
3185
|
+
event_id: Y(),
|
|
3167
3186
|
transaction_dapp_id: e.dAppId,
|
|
3168
3187
|
timestamp_ms: Date.now(),
|
|
3169
|
-
event_type:
|
|
3188
|
+
event_type: K.TypedMessageFlowCompletion,
|
|
3170
3189
|
session_id: e.sessionId,
|
|
3171
3190
|
ledger_sync_user_id: e.trustChainId,
|
|
3172
3191
|
blockchain_network_selected: e.family,
|
|
@@ -3174,96 +3193,96 @@ var Y = class {
|
|
|
3174
3193
|
typed_message_hash: si(e.typedMessageHash)
|
|
3175
3194
|
};
|
|
3176
3195
|
return {
|
|
3177
|
-
name:
|
|
3178
|
-
type:
|
|
3196
|
+
name: K.TypedMessageFlowCompletion,
|
|
3197
|
+
type: K.TypedMessageFlowCompletion,
|
|
3179
3198
|
data: t
|
|
3180
3199
|
};
|
|
3181
3200
|
}
|
|
3182
3201
|
static createWalletActionClickedEvent(e) {
|
|
3183
3202
|
let t = {
|
|
3184
|
-
event_id:
|
|
3203
|
+
event_id: Y(),
|
|
3185
3204
|
transaction_dapp_id: e.dAppId,
|
|
3186
3205
|
timestamp_ms: Date.now(),
|
|
3187
|
-
event_type:
|
|
3206
|
+
event_type: K.WalletActionClicked,
|
|
3188
3207
|
session_id: e.sessionId,
|
|
3189
3208
|
wallet_action: e.walletAction
|
|
3190
3209
|
};
|
|
3191
3210
|
return {
|
|
3192
|
-
name:
|
|
3193
|
-
type:
|
|
3211
|
+
name: K.WalletActionClicked,
|
|
3212
|
+
type: K.WalletActionClicked,
|
|
3194
3213
|
data: t
|
|
3195
3214
|
};
|
|
3196
3215
|
}
|
|
3197
3216
|
static createWalletRedirectConfirmedEvent(e) {
|
|
3198
3217
|
let t = {
|
|
3199
|
-
event_id:
|
|
3218
|
+
event_id: Y(),
|
|
3200
3219
|
transaction_dapp_id: e.dAppId,
|
|
3201
3220
|
timestamp_ms: Date.now(),
|
|
3202
|
-
event_type:
|
|
3221
|
+
event_type: K.WalletRedirectConfirmed,
|
|
3203
3222
|
session_id: e.sessionId,
|
|
3204
3223
|
wallet_action: e.walletAction
|
|
3205
3224
|
};
|
|
3206
3225
|
return {
|
|
3207
|
-
name:
|
|
3208
|
-
type:
|
|
3226
|
+
name: K.WalletRedirectConfirmed,
|
|
3227
|
+
type: K.WalletRedirectConfirmed,
|
|
3209
3228
|
data: t
|
|
3210
3229
|
};
|
|
3211
3230
|
}
|
|
3212
3231
|
static createCurrencyChangedEvent(e) {
|
|
3213
3232
|
let t = {
|
|
3214
|
-
event_id:
|
|
3233
|
+
event_id: Y(),
|
|
3215
3234
|
transaction_dapp_id: e.dAppId,
|
|
3216
3235
|
timestamp_ms: Date.now(),
|
|
3217
|
-
event_type:
|
|
3236
|
+
event_type: K.CurrencyChanged,
|
|
3218
3237
|
session_id: e.sessionId,
|
|
3219
3238
|
currency_code: e.currencyCode
|
|
3220
3239
|
};
|
|
3221
3240
|
return {
|
|
3222
|
-
name:
|
|
3223
|
-
type:
|
|
3241
|
+
name: K.CurrencyChanged,
|
|
3242
|
+
type: K.CurrencyChanged,
|
|
3224
3243
|
data: t
|
|
3225
3244
|
};
|
|
3226
3245
|
}
|
|
3227
3246
|
static createLanguageChangedEvent(e) {
|
|
3228
3247
|
let t = {
|
|
3229
|
-
event_id:
|
|
3248
|
+
event_id: Y(),
|
|
3230
3249
|
transaction_dapp_id: e.dAppId,
|
|
3231
3250
|
timestamp_ms: Date.now(),
|
|
3232
|
-
event_type:
|
|
3251
|
+
event_type: K.LanguageChanged,
|
|
3233
3252
|
session_id: e.sessionId,
|
|
3234
3253
|
language_key: e.languageKey
|
|
3235
3254
|
};
|
|
3236
3255
|
return {
|
|
3237
|
-
name:
|
|
3238
|
-
type:
|
|
3256
|
+
name: K.LanguageChanged,
|
|
3257
|
+
type: K.LanguageChanged,
|
|
3239
3258
|
data: t
|
|
3240
3259
|
};
|
|
3241
3260
|
}
|
|
3242
3261
|
static createMobileRedirectLedgerWalletEvent(e) {
|
|
3243
3262
|
let t = {
|
|
3244
|
-
event_id:
|
|
3263
|
+
event_id: Y(),
|
|
3245
3264
|
transaction_dapp_id: e.dAppId,
|
|
3246
3265
|
timestamp_ms: Date.now(),
|
|
3247
|
-
event_type:
|
|
3266
|
+
event_type: K.MobileRedirectLedgerWallet
|
|
3248
3267
|
};
|
|
3249
3268
|
return {
|
|
3250
3269
|
name: "Mobile Redirect Ledger Wallet",
|
|
3251
|
-
type:
|
|
3270
|
+
type: K.MobileRedirectLedgerWallet,
|
|
3252
3271
|
data: t
|
|
3253
3272
|
};
|
|
3254
3273
|
}
|
|
3255
3274
|
static createWalletRedirectCancelledEvent(e) {
|
|
3256
3275
|
let t = {
|
|
3257
|
-
event_id:
|
|
3276
|
+
event_id: Y(),
|
|
3258
3277
|
transaction_dapp_id: e.dAppId,
|
|
3259
3278
|
timestamp_ms: Date.now(),
|
|
3260
|
-
event_type:
|
|
3279
|
+
event_type: K.WalletRedirectCancelled,
|
|
3261
3280
|
session_id: e.sessionId,
|
|
3262
3281
|
wallet_action: e.walletAction
|
|
3263
3282
|
};
|
|
3264
3283
|
return {
|
|
3265
|
-
name:
|
|
3266
|
-
type:
|
|
3284
|
+
name: K.WalletRedirectCancelled,
|
|
3285
|
+
type: K.WalletRedirectCancelled,
|
|
3267
3286
|
data: t
|
|
3268
3287
|
};
|
|
3269
3288
|
}
|
|
@@ -3275,10 +3294,10 @@ var Y = class {
|
|
|
3275
3294
|
config;
|
|
3276
3295
|
contextService;
|
|
3277
3296
|
static ALWAYS_TRACKED_EVENTS = [
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3297
|
+
K.InvoicingTransactionSigned,
|
|
3298
|
+
K.ErrorOccurred,
|
|
3299
|
+
K.ConsentGiven,
|
|
3300
|
+
K.MobileRedirectLedgerWallet
|
|
3282
3301
|
];
|
|
3283
3302
|
logger;
|
|
3284
3303
|
_sessionId;
|
|
@@ -3286,7 +3305,7 @@ var Y = class {
|
|
|
3286
3305
|
isFlushing = !1;
|
|
3287
3306
|
processingPromise = Promise.resolve();
|
|
3288
3307
|
constructor(e, t, n, r) {
|
|
3289
|
-
this.backendService = e, this.config = t, this.contextService = r, this.logger = n("Event Tracking"), this._sessionId =
|
|
3308
|
+
this.backendService = e, this.config = t, this.contextService = r, this.logger = n("Event Tracking"), this._sessionId = Y(), this.subscribeToContextChanges();
|
|
3290
3309
|
}
|
|
3291
3310
|
getSessionId() {
|
|
3292
3311
|
return this._sessionId;
|
|
@@ -3325,7 +3344,7 @@ var Y = class {
|
|
|
3325
3344
|
}
|
|
3326
3345
|
}
|
|
3327
3346
|
isConsentGivenEvent(e) {
|
|
3328
|
-
return e.type ===
|
|
3347
|
+
return e.type === K.ConsentGiven;
|
|
3329
3348
|
}
|
|
3330
3349
|
isAlwaysTrackedEvent(e) {
|
|
3331
3350
|
return ui.ALWAYS_TRACKED_EVENTS.includes(e.type);
|
|
@@ -3337,7 +3356,7 @@ var Y = class {
|
|
|
3337
3356
|
return this.contextService.getContext().hasTrackingConsent;
|
|
3338
3357
|
}
|
|
3339
3358
|
async processEvent(e) {
|
|
3340
|
-
let t =
|
|
3359
|
+
let t = X.validateEvent(e);
|
|
3341
3360
|
if (!t.success) {
|
|
3342
3361
|
this.logger.error("Event validation failed", {
|
|
3343
3362
|
eventType: e.type,
|
|
@@ -3385,13 +3404,13 @@ var Y = class {
|
|
|
3385
3404
|
e > 0 && (this.logger.debug(`Clearing ${e} queued events (consent refused)`), this.eventQueue = []);
|
|
3386
3405
|
}
|
|
3387
3406
|
};
|
|
3388
|
-
di = ui =
|
|
3407
|
+
di = ui = L([
|
|
3389
3408
|
v(),
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3409
|
+
I(0, _(En.BackendService)),
|
|
3410
|
+
I(1, _(k.Config)),
|
|
3411
|
+
I(2, _(N.LoggerPublisher)),
|
|
3412
|
+
I(3, _(A.ContextService)),
|
|
3413
|
+
F("design:paramtypes", [
|
|
3395
3414
|
Object,
|
|
3396
3415
|
Object,
|
|
3397
3416
|
Object,
|
|
@@ -3408,7 +3427,7 @@ var fi = class {
|
|
|
3408
3427
|
await new Promise((e) => setTimeout(e, 10));
|
|
3409
3428
|
}
|
|
3410
3429
|
};
|
|
3411
|
-
fi =
|
|
3430
|
+
fi = L([v()], fi);
|
|
3412
3431
|
//#endregion
|
|
3413
3432
|
//#region src/internal/event-tracking/use-case/TrackConsentGiven.ts
|
|
3414
3433
|
var pi = class {
|
|
@@ -3419,19 +3438,19 @@ var pi = class {
|
|
|
3419
3438
|
this.eventTrackingService = t, this.config = n, this.logger = e("TrackConsentGiven UseCase");
|
|
3420
3439
|
}
|
|
3421
3440
|
async execute() {
|
|
3422
|
-
let e = this.eventTrackingService.getSessionId(), t =
|
|
3441
|
+
let e = this.eventTrackingService.getSessionId(), t = X.createConsentGivenEvent({
|
|
3423
3442
|
dAppId: this.config.dAppIdentifier,
|
|
3424
3443
|
sessionId: e
|
|
3425
3444
|
});
|
|
3426
3445
|
this.logger.debug("Tracking consent given event", { event: t }), await this.eventTrackingService.trackEvent(t);
|
|
3427
3446
|
}
|
|
3428
3447
|
};
|
|
3429
|
-
pi =
|
|
3448
|
+
pi = L([
|
|
3430
3449
|
v(),
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3450
|
+
I(0, _(N.LoggerPublisher)),
|
|
3451
|
+
I(1, _(W.EventTrackingService)),
|
|
3452
|
+
I(2, _(k.Config)),
|
|
3453
|
+
F("design:paramtypes", [
|
|
3435
3454
|
Object,
|
|
3436
3455
|
Object,
|
|
3437
3456
|
Object
|
|
@@ -3448,20 +3467,20 @@ var mi = class {
|
|
|
3448
3467
|
this.eventTrackingService = t, this.config = n, this.contextService = r, this.logger = e("TrackConsentRemoved UseCase");
|
|
3449
3468
|
}
|
|
3450
3469
|
async execute() {
|
|
3451
|
-
let e = this.contextService.getContext().trustChainId, t =
|
|
3470
|
+
let e = this.contextService.getContext().trustChainId, t = X.createConsentRemovedEvent({
|
|
3452
3471
|
dAppId: this.config.dAppIdentifier,
|
|
3453
3472
|
trustChainId: e
|
|
3454
3473
|
});
|
|
3455
3474
|
this.logger.debug("Tracking consent removed event", { event: t }), await this.eventTrackingService.trackEvent(t);
|
|
3456
3475
|
}
|
|
3457
3476
|
};
|
|
3458
|
-
mi =
|
|
3477
|
+
mi = L([
|
|
3459
3478
|
v(),
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3479
|
+
I(0, _(N.LoggerPublisher)),
|
|
3480
|
+
I(1, _(W.EventTrackingService)),
|
|
3481
|
+
I(2, _(k.Config)),
|
|
3482
|
+
I(3, _(A.ContextService)),
|
|
3483
|
+
F("design:paramtypes", [
|
|
3465
3484
|
Object,
|
|
3466
3485
|
Object,
|
|
3467
3486
|
Object,
|
|
@@ -3478,7 +3497,7 @@ var hi = class {
|
|
|
3478
3497
|
this.eventTrackingService = t, this.config = n, this.logger = e("TrackCurrencyChanged UseCase");
|
|
3479
3498
|
}
|
|
3480
3499
|
async execute(e) {
|
|
3481
|
-
let t = this.eventTrackingService.getSessionId(), n =
|
|
3500
|
+
let t = this.eventTrackingService.getSessionId(), n = X.createCurrencyChangedEvent({
|
|
3482
3501
|
dAppId: this.config.dAppIdentifier,
|
|
3483
3502
|
sessionId: t,
|
|
3484
3503
|
currencyCode: e
|
|
@@ -3486,12 +3505,12 @@ var hi = class {
|
|
|
3486
3505
|
this.logger.debug("Tracking currency changed event", { event: n }), await this.eventTrackingService.trackEvent(n);
|
|
3487
3506
|
}
|
|
3488
3507
|
};
|
|
3489
|
-
hi =
|
|
3508
|
+
hi = L([
|
|
3490
3509
|
v(),
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3510
|
+
I(0, _(N.LoggerPublisher)),
|
|
3511
|
+
I(1, _(W.EventTrackingService)),
|
|
3512
|
+
I(2, _(k.Config)),
|
|
3513
|
+
F("design:paramtypes", [
|
|
3495
3514
|
Object,
|
|
3496
3515
|
Object,
|
|
3497
3516
|
Object
|
|
@@ -3507,19 +3526,19 @@ var gi = class {
|
|
|
3507
3526
|
this.eventTrackingService = t, this.config = n, this.logger = e("TrackFloatingButtonClick UseCase");
|
|
3508
3527
|
}
|
|
3509
3528
|
async execute() {
|
|
3510
|
-
let e = this.eventTrackingService.getSessionId(), t =
|
|
3529
|
+
let e = this.eventTrackingService.getSessionId(), t = X.createFloatingButtonClickEvent({
|
|
3511
3530
|
dAppId: this.config.dAppIdentifier,
|
|
3512
3531
|
sessionId: e
|
|
3513
3532
|
});
|
|
3514
3533
|
this.logger.debug("Tracking floating button click event", { event: t }), await this.eventTrackingService.trackEvent(t);
|
|
3515
3534
|
}
|
|
3516
3535
|
};
|
|
3517
|
-
gi =
|
|
3536
|
+
gi = L([
|
|
3518
3537
|
v(),
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3538
|
+
I(0, _(N.LoggerPublisher)),
|
|
3539
|
+
I(1, _(W.EventTrackingService)),
|
|
3540
|
+
I(2, _(k.Config)),
|
|
3541
|
+
F("design:paramtypes", [
|
|
3523
3542
|
Object,
|
|
3524
3543
|
Object,
|
|
3525
3544
|
Object
|
|
@@ -3535,7 +3554,7 @@ var _i = class {
|
|
|
3535
3554
|
this.eventTrackingService = t, this.config = n, this.logger = e("TrackLanguageChanged UseCase");
|
|
3536
3555
|
}
|
|
3537
3556
|
async execute(e) {
|
|
3538
|
-
let t = this.eventTrackingService.getSessionId(), n =
|
|
3557
|
+
let t = this.eventTrackingService.getSessionId(), n = X.createLanguageChangedEvent({
|
|
3539
3558
|
dAppId: this.config.dAppIdentifier,
|
|
3540
3559
|
sessionId: t,
|
|
3541
3560
|
languageKey: e
|
|
@@ -3543,12 +3562,12 @@ var _i = class {
|
|
|
3543
3562
|
this.logger.debug("Tracking language changed event", { event: n }), await this.eventTrackingService.trackEvent(n);
|
|
3544
3563
|
}
|
|
3545
3564
|
};
|
|
3546
|
-
_i =
|
|
3565
|
+
_i = L([
|
|
3547
3566
|
v(),
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3567
|
+
I(0, _(N.LoggerPublisher)),
|
|
3568
|
+
I(1, _(W.EventTrackingService)),
|
|
3569
|
+
I(2, _(k.Config)),
|
|
3570
|
+
F("design:paramtypes", [
|
|
3552
3571
|
Object,
|
|
3553
3572
|
Object,
|
|
3554
3573
|
Object
|
|
@@ -3565,7 +3584,7 @@ var vi = class {
|
|
|
3565
3584
|
this.eventTrackingService = t, this.config = n, this.contextService = r, this.logger = e("TrackLedgerSyncActivated UseCase");
|
|
3566
3585
|
}
|
|
3567
3586
|
async execute() {
|
|
3568
|
-
let e = this.eventTrackingService.getSessionId(), t = this.contextService.getContext().trustChainId, n =
|
|
3587
|
+
let e = this.eventTrackingService.getSessionId(), t = this.contextService.getContext().trustChainId, n = X.createLedgerSyncActivatedEvent({
|
|
3569
3588
|
dAppId: this.config.dAppIdentifier,
|
|
3570
3589
|
sessionId: e,
|
|
3571
3590
|
trustChainId: t
|
|
@@ -3573,13 +3592,13 @@ var vi = class {
|
|
|
3573
3592
|
this.logger.debug("Tracking ledger sync activated event", { event: n }), await this.eventTrackingService.trackEvent(n);
|
|
3574
3593
|
}
|
|
3575
3594
|
};
|
|
3576
|
-
vi =
|
|
3595
|
+
vi = L([
|
|
3577
3596
|
v(),
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3597
|
+
I(0, _(N.LoggerPublisher)),
|
|
3598
|
+
I(1, _(W.EventTrackingService)),
|
|
3599
|
+
I(2, _(k.Config)),
|
|
3600
|
+
I(3, _(A.ContextService)),
|
|
3601
|
+
F("design:paramtypes", [
|
|
3583
3602
|
Object,
|
|
3584
3603
|
Object,
|
|
3585
3604
|
Object,
|
|
@@ -3596,19 +3615,19 @@ var yi = class {
|
|
|
3596
3615
|
this.eventTrackingService = t, this.config = n, this.logger = e("TrackLedgerSyncOpened UseCase");
|
|
3597
3616
|
}
|
|
3598
3617
|
async execute() {
|
|
3599
|
-
let e = this.eventTrackingService.getSessionId(), t =
|
|
3618
|
+
let e = this.eventTrackingService.getSessionId(), t = X.createOpenLedgerSyncEvent({
|
|
3600
3619
|
dAppId: this.config.dAppIdentifier,
|
|
3601
3620
|
sessionId: e
|
|
3602
3621
|
});
|
|
3603
3622
|
this.logger.debug("Tracking ledger sync opened event", { event: t }), await this.eventTrackingService.trackEvent(t);
|
|
3604
3623
|
}
|
|
3605
3624
|
};
|
|
3606
|
-
yi =
|
|
3625
|
+
yi = L([
|
|
3607
3626
|
v(),
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3627
|
+
I(0, _(N.LoggerPublisher)),
|
|
3628
|
+
I(1, _(W.EventTrackingService)),
|
|
3629
|
+
I(2, _(k.Config)),
|
|
3630
|
+
F("design:paramtypes", [
|
|
3612
3631
|
Object,
|
|
3613
3632
|
Object,
|
|
3614
3633
|
Object
|
|
@@ -3624,16 +3643,16 @@ var bi = class {
|
|
|
3624
3643
|
this.eventTrackingService = t, this.config = n, this.logger = e("TrackMobileRedirectLedgerWallet UseCase");
|
|
3625
3644
|
}
|
|
3626
3645
|
async execute() {
|
|
3627
|
-
let e =
|
|
3646
|
+
let e = X.createMobileRedirectLedgerWalletEvent({ dAppId: this.config.dAppIdentifier });
|
|
3628
3647
|
this.logger.debug("Tracking mobile redirect to Ledger Wallet event", { event: e }), await this.eventTrackingService.trackEvent(e);
|
|
3629
3648
|
}
|
|
3630
3649
|
};
|
|
3631
|
-
bi =
|
|
3650
|
+
bi = L([
|
|
3632
3651
|
v(),
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3652
|
+
I(0, _(N.LoggerPublisher)),
|
|
3653
|
+
I(1, _(W.EventTrackingService)),
|
|
3654
|
+
I(2, _(k.Config)),
|
|
3655
|
+
F("design:paramtypes", [
|
|
3637
3656
|
Object,
|
|
3638
3657
|
Object,
|
|
3639
3658
|
Object
|
|
@@ -3653,7 +3672,7 @@ var xi = class {
|
|
|
3653
3672
|
async execute(e, t) {
|
|
3654
3673
|
let n = this.eventTrackingService.getSessionId(), r = this.contextService.getContext().trustChainId, { currencyId: i } = e, a = this.blockchainProviderManager.describeCurrency(i).map((e) => e.networkId).extractNullable();
|
|
3655
3674
|
a === null && this.logger.warn("No currency descriptor for onboarding chain_id", { currencyId: i });
|
|
3656
|
-
let o =
|
|
3675
|
+
let o = X.createOnboardingEvent({
|
|
3657
3676
|
dAppId: this.config.dAppIdentifier,
|
|
3658
3677
|
sessionId: n,
|
|
3659
3678
|
trustChainId: r,
|
|
@@ -3663,14 +3682,14 @@ var xi = class {
|
|
|
3663
3682
|
this.logger.debug("Tracking ledger sync activated event", { event: o }), await this.eventTrackingService.trackEvent(o);
|
|
3664
3683
|
}
|
|
3665
3684
|
};
|
|
3666
|
-
xi =
|
|
3685
|
+
xi = L([
|
|
3667
3686
|
v(),
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3687
|
+
I(0, _(N.LoggerPublisher)),
|
|
3688
|
+
I(1, _(W.EventTrackingService)),
|
|
3689
|
+
I(2, _(k.Config)),
|
|
3690
|
+
I(3, _(A.ContextService)),
|
|
3691
|
+
I(4, _(O.BlockchainProviderManager)),
|
|
3692
|
+
F("design:paramtypes", [
|
|
3674
3693
|
Object,
|
|
3675
3694
|
Object,
|
|
3676
3695
|
Object,
|
|
@@ -3688,19 +3707,19 @@ var Si = class {
|
|
|
3688
3707
|
this.eventTrackingService = t, this.config = n, this.logger = e("TrackOpenSession UseCase");
|
|
3689
3708
|
}
|
|
3690
3709
|
async execute() {
|
|
3691
|
-
let e = this.eventTrackingService.getSessionId(), t =
|
|
3710
|
+
let e = this.eventTrackingService.getSessionId(), t = X.createOpenSessionEvent({
|
|
3692
3711
|
dAppId: this.config.dAppIdentifier,
|
|
3693
3712
|
sessionId: e
|
|
3694
3713
|
});
|
|
3695
3714
|
this.logger.debug("Tracking open session event", { event: t }), await this.eventTrackingService.trackEvent(t);
|
|
3696
3715
|
}
|
|
3697
3716
|
};
|
|
3698
|
-
Si =
|
|
3717
|
+
Si = L([
|
|
3699
3718
|
v(),
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3719
|
+
I(0, _(N.LoggerPublisher)),
|
|
3720
|
+
I(1, _(W.EventTrackingService)),
|
|
3721
|
+
I(2, _(k.Config)),
|
|
3722
|
+
F("design:paramtypes", [
|
|
3704
3723
|
Object,
|
|
3705
3724
|
Object,
|
|
3706
3725
|
Object
|
|
@@ -3709,7 +3728,7 @@ Si = I([
|
|
|
3709
3728
|
//#endregion
|
|
3710
3729
|
//#region src/internal/event-tracking/resolveTrackedChainId.ts
|
|
3711
3730
|
function Ci(e, t, n) {
|
|
3712
|
-
let r =
|
|
3731
|
+
let r = T(e, t);
|
|
3713
3732
|
return r ? n.describeCurrency(r.currencyId).map((e) => e.networkId).extractNullable() : null;
|
|
3714
3733
|
}
|
|
3715
3734
|
//#endregion
|
|
@@ -3724,13 +3743,13 @@ var wi = class {
|
|
|
3724
3743
|
this.eventTrackingService = t, this.config = n, this.contextService = r, this.blockchainProviderManager = i, this.logger = e("TrackTransactionCompleted UseCase");
|
|
3725
3744
|
}
|
|
3726
3745
|
async execute(e) {
|
|
3727
|
-
let t = this.eventTrackingService.getSessionId(), n = this.contextService.getContext(), r = Ci(n, e.family, this.blockchainProviderManager), i =
|
|
3746
|
+
let t = this.eventTrackingService.getSessionId(), n = this.contextService.getContext(), r = Ci(n, e.family, this.blockchainProviderManager), i = X.createTransactionFlowCompletionEvent({
|
|
3728
3747
|
dAppId: this.config.dAppIdentifier,
|
|
3729
3748
|
sessionId: t,
|
|
3730
3749
|
trustChainId: n.trustChainId,
|
|
3731
3750
|
family: e.family,
|
|
3732
3751
|
chainId: r
|
|
3733
|
-
}), a =
|
|
3752
|
+
}), a = X.createInvoicingTransactionSignedEvent({
|
|
3734
3753
|
dAppId: this.config.dAppIdentifier,
|
|
3735
3754
|
sessionId: t,
|
|
3736
3755
|
transactionHash: e.transactionHash,
|
|
@@ -3745,14 +3764,14 @@ var wi = class {
|
|
|
3745
3764
|
}), await this.eventTrackingService.trackEvent(i), await this.eventTrackingService.trackEvent(a);
|
|
3746
3765
|
}
|
|
3747
3766
|
};
|
|
3748
|
-
wi =
|
|
3767
|
+
wi = L([
|
|
3749
3768
|
v(),
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3769
|
+
I(0, _(N.LoggerPublisher)),
|
|
3770
|
+
I(1, _(W.EventTrackingService)),
|
|
3771
|
+
I(2, _(k.Config)),
|
|
3772
|
+
I(3, _(A.ContextService)),
|
|
3773
|
+
I(4, _(O.BlockchainProviderManager)),
|
|
3774
|
+
F("design:paramtypes", [
|
|
3756
3775
|
Object,
|
|
3757
3776
|
Object,
|
|
3758
3777
|
Object,
|
|
@@ -3772,7 +3791,7 @@ var Ti = class {
|
|
|
3772
3791
|
this.eventTrackingService = t, this.config = n, this.contextService = r, this.blockchainProviderManager = i, this.logger = e("TrackTransactionStarted UseCase");
|
|
3773
3792
|
}
|
|
3774
3793
|
async execute(e) {
|
|
3775
|
-
let t = this.eventTrackingService.getSessionId(), n = this.contextService.getContext(), r =
|
|
3794
|
+
let t = this.eventTrackingService.getSessionId(), n = this.contextService.getContext(), r = X.createTransactionFlowInitializationEvent({
|
|
3776
3795
|
dAppId: this.config.dAppIdentifier,
|
|
3777
3796
|
sessionId: t,
|
|
3778
3797
|
trustChainId: n.trustChainId,
|
|
@@ -3782,14 +3801,14 @@ var Ti = class {
|
|
|
3782
3801
|
this.logger.debug("Tracking transaction flow initialization event", { event: r }), await this.eventTrackingService.trackEvent(r);
|
|
3783
3802
|
}
|
|
3784
3803
|
};
|
|
3785
|
-
Ti =
|
|
3804
|
+
Ti = L([
|
|
3786
3805
|
v(),
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3806
|
+
I(0, _(N.LoggerPublisher)),
|
|
3807
|
+
I(1, _(W.EventTrackingService)),
|
|
3808
|
+
I(2, _(k.Config)),
|
|
3809
|
+
I(3, _(A.ContextService)),
|
|
3810
|
+
I(4, _(O.BlockchainProviderManager)),
|
|
3811
|
+
F("design:paramtypes", [
|
|
3793
3812
|
Object,
|
|
3794
3813
|
Object,
|
|
3795
3814
|
Object,
|
|
@@ -3809,7 +3828,7 @@ var Ei = "ethereum", Di = class {
|
|
|
3809
3828
|
this.eventTrackingService = t, this.config = n, this.contextService = r, this.blockchainProviderManager = i, this.logger = e("TrackTypedMessageCompleted UseCase");
|
|
3810
3829
|
}
|
|
3811
3830
|
async execute(e) {
|
|
3812
|
-
let t = this.eventTrackingService.getSessionId(), n = li(JSON.stringify(e)), r = this.contextService.getContext(), i =
|
|
3831
|
+
let t = this.eventTrackingService.getSessionId(), n = li(JSON.stringify(e)), r = this.contextService.getContext(), i = X.createTypedMessageFlowCompletionEvent({
|
|
3813
3832
|
dAppId: this.config.dAppIdentifier,
|
|
3814
3833
|
sessionId: t,
|
|
3815
3834
|
trustChainId: r.trustChainId,
|
|
@@ -3820,14 +3839,14 @@ var Ei = "ethereum", Di = class {
|
|
|
3820
3839
|
this.logger.debug("Tracking typed message flow completion event", { event: i }), await this.eventTrackingService.trackEvent(i);
|
|
3821
3840
|
}
|
|
3822
3841
|
};
|
|
3823
|
-
Di =
|
|
3842
|
+
Di = L([
|
|
3824
3843
|
v(),
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3844
|
+
I(0, _(N.LoggerPublisher)),
|
|
3845
|
+
I(1, _(W.EventTrackingService)),
|
|
3846
|
+
I(2, _(k.Config)),
|
|
3847
|
+
I(3, _(A.ContextService)),
|
|
3848
|
+
I(4, _(O.BlockchainProviderManager)),
|
|
3849
|
+
F("design:paramtypes", [
|
|
3831
3850
|
Object,
|
|
3832
3851
|
Object,
|
|
3833
3852
|
Object,
|
|
@@ -3847,7 +3866,7 @@ var Oi = "ethereum", ki = class {
|
|
|
3847
3866
|
this.eventTrackingService = t, this.config = n, this.contextService = r, this.blockchainProviderManager = i, this.logger = e("TrackTypedMessageStarted UseCase");
|
|
3848
3867
|
}
|
|
3849
3868
|
async execute(e) {
|
|
3850
|
-
let t = this.eventTrackingService.getSessionId(), n = li(JSON.stringify(e)), r = this.contextService.getContext(), i =
|
|
3869
|
+
let t = this.eventTrackingService.getSessionId(), n = li(JSON.stringify(e)), r = this.contextService.getContext(), i = X.createTypedMessageFlowInitializationEvent({
|
|
3851
3870
|
dAppId: this.config.dAppIdentifier,
|
|
3852
3871
|
sessionId: t,
|
|
3853
3872
|
trustChainId: r.trustChainId,
|
|
@@ -3858,14 +3877,14 @@ var Oi = "ethereum", ki = class {
|
|
|
3858
3877
|
this.logger.debug("Tracking typed message flow initialization event", { event: i }), await this.eventTrackingService.trackEvent(i);
|
|
3859
3878
|
}
|
|
3860
3879
|
};
|
|
3861
|
-
ki =
|
|
3880
|
+
ki = L([
|
|
3862
3881
|
v(),
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3882
|
+
I(0, _(N.LoggerPublisher)),
|
|
3883
|
+
I(1, _(W.EventTrackingService)),
|
|
3884
|
+
I(2, _(k.Config)),
|
|
3885
|
+
I(3, _(A.ContextService)),
|
|
3886
|
+
I(4, _(O.BlockchainProviderManager)),
|
|
3887
|
+
F("design:paramtypes", [
|
|
3869
3888
|
Object,
|
|
3870
3889
|
Object,
|
|
3871
3890
|
Object,
|
|
@@ -3884,15 +3903,15 @@ var Ai = class {
|
|
|
3884
3903
|
this.eventTrackingService = t, this.config = n, this.contextService = r, this.logger = e("TrackViewAllTransactions UseCase");
|
|
3885
3904
|
}
|
|
3886
3905
|
async trackClicked(e) {
|
|
3887
|
-
let t =
|
|
3906
|
+
let t = X.createViewAllTransactionsClickedEvent(this.buildEventParams(e));
|
|
3888
3907
|
this.logger.debug("Tracking view all transactions click event", { event: t }), await this.eventTrackingService.trackEvent(t);
|
|
3889
3908
|
}
|
|
3890
3909
|
async trackRedirectConfirmed(e) {
|
|
3891
|
-
let t =
|
|
3910
|
+
let t = X.createViewAllTransactionsRedirectConfirmedEvent(this.buildEventParams(e));
|
|
3892
3911
|
this.logger.debug("Tracking view all transactions redirect confirmed event", { event: t }), await this.eventTrackingService.trackEvent(t);
|
|
3893
3912
|
}
|
|
3894
3913
|
async trackRedirectCancelled(e) {
|
|
3895
|
-
let t =
|
|
3914
|
+
let t = X.createViewAllTransactionsRedirectCancelledEvent(this.buildEventParams(e));
|
|
3896
3915
|
this.logger.debug("Tracking view all transactions redirect cancelled event", { event: t }), await this.eventTrackingService.trackEvent(t);
|
|
3897
3916
|
}
|
|
3898
3917
|
buildEventParams(e) {
|
|
@@ -3905,13 +3924,13 @@ var Ai = class {
|
|
|
3905
3924
|
};
|
|
3906
3925
|
}
|
|
3907
3926
|
};
|
|
3908
|
-
Ai =
|
|
3927
|
+
Ai = L([
|
|
3909
3928
|
v(),
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3929
|
+
I(0, _(N.LoggerPublisher)),
|
|
3930
|
+
I(1, _(W.EventTrackingService)),
|
|
3931
|
+
I(2, _(k.Config)),
|
|
3932
|
+
I(3, _(A.ContextService)),
|
|
3933
|
+
F("design:paramtypes", [
|
|
3915
3934
|
Object,
|
|
3916
3935
|
Object,
|
|
3917
3936
|
Object,
|
|
@@ -3930,7 +3949,7 @@ var ji = class {
|
|
|
3930
3949
|
this.eventTrackingService = t, this.config = n, this.contextService = r, this.blockchainProviderManager = i, this.logger = e("TrackViewTransactionDetailsClick UseCase");
|
|
3931
3950
|
}
|
|
3932
3951
|
async execute(e, t) {
|
|
3933
|
-
let n = this.eventTrackingService.getSessionId(), r = this.contextService.getContext(), i =
|
|
3952
|
+
let n = this.eventTrackingService.getSessionId(), r = this.contextService.getContext(), i = X.createViewTransactionDetailsClickedEvent({
|
|
3934
3953
|
dAppId: this.config.dAppIdentifier,
|
|
3935
3954
|
sessionId: n,
|
|
3936
3955
|
trustChainId: r.trustChainId,
|
|
@@ -3941,14 +3960,14 @@ var ji = class {
|
|
|
3941
3960
|
this.logger.debug("Tracking view transaction details click event", { event: i }), await this.eventTrackingService.trackEvent(i);
|
|
3942
3961
|
}
|
|
3943
3962
|
};
|
|
3944
|
-
ji =
|
|
3963
|
+
ji = L([
|
|
3945
3964
|
v(),
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3965
|
+
I(0, _(N.LoggerPublisher)),
|
|
3966
|
+
I(1, _(W.EventTrackingService)),
|
|
3967
|
+
I(2, _(k.Config)),
|
|
3968
|
+
I(3, _(A.ContextService)),
|
|
3969
|
+
I(4, _(O.BlockchainProviderManager)),
|
|
3970
|
+
F("design:paramtypes", [
|
|
3952
3971
|
Object,
|
|
3953
3972
|
Object,
|
|
3954
3973
|
Object,
|
|
@@ -3966,7 +3985,7 @@ var Mi = class {
|
|
|
3966
3985
|
this.eventTrackingService = t, this.config = n, this.logger = e("TrackWalletAction UseCase");
|
|
3967
3986
|
}
|
|
3968
3987
|
async trackWalletActionClicked(e) {
|
|
3969
|
-
let t = this.eventTrackingService.getSessionId(), n =
|
|
3988
|
+
let t = this.eventTrackingService.getSessionId(), n = X.createWalletActionClickedEvent({
|
|
3970
3989
|
dAppId: this.config.dAppIdentifier,
|
|
3971
3990
|
sessionId: t,
|
|
3972
3991
|
walletAction: e
|
|
@@ -3974,7 +3993,7 @@ var Mi = class {
|
|
|
3974
3993
|
this.logger.debug("Tracking wallet action clicked event", { event: n }), await this.eventTrackingService.trackEvent(n);
|
|
3975
3994
|
}
|
|
3976
3995
|
async trackWalletRedirectConfirmed(e) {
|
|
3977
|
-
let t = this.eventTrackingService.getSessionId(), n =
|
|
3996
|
+
let t = this.eventTrackingService.getSessionId(), n = X.createWalletRedirectConfirmedEvent({
|
|
3978
3997
|
dAppId: this.config.dAppIdentifier,
|
|
3979
3998
|
sessionId: t,
|
|
3980
3999
|
walletAction: e
|
|
@@ -3982,7 +4001,7 @@ var Mi = class {
|
|
|
3982
4001
|
this.logger.debug("Tracking wallet redirect confirmed event", { event: n }), await this.eventTrackingService.trackEvent(n);
|
|
3983
4002
|
}
|
|
3984
4003
|
async trackWalletRedirectCancelled(e) {
|
|
3985
|
-
let t = this.eventTrackingService.getSessionId(), n =
|
|
4004
|
+
let t = this.eventTrackingService.getSessionId(), n = X.createWalletRedirectCancelledEvent({
|
|
3986
4005
|
dAppId: this.config.dAppIdentifier,
|
|
3987
4006
|
sessionId: t,
|
|
3988
4007
|
walletAction: e
|
|
@@ -3990,12 +4009,12 @@ var Mi = class {
|
|
|
3990
4009
|
this.logger.debug("Tracking wallet redirect cancelled event", { event: n }), await this.eventTrackingService.trackEvent(n);
|
|
3991
4010
|
}
|
|
3992
4011
|
};
|
|
3993
|
-
Mi =
|
|
4012
|
+
Mi = L([
|
|
3994
4013
|
v(),
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
4014
|
+
I(0, _(N.LoggerPublisher)),
|
|
4015
|
+
I(1, _(W.EventTrackingService)),
|
|
4016
|
+
I(2, _(k.Config)),
|
|
4017
|
+
F("design:paramtypes", [
|
|
3999
4018
|
Object,
|
|
4000
4019
|
Object,
|
|
4001
4020
|
Object
|
|
@@ -4004,8 +4023,8 @@ Mi = I([
|
|
|
4004
4023
|
//#endregion
|
|
4005
4024
|
//#region src/internal/event-tracking/di/eventTrackingModule.ts
|
|
4006
4025
|
var Ni = ({ stub: e = !1 } = {}) => new g(({ bind: t }) => {
|
|
4007
|
-
e ? t(
|
|
4008
|
-
}), Pi = class extends
|
|
4026
|
+
e ? t(W.EventTrackingService).to(fi).inSingletonScope() : t(W.EventTrackingService).to(di).inSingletonScope(), t(W.TrackConsentGiven).to(pi), t(W.TrackConsentRemoved).to(mi), t(W.TrackLanguageChanged).to(_i), t(W.TrackCurrencyChanged).to(hi), t(W.TrackFloatingButtonClick).to(gi), t(W.TrackOnboarding).to(xi), t(W.TrackTransactionStarted).to(Ti), t(W.TrackTransactionCompleted).to(wi), t(W.TrackLedgerSyncOpened).to(yi), t(W.TrackOpenSession).to(Si), t(W.TrackLedgerSyncActivated).to(vi), t(W.TrackTypedMessageStarted).to(ki), t(W.TrackTypedMessageCompleted).to(Di), t(W.TrackWalletAction).to(Mi), t(W.TrackMobileRedirectLedgerWallet).to(bi), t(W.TrackViewTransactionDetailsClick).to(ji), t(W.TrackViewAllTransactions).to(Ai);
|
|
4027
|
+
}), Pi = class extends x {
|
|
4009
4028
|
constructor(e, t) {
|
|
4010
4029
|
super(e, "LedgerSyncAuthenticationError", t);
|
|
4011
4030
|
}
|
|
@@ -4026,7 +4045,7 @@ var Ni = ({ stub: e = !1 } = {}) => new g(({ bind: t }) => {
|
|
|
4026
4045
|
this.lkrpAppKit = new Pe({
|
|
4027
4046
|
dmk: a,
|
|
4028
4047
|
applicationId: Fi,
|
|
4029
|
-
env: this.
|
|
4048
|
+
env: this.getKeyringEnvironment()
|
|
4030
4049
|
}).build();
|
|
4031
4050
|
}
|
|
4032
4051
|
authenticate() {
|
|
@@ -4045,7 +4064,7 @@ var Ni = ({ stub: e = !1 } = {}) => new g(({ bind: t }) => {
|
|
|
4045
4064
|
}
|
|
4046
4065
|
async decrypt(e) {
|
|
4047
4066
|
if (!this.authContext?.encryptionKey) {
|
|
4048
|
-
let e = new
|
|
4067
|
+
let e = new Et("No encryption key");
|
|
4049
4068
|
throw this.logger.error("Missing encryption key for decrypt", { error: e }), e;
|
|
4050
4069
|
}
|
|
4051
4070
|
let t = await this.lkrpAppKit.decryptData(this.authContext?.encryptionKey, e);
|
|
@@ -4054,6 +4073,13 @@ var Ni = ({ stub: e = !1 } = {}) => new g(({ bind: t }) => {
|
|
|
4054
4073
|
get authContext() {
|
|
4055
4074
|
return this._authContext;
|
|
4056
4075
|
}
|
|
4076
|
+
getKeyringEnvironment() {
|
|
4077
|
+
switch (this.config.environment) {
|
|
4078
|
+
case "staging": return Ne.STAGING;
|
|
4079
|
+
case "trial": return Ne.PROD;
|
|
4080
|
+
default: return Ne.PROD;
|
|
4081
|
+
}
|
|
4082
|
+
}
|
|
4057
4083
|
getClientName() {
|
|
4058
4084
|
return `LedgerWalletProvider::${this.config.dAppIdentifier}`;
|
|
4059
4085
|
}
|
|
@@ -4127,26 +4153,26 @@ var Ni = ({ stub: e = !1 } = {}) => new g(({ bind: t }) => {
|
|
|
4127
4153
|
}
|
|
4128
4154
|
}
|
|
4129
4155
|
};
|
|
4130
|
-
Ii =
|
|
4156
|
+
Ii = L([
|
|
4131
4157
|
v(),
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4158
|
+
I(0, _(N.LoggerPublisher)),
|
|
4159
|
+
I(1, _(M.DeviceManagementKitService)),
|
|
4160
|
+
I(2, _(P.StorageService)),
|
|
4161
|
+
I(3, _(G.GetOrCreateKeyPairUseCase)),
|
|
4162
|
+
I(4, _(k.Config)),
|
|
4163
|
+
F("design:paramtypes", [
|
|
4138
4164
|
Object,
|
|
4139
4165
|
Object,
|
|
4140
4166
|
Object,
|
|
4141
4167
|
nr === void 0 ? Object : nr,
|
|
4142
|
-
|
|
4168
|
+
H === void 0 ? Object : H
|
|
4143
4169
|
])
|
|
4144
4170
|
], Ii);
|
|
4145
4171
|
//#endregion
|
|
4146
4172
|
//#region src/internal/ledgersync/di/ledgerSyncModule.ts
|
|
4147
4173
|
function Li({ stub: e }) {
|
|
4148
4174
|
return new g(({ bind: e }) => {
|
|
4149
|
-
e(
|
|
4175
|
+
e(Ut.LedgerSyncService).to(Ii).inSingletonScope();
|
|
4150
4176
|
});
|
|
4151
4177
|
}
|
|
4152
4178
|
//#endregion
|
|
@@ -4161,37 +4187,37 @@ var Ri = class {
|
|
|
4161
4187
|
}
|
|
4162
4188
|
formatMessage(e, t) {
|
|
4163
4189
|
let n = {
|
|
4164
|
-
[
|
|
4165
|
-
[
|
|
4166
|
-
[
|
|
4167
|
-
[
|
|
4168
|
-
[
|
|
4190
|
+
[V.debug]: b.cyan,
|
|
4191
|
+
[V.info]: b.green,
|
|
4192
|
+
[V.warn]: b.yellow,
|
|
4193
|
+
[V.error]: b.red,
|
|
4194
|
+
[V.fatal]: b.bgRed
|
|
4169
4195
|
}[e];
|
|
4170
|
-
return n ? n(t) :
|
|
4196
|
+
return n ? n(t) : b.white(t);
|
|
4171
4197
|
}
|
|
4172
4198
|
log(e, t, n) {
|
|
4173
4199
|
if (!this.canLog(e)) return;
|
|
4174
4200
|
let r = `[${n.tag}]`;
|
|
4175
4201
|
switch (console.group(this.formatMessage(e, `${r}: ${n.timestamp}`)), e) {
|
|
4176
|
-
case
|
|
4202
|
+
case V.debug:
|
|
4177
4203
|
console.debug(this.formatMessage(e, t), n.data);
|
|
4178
4204
|
break;
|
|
4179
|
-
case
|
|
4205
|
+
case V.info:
|
|
4180
4206
|
console.info(this.formatMessage(e, t), n.data);
|
|
4181
4207
|
break;
|
|
4182
|
-
case
|
|
4208
|
+
case V.warn:
|
|
4183
4209
|
console.warn(this.formatMessage(e, t), n.data);
|
|
4184
4210
|
break;
|
|
4185
|
-
case
|
|
4186
|
-
case
|
|
4211
|
+
case V.error:
|
|
4212
|
+
case V.fatal: console.error(this.formatMessage(e, t), n.data);
|
|
4187
4213
|
}
|
|
4188
4214
|
console.groupEnd();
|
|
4189
4215
|
}
|
|
4190
4216
|
};
|
|
4191
|
-
Ri =
|
|
4217
|
+
Ri = L([
|
|
4192
4218
|
v(),
|
|
4193
|
-
|
|
4194
|
-
|
|
4219
|
+
I(0, _(k.Config)),
|
|
4220
|
+
F("design:paramtypes", [H === void 0 ? Object : H])
|
|
4195
4221
|
], Ri);
|
|
4196
4222
|
//#endregion
|
|
4197
4223
|
//#region src/internal/logger/service/DefaultLoggerPublisher.ts
|
|
@@ -4212,25 +4238,25 @@ var zi = class {
|
|
|
4212
4238
|
});
|
|
4213
4239
|
}
|
|
4214
4240
|
error(e, t) {
|
|
4215
|
-
this._log(
|
|
4241
|
+
this._log(V.error, e, t);
|
|
4216
4242
|
}
|
|
4217
4243
|
warn(e, t) {
|
|
4218
|
-
this._log(
|
|
4244
|
+
this._log(V.warn, e, t);
|
|
4219
4245
|
}
|
|
4220
4246
|
info(e, t) {
|
|
4221
|
-
this._log(
|
|
4247
|
+
this._log(V.info, e, t);
|
|
4222
4248
|
}
|
|
4223
4249
|
debug(e, t) {
|
|
4224
|
-
this._log(
|
|
4250
|
+
this._log(V.debug, e, t);
|
|
4225
4251
|
}
|
|
4226
4252
|
fatal(e, t) {
|
|
4227
|
-
this._log(
|
|
4253
|
+
this._log(V.fatal, e, t);
|
|
4228
4254
|
}
|
|
4229
4255
|
};
|
|
4230
|
-
zi =
|
|
4256
|
+
zi = L([
|
|
4231
4257
|
v(),
|
|
4232
|
-
|
|
4233
|
-
|
|
4258
|
+
I(0, Oe(N.LoggerSubscriber)),
|
|
4259
|
+
F("design:paramtypes", [Array, String])
|
|
4234
4260
|
], zi);
|
|
4235
4261
|
//#endregion
|
|
4236
4262
|
//#region src/internal/event-tracking/ErrorTrackingUtils.ts
|
|
@@ -4264,11 +4290,11 @@ var Bi = ["ledger_sync_id"], Vi = (e) => {
|
|
|
4264
4290
|
DeviceOutOfMemoryError: "device",
|
|
4265
4291
|
DeviceFirmwareOutdatedError: "device"
|
|
4266
4292
|
}, Ui = (e) => Hi[e.name] ?? "unknown", Wi = (e) => {
|
|
4267
|
-
let { error: t, sessionId: n, dAppId: r } = e, i = t instanceof
|
|
4268
|
-
event_id:
|
|
4293
|
+
let { error: t, sessionId: n, dAppId: r } = e, i = t instanceof x ? t.context : void 0, a = {
|
|
4294
|
+
event_id: Y(),
|
|
4269
4295
|
transaction_dapp_id: r,
|
|
4270
4296
|
timestamp_ms: Date.now(),
|
|
4271
|
-
event_type:
|
|
4297
|
+
event_type: K.ErrorOccurred,
|
|
4272
4298
|
session_id: n,
|
|
4273
4299
|
error_type: t.name,
|
|
4274
4300
|
error_code: void 0,
|
|
@@ -4277,8 +4303,8 @@ var Bi = ["ledger_sync_id"], Vi = (e) => {
|
|
|
4277
4303
|
error_data: Vi(i)
|
|
4278
4304
|
};
|
|
4279
4305
|
return {
|
|
4280
|
-
name:
|
|
4281
|
-
type:
|
|
4306
|
+
name: K.ErrorOccurred,
|
|
4307
|
+
type: K.ErrorOccurred,
|
|
4282
4308
|
data: a
|
|
4283
4309
|
};
|
|
4284
4310
|
}, Gi = class {
|
|
@@ -4296,14 +4322,14 @@ var Bi = ["ledger_sync_id"], Vi = (e) => {
|
|
|
4296
4322
|
return typeof this.dAppId == "function" ? this.dAppId() : this.dAppId;
|
|
4297
4323
|
}
|
|
4298
4324
|
log(e, t, n) {
|
|
4299
|
-
if (e !==
|
|
4325
|
+
if (e !== V.error && e !== V.fatal || !this.config.enabled) return;
|
|
4300
4326
|
let r = this.extractError(n.data);
|
|
4301
4327
|
if (!r || this.config.useWhitelist && !kr(r.name)) return;
|
|
4302
4328
|
let i = Wi({
|
|
4303
4329
|
error: r,
|
|
4304
4330
|
sessionId: this.getSessionId(),
|
|
4305
4331
|
dAppId: this.getDAppId(),
|
|
4306
|
-
severity: e ===
|
|
4332
|
+
severity: e === V.fatal ? "fatal" : "error"
|
|
4307
4333
|
});
|
|
4308
4334
|
this.trackEvent(i);
|
|
4309
4335
|
}
|
|
@@ -4311,18 +4337,18 @@ var Bi = ["ledger_sync_id"], Vi = (e) => {
|
|
|
4311
4337
|
return e && e.error instanceof Error ? e.error : null;
|
|
4312
4338
|
}
|
|
4313
4339
|
};
|
|
4314
|
-
Gi =
|
|
4340
|
+
Gi = L([v(), F("design:paramtypes", [Object])], Gi);
|
|
4315
4341
|
//#endregion
|
|
4316
4342
|
//#region src/internal/logger/di/loggerModule.ts
|
|
4317
4343
|
function Ki({ stub: e, errorTrackingConfig: t } = {}) {
|
|
4318
4344
|
return new g(({ bind: e }) => {
|
|
4319
|
-
e(
|
|
4320
|
-
sessionId: () => e.get(
|
|
4321
|
-
dAppId: () => e.get(
|
|
4322
|
-
trackEvent: (t) => e.get(
|
|
4345
|
+
e(N.LoggerSubscriber).to(Ri), t?.enabled !== !1 && e(N.LoggerSubscriber).toDynamicValue((e) => new Gi({
|
|
4346
|
+
sessionId: () => e.get(W.EventTrackingService).getSessionId(),
|
|
4347
|
+
dAppId: () => e.get(k.Config).dAppIdentifier,
|
|
4348
|
+
trackEvent: (t) => e.get(W.EventTrackingService).trackEvent(t),
|
|
4323
4349
|
config: t
|
|
4324
|
-
})).inSingletonScope(), e(
|
|
4325
|
-
let n = e.getAll(
|
|
4350
|
+
})).inSingletonScope(), e(N.LoggerPublisher).toFactory((e) => (t) => {
|
|
4351
|
+
let n = e.getAll(N.LoggerSubscriber);
|
|
4326
4352
|
return new zi(n, t);
|
|
4327
4353
|
});
|
|
4328
4354
|
});
|
|
@@ -4350,16 +4376,16 @@ var qi = class {
|
|
|
4350
4376
|
return this._open;
|
|
4351
4377
|
}
|
|
4352
4378
|
};
|
|
4353
|
-
|
|
4379
|
+
L([
|
|
4354
4380
|
ke(),
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
], qi.prototype, "onDeactivation", null), qi =
|
|
4381
|
+
F("design:type", Function),
|
|
4382
|
+
F("design:paramtypes", []),
|
|
4383
|
+
F("design:returntype", void 0)
|
|
4384
|
+
], qi.prototype, "onDeactivation", null), qi = L([
|
|
4359
4385
|
v(),
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4386
|
+
I(0, _(N.LoggerPublisher)),
|
|
4387
|
+
I(1, _(W.TrackOpenSession)),
|
|
4388
|
+
F("design:paramtypes", [Object, Si === void 0 ? Object : Si])
|
|
4363
4389
|
], qi);
|
|
4364
4390
|
//#endregion
|
|
4365
4391
|
//#region src/internal/modal/di/modalModuleTypes.ts
|
|
@@ -4382,7 +4408,7 @@ var Xi = class {
|
|
|
4382
4408
|
this.intents$.next(e);
|
|
4383
4409
|
}
|
|
4384
4410
|
};
|
|
4385
|
-
Xi =
|
|
4411
|
+
Xi = L([v()], Xi);
|
|
4386
4412
|
//#endregion
|
|
4387
4413
|
//#region src/internal/navigation/di/navigationModuleTypes.ts
|
|
4388
4414
|
var Zi = { NavigationIntentService: Symbol.for("NavigationIntentService") };
|
|
@@ -4422,7 +4448,7 @@ var ra = class {
|
|
|
4422
4448
|
this.config = e;
|
|
4423
4449
|
let t = {
|
|
4424
4450
|
[ea]: this.config.originToken,
|
|
4425
|
-
[$i]: `ledger-button/${
|
|
4451
|
+
[$i]: `ledger-button/${vn.version}/${this.config.dAppIdentifier}`
|
|
4426
4452
|
};
|
|
4427
4453
|
this.headers = {
|
|
4428
4454
|
...ta,
|
|
@@ -4436,7 +4462,7 @@ var ra = class {
|
|
|
4436
4462
|
};
|
|
4437
4463
|
return Ee(async () => {
|
|
4438
4464
|
let r = await fetch(e, na(n, t || {}));
|
|
4439
|
-
if (!r.ok) throw new
|
|
4465
|
+
if (!r.ok) throw new St("GET request failed", {
|
|
4440
4466
|
status: r.status,
|
|
4441
4467
|
url: e,
|
|
4442
4468
|
options: t
|
|
@@ -4452,7 +4478,7 @@ var ra = class {
|
|
|
4452
4478
|
};
|
|
4453
4479
|
return Ee(async () => {
|
|
4454
4480
|
let i = await fetch(e, na(r, n || {}));
|
|
4455
|
-
if (!i.ok) throw new
|
|
4481
|
+
if (!i.ok) throw new St("POST request failed", {
|
|
4456
4482
|
status: i.status,
|
|
4457
4483
|
url: e,
|
|
4458
4484
|
options: n,
|
|
@@ -4469,7 +4495,7 @@ var ra = class {
|
|
|
4469
4495
|
};
|
|
4470
4496
|
return Ee(async () => {
|
|
4471
4497
|
let i = await fetch(e, na(r, n || {}));
|
|
4472
|
-
if (!i.ok) throw new
|
|
4498
|
+
if (!i.ok) throw new St("PUT request failed", {
|
|
4473
4499
|
status: i.status,
|
|
4474
4500
|
url: e,
|
|
4475
4501
|
options: n,
|
|
@@ -4486,7 +4512,7 @@ var ra = class {
|
|
|
4486
4512
|
};
|
|
4487
4513
|
return Ee(async () => {
|
|
4488
4514
|
let i = await fetch(e, na(r, n || {}));
|
|
4489
|
-
if (!i.ok) throw new
|
|
4515
|
+
if (!i.ok) throw new St("PATCH request failed", {
|
|
4490
4516
|
status: i.status,
|
|
4491
4517
|
url: e,
|
|
4492
4518
|
options: n,
|
|
@@ -4502,7 +4528,7 @@ var ra = class {
|
|
|
4502
4528
|
};
|
|
4503
4529
|
return Ee(async () => {
|
|
4504
4530
|
let r = await fetch(e, na(n, t || {}));
|
|
4505
|
-
if (!r.ok) throw new
|
|
4531
|
+
if (!r.ok) throw new St("DELETE request failed", {
|
|
4506
4532
|
status: r.status,
|
|
4507
4533
|
url: e,
|
|
4508
4534
|
options: t
|
|
@@ -4511,21 +4537,21 @@ var ra = class {
|
|
|
4511
4537
|
});
|
|
4512
4538
|
}
|
|
4513
4539
|
};
|
|
4514
|
-
ra =
|
|
4540
|
+
ra = L([
|
|
4515
4541
|
v(),
|
|
4516
|
-
|
|
4517
|
-
|
|
4542
|
+
I(0, _(k.Config)),
|
|
4543
|
+
F("design:paramtypes", [H === void 0 ? Object : H])
|
|
4518
4544
|
], ra);
|
|
4519
4545
|
//#endregion
|
|
4520
4546
|
//#region src/internal/network/di/networkModule.ts
|
|
4521
4547
|
function ia({ stub: e }) {
|
|
4522
4548
|
return new g(({ bind: e }) => {
|
|
4523
|
-
e(
|
|
4549
|
+
e(U.NetworkService).to(ra);
|
|
4524
4550
|
});
|
|
4525
4551
|
}
|
|
4526
4552
|
//#endregion
|
|
4527
4553
|
//#region src/internal/pending-transaction/di/pendingTransactionModuleTypes.ts
|
|
4528
|
-
var
|
|
4554
|
+
var Z = {
|
|
4529
4555
|
PendingTransactionController: Symbol.for("PendingTransactionController"),
|
|
4530
4556
|
PendingTransactionStorageService: Symbol.for("PendingTransactionStorageService"),
|
|
4531
4557
|
TrackBroadcastedTransactionUseCase: Symbol.for("TrackBroadcastedTransactionUseCase"),
|
|
@@ -4576,7 +4602,7 @@ var X = {
|
|
|
4576
4602
|
startPollingWhenAccountAvailable() {
|
|
4577
4603
|
let e;
|
|
4578
4604
|
this.contextService.observeContext().subscribe((t) => {
|
|
4579
|
-
let n =
|
|
4605
|
+
let n = Pt(t);
|
|
4580
4606
|
n && n.ticker && n.ticker.length > 0 && this.storageService.getAll().length > 0 && this.startPolling(), e !== void 0 && t.preferredFiatCurrency !== e && this.emitCurrentState(), e = t.preferredFiatCurrency;
|
|
4581
4607
|
});
|
|
4582
4608
|
}
|
|
@@ -4642,7 +4668,7 @@ var X = {
|
|
|
4642
4668
|
let t = this.contextService.getContext(), n = /* @__PURE__ */ new Set();
|
|
4643
4669
|
for (let [r, i] of t.selectedAccounts) e.some((e) => e.ledgerId === i.currencyId && e.address === i.freshAddress) && n.add(r);
|
|
4644
4670
|
if (n.size === 0) {
|
|
4645
|
-
let e =
|
|
4671
|
+
let e = Ft(t);
|
|
4646
4672
|
e && n.add(e);
|
|
4647
4673
|
}
|
|
4648
4674
|
return Array.from(n);
|
|
@@ -4655,15 +4681,15 @@ var X = {
|
|
|
4655
4681
|
this.pendingTxSubject.next(e);
|
|
4656
4682
|
}
|
|
4657
4683
|
};
|
|
4658
|
-
oa =
|
|
4684
|
+
oa = L([
|
|
4659
4685
|
v(),
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4686
|
+
I(0, _(N.LoggerPublisher)),
|
|
4687
|
+
I(1, _(Z.PendingTransactionStorageService)),
|
|
4688
|
+
I(2, _(Z.ConfirmPendingTransactionsUseCase)),
|
|
4689
|
+
I(3, _(A.ContextService)),
|
|
4690
|
+
I(4, _(Z.HydratePendingTransactionsWithFiatUseCase)),
|
|
4691
|
+
I(5, _(E.FetchSelectedAccountUseCase)),
|
|
4692
|
+
F("design:paramtypes", [
|
|
4667
4693
|
Object,
|
|
4668
4694
|
Object,
|
|
4669
4695
|
Object,
|
|
@@ -4707,10 +4733,10 @@ var sa = "ledger-button:pending-txs", ca = class {
|
|
|
4707
4733
|
}
|
|
4708
4734
|
}
|
|
4709
4735
|
};
|
|
4710
|
-
ca =
|
|
4736
|
+
ca = L([
|
|
4711
4737
|
v(),
|
|
4712
|
-
|
|
4713
|
-
|
|
4738
|
+
I(0, _(N.LoggerPublisher)),
|
|
4739
|
+
F("design:paramtypes", [Object])
|
|
4714
4740
|
], ca);
|
|
4715
4741
|
//#endregion
|
|
4716
4742
|
//#region src/internal/pending-transaction/use-case/ConfirmPendingTransactionsUseCase.ts
|
|
@@ -4743,11 +4769,11 @@ var la = class {
|
|
|
4743
4769
|
e.length !== 0 && this.logger.debug("Settled transactions found", { settled: e });
|
|
4744
4770
|
}
|
|
4745
4771
|
};
|
|
4746
|
-
la =
|
|
4772
|
+
la = L([
|
|
4747
4773
|
v(),
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4774
|
+
I(0, _(z.TransactionHistoryDataSource)),
|
|
4775
|
+
I(1, _(N.LoggerPublisher)),
|
|
4776
|
+
F("design:paramtypes", [Object, Object])
|
|
4751
4777
|
], la);
|
|
4752
4778
|
//#endregion
|
|
4753
4779
|
//#region src/internal/pending-transaction/use-case/HydratePendingTransactionsWithFiatUseCase.ts
|
|
@@ -4807,11 +4833,11 @@ var ua = class {
|
|
|
4807
4833
|
});
|
|
4808
4834
|
}
|
|
4809
4835
|
};
|
|
4810
|
-
ua =
|
|
4836
|
+
ua = L([
|
|
4811
4837
|
v(),
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4838
|
+
I(0, _(N.LoggerPublisher)),
|
|
4839
|
+
I(1, _(D.CounterValueDataSource)),
|
|
4840
|
+
F("design:paramtypes", [Object, Object])
|
|
4815
4841
|
], ua);
|
|
4816
4842
|
//#endregion
|
|
4817
4843
|
//#region src/api/model/signing/SignedTransaction.ts
|
|
@@ -4842,7 +4868,7 @@ var ha = class {
|
|
|
4842
4868
|
}
|
|
4843
4869
|
async execute(e, t) {
|
|
4844
4870
|
if (e.status !== "success" || !fa(e.data)) return;
|
|
4845
|
-
let n = this.contextService.getContext(), { family: r, value: i } = t, a =
|
|
4871
|
+
let n = this.contextService.getContext(), { family: r, value: i } = t, a = T(n, r);
|
|
4846
4872
|
if (!a) return;
|
|
4847
4873
|
let o = r === "ethereum" ? n.chainId : 0, s = await this.buildPendingTransaction(e.data.hash, a, o, i);
|
|
4848
4874
|
this.logger.debug("Tracking broadcasted transaction", { hash: s.hash }), this.controller.registerBroadcastedTransaction(s);
|
|
@@ -4856,7 +4882,7 @@ var ha = class {
|
|
|
4856
4882
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4857
4883
|
type: "sent",
|
|
4858
4884
|
value: r,
|
|
4859
|
-
formattedValue: r === void 0 || o === void 0 ? void 0 :
|
|
4885
|
+
formattedValue: r === void 0 || o === void 0 ? void 0 : qt(r, o, i),
|
|
4860
4886
|
ticker: i,
|
|
4861
4887
|
currencyName: a,
|
|
4862
4888
|
ledgerId: t.currencyId,
|
|
@@ -4883,14 +4909,14 @@ var ha = class {
|
|
|
4883
4909
|
return t.isNothing() && this.logger.warn("Unresolved decimals, reporting no formatted amount", { currencyId: e }), t.extract();
|
|
4884
4910
|
}
|
|
4885
4911
|
};
|
|
4886
|
-
ha =
|
|
4912
|
+
ha = L([
|
|
4887
4913
|
v(),
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4914
|
+
I(0, _(Z.PendingTransactionController)),
|
|
4915
|
+
I(1, _(A.ContextService)),
|
|
4916
|
+
I(2, _(D.CalDataSource)),
|
|
4917
|
+
I(3, _(O.BlockchainProviderManager)),
|
|
4918
|
+
I(4, _(N.LoggerPublisher)),
|
|
4919
|
+
F("design:paramtypes", [
|
|
4894
4920
|
Object,
|
|
4895
4921
|
Object,
|
|
4896
4922
|
Object,
|
|
@@ -4902,7 +4928,7 @@ ha = I([
|
|
|
4902
4928
|
//#region src/internal/pending-transaction/di/pendingTransactionModule.ts
|
|
4903
4929
|
function ga() {
|
|
4904
4930
|
return new g(({ bind: e }) => {
|
|
4905
|
-
e(
|
|
4931
|
+
e(Z.PendingTransactionStorageService).to(ca).inSingletonScope(), e(Z.TrackBroadcastedTransactionUseCase).to(ha), e(Z.ConfirmPendingTransactionsUseCase).to(la), e(Z.HydratePendingTransactionsWithFiatUseCase).to(ua), e(Z.PendingTransactionController).to(oa).inSingletonScope();
|
|
4906
4932
|
});
|
|
4907
4933
|
}
|
|
4908
4934
|
//#endregion
|
|
@@ -4912,7 +4938,7 @@ var _a = class {
|
|
|
4912
4938
|
return typeof window > "u" || !("ethereum" in window) ? !1 : window.ethereum?.isLedgerLive === !0;
|
|
4913
4939
|
}
|
|
4914
4940
|
};
|
|
4915
|
-
_a =
|
|
4941
|
+
_a = L([v()], _a);
|
|
4916
4942
|
//#endregion
|
|
4917
4943
|
//#region src/internal/platform/use-case/IsMobileUseCase.ts
|
|
4918
4944
|
var va = class {
|
|
@@ -4920,10 +4946,10 @@ var va = class {
|
|
|
4920
4946
|
return typeof navigator > "u" ? !1 : /Android|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i.test(navigator.userAgent);
|
|
4921
4947
|
}
|
|
4922
4948
|
};
|
|
4923
|
-
va =
|
|
4949
|
+
va = L([v()], va);
|
|
4924
4950
|
//#endregion
|
|
4925
4951
|
//#region src/internal/platform/di/platformModuleTypes.ts
|
|
4926
|
-
var
|
|
4952
|
+
var Q = {
|
|
4927
4953
|
IsMobileUseCase: Symbol.for("IsMobileUseCase"),
|
|
4928
4954
|
IsLedgerLiveMobileUseCase: Symbol.for("IsLedgerLiveMobileUseCase"),
|
|
4929
4955
|
IsSupportedPlatformUseCase: Symbol.for("IsSupportedPlatformUseCase")
|
|
@@ -4937,17 +4963,17 @@ var Z = {
|
|
|
4937
4963
|
return this.isMobile.execute() || this.deviceManagementKitService.dmk.isEnvironmentSupported();
|
|
4938
4964
|
}
|
|
4939
4965
|
};
|
|
4940
|
-
ya =
|
|
4966
|
+
ya = L([
|
|
4941
4967
|
v(),
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4968
|
+
I(0, _(M.DeviceManagementKitService)),
|
|
4969
|
+
I(1, _(Q.IsMobileUseCase)),
|
|
4970
|
+
F("design:paramtypes", [Object, Object])
|
|
4945
4971
|
], ya);
|
|
4946
4972
|
//#endregion
|
|
4947
4973
|
//#region src/internal/platform/di/platformModule.ts
|
|
4948
4974
|
function ba() {
|
|
4949
4975
|
return new g(({ bind: e }) => {
|
|
4950
|
-
e(
|
|
4976
|
+
e(Q.IsMobileUseCase).to(va), e(Q.IsLedgerLiveMobileUseCase).to(_a), e(Q.IsSupportedPlatformUseCase).to(ya);
|
|
4951
4977
|
});
|
|
4952
4978
|
}
|
|
4953
4979
|
//#endregion
|
|
@@ -4981,10 +5007,10 @@ var Sa = [], Ca = {
|
|
|
4981
5007
|
HAS_DEVELOPER_MODE: "hasDeveloperMode",
|
|
4982
5008
|
FEATURE_FLAGS: "featureFlags",
|
|
4983
5009
|
CONFIG_OVERRIDES: "configOverrides"
|
|
4984
|
-
},
|
|
5010
|
+
}, $ = {
|
|
4985
5011
|
...Ca,
|
|
4986
5012
|
...wa
|
|
4987
|
-
}, Ta = { solana: !1 },
|
|
5013
|
+
}, Ta = { solana: !1 }, Ea, Da = Ea = class {
|
|
4988
5014
|
loggerFactory;
|
|
4989
5015
|
indexedDbService;
|
|
4990
5016
|
logger;
|
|
@@ -4992,7 +5018,7 @@ var Sa = [], Ca = {
|
|
|
4992
5018
|
this.loggerFactory = e, this.indexedDbService = t, this.logger = this.loggerFactory("Storage Service");
|
|
4993
5019
|
}
|
|
4994
5020
|
static formatKey(e) {
|
|
4995
|
-
return `${
|
|
5021
|
+
return `${$.PREFIX}-${e}`;
|
|
4996
5022
|
}
|
|
4997
5023
|
async setDbVersion(e) {
|
|
4998
5024
|
return this.indexedDbService.setDbVersion(e);
|
|
@@ -5000,7 +5026,7 @@ var Sa = [], Ca = {
|
|
|
5000
5026
|
async getDbVersion() {
|
|
5001
5027
|
return (await this.indexedDbService.getDbVersion()).caseOf({
|
|
5002
5028
|
Right: (e) => e.orDefault(0),
|
|
5003
|
-
Left: () => this.getItem(
|
|
5029
|
+
Left: () => this.getItem($.DB_VERSION).orDefault(0)
|
|
5004
5030
|
});
|
|
5005
5031
|
}
|
|
5006
5032
|
async storeKeyPair(e) {
|
|
@@ -5019,36 +5045,36 @@ var Sa = [], Ca = {
|
|
|
5019
5045
|
return this.indexedDbService.getEncryptionKey();
|
|
5020
5046
|
}
|
|
5021
5047
|
saveTrustChainId(e) {
|
|
5022
|
-
this.saveItem(
|
|
5048
|
+
this.saveItem($.TRUST_CHAIN_ID, e), this.saveItem($.TRUST_CHAIN_VALIDITY, (/* @__PURE__ */ new Date()).getTime());
|
|
5023
5049
|
}
|
|
5024
5050
|
getTrustChainId() {
|
|
5025
|
-
return this.getItem(
|
|
5051
|
+
return this.getItem($.TRUST_CHAIN_ID);
|
|
5026
5052
|
}
|
|
5027
5053
|
removeTrustChainId() {
|
|
5028
|
-
this.removeItem(
|
|
5054
|
+
this.removeItem($.TRUST_CHAIN_ID), this.removeItem($.TRUST_CHAIN_VALIDITY);
|
|
5029
5055
|
}
|
|
5030
5056
|
isTrustChainValid() {
|
|
5031
|
-
return this.getItem(
|
|
5057
|
+
return this.getItem($.TRUST_CHAIN_VALIDITY).map((e) => {
|
|
5032
5058
|
let t = new Date(e);
|
|
5033
5059
|
return new Date(t.getTime() + 2592e6) > /* @__PURE__ */ new Date();
|
|
5034
5060
|
}).orDefault(!1);
|
|
5035
5061
|
}
|
|
5036
5062
|
saveSelectedAccount(e, t) {
|
|
5037
5063
|
if (!e) return;
|
|
5038
|
-
let n = this.getItem(
|
|
5039
|
-
n[t] = xa(e), this.saveItem(
|
|
5064
|
+
let n = this.getItem($.SELECTED_ACCOUNTS).orDefault({});
|
|
5065
|
+
n[t] = xa(e), this.saveItem($.SELECTED_ACCOUNTS, n);
|
|
5040
5066
|
}
|
|
5041
5067
|
getSelectedAccounts() {
|
|
5042
|
-
let e = /* @__PURE__ */ new Map(), t = this.getItem(
|
|
5068
|
+
let e = /* @__PURE__ */ new Map(), t = this.getItem($.SELECTED_ACCOUNTS).orDefault({});
|
|
5043
5069
|
for (let [n, r] of Object.entries(t)) e.set(n, this.toAccount(r));
|
|
5044
5070
|
return e;
|
|
5045
5071
|
}
|
|
5046
5072
|
removeSelectedAccount(e) {
|
|
5047
|
-
let t = this.getItem(
|
|
5048
|
-
delete t[e], this.saveItem(
|
|
5073
|
+
let t = this.getItem($.SELECTED_ACCOUNTS).orDefault({});
|
|
5074
|
+
delete t[e], this.saveItem($.SELECTED_ACCOUNTS, t);
|
|
5049
5075
|
}
|
|
5050
5076
|
removeSelectedAccounts() {
|
|
5051
|
-
this.removeItem(
|
|
5077
|
+
this.removeItem($.SELECTED_ACCOUNTS), this.removeItem($.SELECTED_ACCOUNT);
|
|
5052
5078
|
}
|
|
5053
5079
|
toAccount(e) {
|
|
5054
5080
|
return {
|
|
@@ -5065,23 +5091,23 @@ var Sa = [], Ca = {
|
|
|
5065
5091
|
};
|
|
5066
5092
|
}
|
|
5067
5093
|
saveItem(e, t) {
|
|
5068
|
-
localStorage.setItem(
|
|
5094
|
+
localStorage.setItem(Ea.formatKey(e), JSON.stringify(t));
|
|
5069
5095
|
}
|
|
5070
5096
|
removeItem(e) {
|
|
5071
|
-
let t =
|
|
5097
|
+
let t = Ea.formatKey(e);
|
|
5072
5098
|
return this.hasItem(e) ? (localStorage.removeItem(t), this.logger.debug("Item removed", { key: e }), !0) : (this.logger.debug("Item not found", { key: e }), !1);
|
|
5073
5099
|
}
|
|
5074
5100
|
hasItem(e) {
|
|
5075
|
-
let t =
|
|
5101
|
+
let t = Ea.formatKey(e);
|
|
5076
5102
|
return localStorage.getItem(t) !== null;
|
|
5077
5103
|
}
|
|
5078
5104
|
resetStorage() {
|
|
5079
5105
|
Object.keys(localStorage).forEach((e) => {
|
|
5080
|
-
this.logger.debug("Item", { key: e }), e.startsWith(
|
|
5106
|
+
this.logger.debug("Item", { key: e }), e.startsWith($.PREFIX) && (localStorage.removeItem(e), this.logger.debug("Item removed", { key: e }));
|
|
5081
5107
|
});
|
|
5082
5108
|
}
|
|
5083
5109
|
getItem(e) {
|
|
5084
|
-
let t =
|
|
5110
|
+
let t = Ea.formatKey(e), n = localStorage.getItem(t);
|
|
5085
5111
|
return p.fromNullable(n).chain((t) => {
|
|
5086
5112
|
try {
|
|
5087
5113
|
return p.of(JSON.parse(t));
|
|
@@ -5191,56 +5217,56 @@ var Sa = [], Ca = {
|
|
|
5191
5217
|
});
|
|
5192
5218
|
}
|
|
5193
5219
|
saveDeveloperMode() {
|
|
5194
|
-
this.saveItem(
|
|
5220
|
+
this.saveItem($.HAS_DEVELOPER_MODE, !0);
|
|
5195
5221
|
}
|
|
5196
5222
|
hasDeveloperMode() {
|
|
5197
|
-
return this.getItem(
|
|
5223
|
+
return this.getItem($.HAS_DEVELOPER_MODE).orDefault(!1);
|
|
5198
5224
|
}
|
|
5199
5225
|
getFeatureFlags() {
|
|
5200
|
-
let e = this.getItem(
|
|
5226
|
+
let e = this.getItem($.FEATURE_FLAGS).orDefault({});
|
|
5201
5227
|
return {
|
|
5202
5228
|
...Ta,
|
|
5203
5229
|
...e
|
|
5204
5230
|
};
|
|
5205
5231
|
}
|
|
5206
5232
|
saveFeatureFlags(e) {
|
|
5207
|
-
this.saveItem(
|
|
5233
|
+
this.saveItem($.FEATURE_FLAGS, e);
|
|
5208
5234
|
}
|
|
5209
5235
|
getConfigOverrides() {
|
|
5210
|
-
return this.getItem(
|
|
5236
|
+
return this.getItem($.CONFIG_OVERRIDES).orDefault(Sa);
|
|
5211
5237
|
}
|
|
5212
5238
|
saveConfigOverrides(e) {
|
|
5213
|
-
this.saveItem(
|
|
5239
|
+
this.saveItem($.CONFIG_OVERRIDES, e);
|
|
5214
5240
|
}
|
|
5215
5241
|
};
|
|
5216
|
-
|
|
5242
|
+
Da = Ea = L([
|
|
5217
5243
|
v(),
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
],
|
|
5244
|
+
I(0, _(N.LoggerPublisher)),
|
|
5245
|
+
I(1, _(P.IndexedDbService)),
|
|
5246
|
+
F("design:paramtypes", [Object, Object])
|
|
5247
|
+
], Da);
|
|
5222
5248
|
//#endregion
|
|
5223
5249
|
//#region src/internal/storage/service/DefaultIndexedDbService.ts
|
|
5224
|
-
var
|
|
5250
|
+
var Oa = class {
|
|
5225
5251
|
loggerFactory;
|
|
5226
5252
|
logger;
|
|
5227
5253
|
initialization = m;
|
|
5228
|
-
idb = f(new
|
|
5254
|
+
idb = f(new jt("IDB not initialized"));
|
|
5229
5255
|
constructor(e) {
|
|
5230
5256
|
this.loggerFactory = e, this.logger = this.loggerFactory("IndexedDB Service");
|
|
5231
5257
|
}
|
|
5232
5258
|
async initIdb() {
|
|
5233
5259
|
return this.idb.isRight() ? this.idb : this.initialization.isJust() ? (await this.initialization.orDefault(Promise.resolve()), this.idb) : (this.initialization = d(new Promise((e) => {
|
|
5234
|
-
let t = indexedDB.open(
|
|
5260
|
+
let t = indexedDB.open($.DB_NAME, 3);
|
|
5235
5261
|
t.onsuccess = (t) => {
|
|
5236
5262
|
this.logger.debug("IDB opened");
|
|
5237
5263
|
let n = t.target.result;
|
|
5238
5264
|
e(h(n));
|
|
5239
5265
|
}, t.onerror = (t) => {
|
|
5240
|
-
this.logger.error("Error opening IDB", { event: t }), e(f(new
|
|
5266
|
+
this.logger.error("Error opening IDB", { event: t }), e(f(new At("Error opening IDB", { event: t })));
|
|
5241
5267
|
}, t.onupgradeneeded = (e) => {
|
|
5242
|
-
let t = e.target.result.createObjectStore(
|
|
5243
|
-
t.createIndex(
|
|
5268
|
+
let t = e.target.result.createObjectStore($.DB_STORE_NAME);
|
|
5269
|
+
t.createIndex($.DB_STORE_KEYPAIR_KEY, $.DB_STORE_KEYPAIR_KEY, { unique: !0 }), t.createIndex($.ENCRYPTION_KEY, $.ENCRYPTION_KEY, { unique: !0 });
|
|
5244
5270
|
};
|
|
5245
5271
|
}).then((e) => {
|
|
5246
5272
|
Te.isEither(e) && (this.idb = e);
|
|
@@ -5252,11 +5278,11 @@ var Da = class {
|
|
|
5252
5278
|
let n = await this.initIdb();
|
|
5253
5279
|
return new Promise((r) => {
|
|
5254
5280
|
n.map((n) => {
|
|
5255
|
-
let i = n.transaction(
|
|
5281
|
+
let i = n.transaction($.DB_STORE_NAME, "readwrite").objectStore($.DB_STORE_NAME).add(t, $.DB_STORE_KEYPAIR_KEY);
|
|
5256
5282
|
i.onsuccess = () => {
|
|
5257
5283
|
this.logger.debug("KeyPair stored", { keyPair: c(e) }), r(h(!0));
|
|
5258
5284
|
}, i.onerror = (e) => {
|
|
5259
|
-
this.logger.error("Error storing key pair", { event: e }), r(f(new
|
|
5285
|
+
this.logger.error("Error storing key pair", { event: e }), r(f(new S("Error storing key pair", {
|
|
5260
5286
|
event: e,
|
|
5261
5287
|
keyPair: t
|
|
5262
5288
|
})));
|
|
@@ -5268,16 +5294,16 @@ var Da = class {
|
|
|
5268
5294
|
let e = await this.initIdb();
|
|
5269
5295
|
return new Promise((t) => {
|
|
5270
5296
|
e.map((e) => {
|
|
5271
|
-
let n = e.transaction(
|
|
5297
|
+
let n = e.transaction($.DB_STORE_NAME, "readonly").objectStore($.DB_STORE_NAME).get($.DB_STORE_KEYPAIR_KEY);
|
|
5272
5298
|
n.onsuccess = (e) => {
|
|
5273
5299
|
let n = e.target?.result;
|
|
5274
5300
|
if (!n) {
|
|
5275
|
-
this.logger.error("Error getting key pair from indexDB", { event: e }), t(f(new
|
|
5301
|
+
this.logger.error("Error getting key pair from indexDB", { event: e }), t(f(new C("Error getting key pair", { event: e })));
|
|
5276
5302
|
return;
|
|
5277
5303
|
}
|
|
5278
5304
|
this.logger.info("KeyPair retrieved from indexDB", { keyPair: n }), t(h(ne(n)));
|
|
5279
5305
|
}, n.onerror = (e) => {
|
|
5280
|
-
this.logger.error("Error getting key pair", { event: e }), t(f(new
|
|
5306
|
+
this.logger.error("Error getting key pair", { event: e }), t(f(new C("Error getting key pair", { event: e })));
|
|
5281
5307
|
};
|
|
5282
5308
|
});
|
|
5283
5309
|
});
|
|
@@ -5286,11 +5312,11 @@ var Da = class {
|
|
|
5286
5312
|
let e = await this.initIdb();
|
|
5287
5313
|
return new Promise((t) => {
|
|
5288
5314
|
e.map((e) => {
|
|
5289
|
-
let n = e.transaction(
|
|
5315
|
+
let n = e.transaction($.DB_STORE_NAME, "readwrite").objectStore($.DB_STORE_NAME).delete($.DB_STORE_KEYPAIR_KEY);
|
|
5290
5316
|
n.onsuccess = () => {
|
|
5291
5317
|
this.logger.debug("Key pair removed"), t(h(!0));
|
|
5292
5318
|
}, n.onerror = (e) => {
|
|
5293
|
-
this.logger.error("Error removing key pair", { event: e }), t(f(new
|
|
5319
|
+
this.logger.error("Error removing key pair", { event: e }), t(f(new Mt("Error removing key pair", { event: e })));
|
|
5294
5320
|
};
|
|
5295
5321
|
});
|
|
5296
5322
|
});
|
|
@@ -5299,7 +5325,7 @@ var Da = class {
|
|
|
5299
5325
|
let t = await this.initIdb();
|
|
5300
5326
|
return new Promise((n, r) => {
|
|
5301
5327
|
t.map((t) => {
|
|
5302
|
-
let i = t.transaction(
|
|
5328
|
+
let i = t.transaction($.DB_STORE_NAME, "readwrite").objectStore($.DB_STORE_NAME).put(e, $.ENCRYPTION_KEY);
|
|
5303
5329
|
i.onsuccess = () => {
|
|
5304
5330
|
this.logger.debug("Encryption key stored successfully"), n();
|
|
5305
5331
|
}, i.onerror = (e) => {
|
|
@@ -5317,7 +5343,7 @@ var Da = class {
|
|
|
5317
5343
|
let e = await this.initIdb();
|
|
5318
5344
|
return new Promise((t) => {
|
|
5319
5345
|
e.map((e) => {
|
|
5320
|
-
let n = e.transaction(
|
|
5346
|
+
let n = e.transaction($.DB_STORE_NAME, "readonly").objectStore($.DB_STORE_NAME).get($.ENCRYPTION_KEY);
|
|
5321
5347
|
n.onsuccess = (e) => {
|
|
5322
5348
|
let n = e.target?.result;
|
|
5323
5349
|
n && n instanceof CryptoKey ? (this.logger.debug("Encryption key retrieved successfully"), t(d(n))) : (this.logger.debug("No encryption key found in storage"), t(m));
|
|
@@ -5336,14 +5362,14 @@ var Da = class {
|
|
|
5336
5362
|
let t = await this.initIdb();
|
|
5337
5363
|
return new Promise((n) => {
|
|
5338
5364
|
t.map((t) => {
|
|
5339
|
-
let r = t.transaction(
|
|
5365
|
+
let r = t.transaction($.DB_STORE_NAME, "readwrite").objectStore($.DB_STORE_NAME).put(e, $.DB_VERSION);
|
|
5340
5366
|
r.onsuccess = () => {
|
|
5341
5367
|
this.logger.debug("DB version stored in IndexedDB", { version: e }), n(h(void 0));
|
|
5342
5368
|
}, r.onerror = (t) => {
|
|
5343
5369
|
this.logger.error("Error storing DB version in IndexedDB", {
|
|
5344
5370
|
event: t,
|
|
5345
5371
|
version: e
|
|
5346
|
-
}), n(f(new
|
|
5372
|
+
}), n(f(new S("Error storing DB version", {
|
|
5347
5373
|
event: t,
|
|
5348
5374
|
version: e
|
|
5349
5375
|
})));
|
|
@@ -5360,12 +5386,12 @@ var Da = class {
|
|
|
5360
5386
|
let e = await this.initIdb();
|
|
5361
5387
|
return new Promise((t) => {
|
|
5362
5388
|
e.map((e) => {
|
|
5363
|
-
let n = e.transaction(
|
|
5389
|
+
let n = e.transaction($.DB_STORE_NAME, "readonly").objectStore($.DB_STORE_NAME).get($.DB_VERSION);
|
|
5364
5390
|
n.onsuccess = (e) => {
|
|
5365
5391
|
let n = e.target?.result;
|
|
5366
5392
|
n !== void 0 && typeof n == "number" ? (this.logger.debug("DB version retrieved from IndexedDB", { version: n }), t(h(d(n)))) : (this.logger.debug("No DB version found in IndexedDB"), t(h(m)));
|
|
5367
5393
|
}, n.onerror = (e) => {
|
|
5368
|
-
this.logger.error("Error retrieving DB version from IndexedDB", { event: e }), t(f(new
|
|
5394
|
+
this.logger.error("Error retrieving DB version from IndexedDB", { event: e }), t(f(new C("Error retrieving DB version", { event: e })));
|
|
5369
5395
|
};
|
|
5370
5396
|
}).caseOf({
|
|
5371
5397
|
Left: (e) => {
|
|
@@ -5379,14 +5405,14 @@ var Da = class {
|
|
|
5379
5405
|
let t = await this.initIdb();
|
|
5380
5406
|
return new Promise((n) => {
|
|
5381
5407
|
t.map((t) => {
|
|
5382
|
-
let r = t.transaction(
|
|
5408
|
+
let r = t.transaction($.DB_STORE_NAME, "readwrite").objectStore($.DB_STORE_NAME).put(e, $.USER_CONSENT);
|
|
5383
5409
|
r.onsuccess = () => {
|
|
5384
5410
|
this.logger.debug("User consent stored in IndexedDB", { consent: e }), n(h(void 0));
|
|
5385
5411
|
}, r.onerror = (t) => {
|
|
5386
5412
|
this.logger.error("Error storing user consent in IndexedDB", {
|
|
5387
5413
|
event: t,
|
|
5388
5414
|
consent: e
|
|
5389
|
-
}), n(f(new
|
|
5415
|
+
}), n(f(new S("Error storing user consent", {
|
|
5390
5416
|
event: t,
|
|
5391
5417
|
consent: e
|
|
5392
5418
|
})));
|
|
@@ -5403,12 +5429,12 @@ var Da = class {
|
|
|
5403
5429
|
let e = await this.initIdb();
|
|
5404
5430
|
return new Promise((t) => {
|
|
5405
5431
|
e.map((e) => {
|
|
5406
|
-
let n = e.transaction(
|
|
5432
|
+
let n = e.transaction($.DB_STORE_NAME, "readonly").objectStore($.DB_STORE_NAME).get($.USER_CONSENT);
|
|
5407
5433
|
n.onsuccess = (e) => {
|
|
5408
5434
|
let n = e.target?.result;
|
|
5409
5435
|
n === void 0 ? (this.logger.debug("No user consent found in IndexedDB"), t(h(m))) : (this.logger.debug("User consent retrieved from IndexedDB", { consent: n }), t(h(d(n))));
|
|
5410
5436
|
}, n.onerror = (e) => {
|
|
5411
|
-
this.logger.error("Error retrieving user consent from IndexedDB", { event: e }), t(f(new
|
|
5437
|
+
this.logger.error("Error retrieving user consent from IndexedDB", { event: e }), t(f(new C("Error retrieving user consent", { event: e })));
|
|
5412
5438
|
};
|
|
5413
5439
|
}).caseOf({
|
|
5414
5440
|
Left: (e) => {
|
|
@@ -5427,14 +5453,14 @@ var Da = class {
|
|
|
5427
5453
|
},
|
|
5428
5454
|
Right: (t) => {
|
|
5429
5455
|
try {
|
|
5430
|
-
let r = t.transaction(
|
|
5431
|
-
r.objectStore(
|
|
5456
|
+
let r = t.transaction($.DB_STORE_NAME, "readwrite");
|
|
5457
|
+
r.objectStore($.DB_STORE_NAME).put(e, $.PREFERRED_LANGUAGE_STORE_KEY), r.oncomplete = () => {
|
|
5432
5458
|
this.logger.debug("Preferred language stored in IndexedDB", { preferredLanguage: e }), n(h(void 0));
|
|
5433
5459
|
}, r.onerror = (t) => {
|
|
5434
5460
|
this.logger.error("Error storing preferred language in IndexedDB", {
|
|
5435
5461
|
event: t,
|
|
5436
5462
|
preferredLanguage: e
|
|
5437
|
-
}), n(f(new
|
|
5463
|
+
}), n(f(new S("Error storing preferred language", {
|
|
5438
5464
|
event: t,
|
|
5439
5465
|
preferredLanguage: e
|
|
5440
5466
|
})));
|
|
@@ -5443,7 +5469,7 @@ var Da = class {
|
|
|
5443
5469
|
this.logger.error("Unexpected error while storing preferred language in IndexedDB", {
|
|
5444
5470
|
error: t,
|
|
5445
5471
|
preferredLanguage: e
|
|
5446
|
-
}), n(f(new
|
|
5472
|
+
}), n(f(new S("Unexpected error while storing preferred language", {
|
|
5447
5473
|
error: t,
|
|
5448
5474
|
preferredLanguage: e
|
|
5449
5475
|
})));
|
|
@@ -5461,15 +5487,15 @@ var Da = class {
|
|
|
5461
5487
|
},
|
|
5462
5488
|
Right: (e) => {
|
|
5463
5489
|
try {
|
|
5464
|
-
let n = e.transaction(
|
|
5490
|
+
let n = e.transaction($.DB_STORE_NAME, "readonly"), r = n.objectStore($.DB_STORE_NAME).get($.PREFERRED_LANGUAGE_STORE_KEY);
|
|
5465
5491
|
r.onsuccess = (e) => {
|
|
5466
5492
|
let n = e.target?.result;
|
|
5467
5493
|
n !== void 0 && typeof n == "string" ? (this.logger.debug("Preferred language retrieved from IndexedDB", { preferredLanguage: n }), t(h(d(n)))) : (this.logger.debug("No preferred language found in IndexedDB"), t(h(m)));
|
|
5468
5494
|
}, n.onerror = (e) => {
|
|
5469
|
-
this.logger.error("Error retrieving preferred language from IndexedDB", { event: e }), t(f(new
|
|
5495
|
+
this.logger.error("Error retrieving preferred language from IndexedDB", { event: e }), t(f(new C("Error retrieving preferred language", { event: e })));
|
|
5470
5496
|
};
|
|
5471
5497
|
} catch (e) {
|
|
5472
|
-
this.logger.error("Unexpected error while retrieving preferred language from IndexedDB", { error: e }), t(f(new
|
|
5498
|
+
this.logger.error("Unexpected error while retrieving preferred language from IndexedDB", { error: e }), t(f(new C("Unexpected error while retrieving preferred language", { error: e })));
|
|
5473
5499
|
}
|
|
5474
5500
|
}
|
|
5475
5501
|
});
|
|
@@ -5479,14 +5505,14 @@ var Da = class {
|
|
|
5479
5505
|
let t = await this.initIdb();
|
|
5480
5506
|
return new Promise((n) => {
|
|
5481
5507
|
t.map((t) => {
|
|
5482
|
-
let r = t.transaction(
|
|
5508
|
+
let r = t.transaction($.DB_STORE_NAME, "readwrite").objectStore($.DB_STORE_NAME).put(e, $.WELCOME_SCREEN_COMPLETED);
|
|
5483
5509
|
r.onsuccess = () => {
|
|
5484
5510
|
this.logger.debug("Welcome screen status stored in IndexedDB", { completed: e }), n(h(void 0));
|
|
5485
5511
|
}, r.onerror = (t) => {
|
|
5486
5512
|
this.logger.error("Error storing welcome screen status in IndexedDB", {
|
|
5487
5513
|
event: t,
|
|
5488
5514
|
completed: e
|
|
5489
|
-
}), n(f(new
|
|
5515
|
+
}), n(f(new S("Error storing welcome screen status", {
|
|
5490
5516
|
event: t,
|
|
5491
5517
|
completed: e
|
|
5492
5518
|
})));
|
|
@@ -5503,12 +5529,12 @@ var Da = class {
|
|
|
5503
5529
|
let e = await this.initIdb();
|
|
5504
5530
|
return new Promise((t) => {
|
|
5505
5531
|
e.map((e) => {
|
|
5506
|
-
let n = e.transaction(
|
|
5532
|
+
let n = e.transaction($.DB_STORE_NAME, "readonly").objectStore($.DB_STORE_NAME).get($.WELCOME_SCREEN_COMPLETED);
|
|
5507
5533
|
n.onsuccess = (e) => {
|
|
5508
5534
|
let n = e.target?.result;
|
|
5509
5535
|
n !== void 0 && typeof n == "boolean" ? (this.logger.debug("Welcome screen status retrieved from IndexedDB", { completed: n }), t(h(d(n)))) : (this.logger.debug("No welcome screen status found in IndexedDB"), t(h(m)));
|
|
5510
5536
|
}, n.onerror = (e) => {
|
|
5511
|
-
this.logger.error("Error retrieving welcome screen status from IndexedDB", { event: e }), t(f(new
|
|
5537
|
+
this.logger.error("Error retrieving welcome screen status from IndexedDB", { event: e }), t(f(new C("Error retrieving welcome screen status", { event: e })));
|
|
5512
5538
|
};
|
|
5513
5539
|
}).caseOf({
|
|
5514
5540
|
Left: (e) => {
|
|
@@ -5527,14 +5553,14 @@ var Da = class {
|
|
|
5527
5553
|
},
|
|
5528
5554
|
Right: (t) => {
|
|
5529
5555
|
try {
|
|
5530
|
-
let r = t.transaction(
|
|
5531
|
-
r.objectStore(
|
|
5556
|
+
let r = t.transaction($.DB_STORE_NAME, "readwrite");
|
|
5557
|
+
r.objectStore($.DB_STORE_NAME).put(e, $.PREFERRED_FIAT_CURRENCY_STORE_KEY), r.oncomplete = () => {
|
|
5532
5558
|
this.logger.debug("Preferred fiat currency stored in IndexedDB", { preferredFiatCurrency: e }), n(h(void 0));
|
|
5533
5559
|
}, r.onerror = (t) => {
|
|
5534
5560
|
this.logger.error("Error storing preferred fiat currency in IndexedDB", {
|
|
5535
5561
|
event: t,
|
|
5536
5562
|
preferredFiatCurrency: e
|
|
5537
|
-
}), n(f(new
|
|
5563
|
+
}), n(f(new S("Error storing preferred fiat currency", {
|
|
5538
5564
|
event: t,
|
|
5539
5565
|
preferredFiatCurrency: e
|
|
5540
5566
|
})));
|
|
@@ -5543,7 +5569,7 @@ var Da = class {
|
|
|
5543
5569
|
this.logger.error("Unexpected error while storing preferred fiat currency in IndexedDB", {
|
|
5544
5570
|
error: t,
|
|
5545
5571
|
preferredFiatCurrency: e
|
|
5546
|
-
}), n(f(new
|
|
5572
|
+
}), n(f(new S("Unexpected error while storing preferred fiat currency", {
|
|
5547
5573
|
error: t,
|
|
5548
5574
|
preferredFiatCurrency: e
|
|
5549
5575
|
})));
|
|
@@ -5561,29 +5587,29 @@ var Da = class {
|
|
|
5561
5587
|
},
|
|
5562
5588
|
Right: (e) => {
|
|
5563
5589
|
try {
|
|
5564
|
-
let n = e.transaction(
|
|
5590
|
+
let n = e.transaction($.DB_STORE_NAME, "readonly"), r = n.objectStore($.DB_STORE_NAME).get($.PREFERRED_FIAT_CURRENCY_STORE_KEY);
|
|
5565
5591
|
r.onsuccess = (e) => {
|
|
5566
5592
|
let n = e.target?.result;
|
|
5567
5593
|
n !== void 0 && typeof n == "string" ? (this.logger.debug("Preferred fiat currency retrieved from IndexedDB", { preferredFiatCurrency: n }), t(h(d(n)))) : (this.logger.debug("No preferred fiat currency found in IndexedDB"), t(h(m)));
|
|
5568
5594
|
}, n.onerror = (e) => {
|
|
5569
|
-
this.logger.error("Error retrieving preferred fiat currency from IndexedDB", { event: e }), t(f(new
|
|
5595
|
+
this.logger.error("Error retrieving preferred fiat currency from IndexedDB", { event: e }), t(f(new C("Error retrieving preferred fiat currency", { event: e })));
|
|
5570
5596
|
};
|
|
5571
5597
|
} catch (e) {
|
|
5572
|
-
this.logger.error("Unexpected error while retrieving preferred fiat currency from IndexedDB", { error: e }), t(f(new
|
|
5598
|
+
this.logger.error("Unexpected error while retrieving preferred fiat currency from IndexedDB", { error: e }), t(f(new C("Unexpected error while retrieving preferred fiat currency", { error: e })));
|
|
5573
5599
|
}
|
|
5574
5600
|
}
|
|
5575
5601
|
});
|
|
5576
5602
|
});
|
|
5577
5603
|
}
|
|
5578
5604
|
};
|
|
5579
|
-
|
|
5605
|
+
Oa = L([
|
|
5580
5606
|
v(),
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
],
|
|
5607
|
+
I(0, _(N.LoggerPublisher)),
|
|
5608
|
+
F("design:paramtypes", [Object])
|
|
5609
|
+
], Oa);
|
|
5584
5610
|
//#endregion
|
|
5585
5611
|
//#region src/internal/storage/use-case/KeypairMigrationService.ts
|
|
5586
|
-
var
|
|
5612
|
+
var ka = class {
|
|
5587
5613
|
loggerFactory;
|
|
5588
5614
|
storageService;
|
|
5589
5615
|
encryptKeyPairUseCase;
|
|
@@ -5609,24 +5635,24 @@ var Oa = class {
|
|
|
5609
5635
|
await this.storageService.removeKeyPair(), await this.storageService.storeKeyPair(r);
|
|
5610
5636
|
}
|
|
5611
5637
|
};
|
|
5612
|
-
|
|
5638
|
+
ka = L([
|
|
5613
5639
|
v(),
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5640
|
+
I(0, _(N.LoggerPublisher)),
|
|
5641
|
+
I(1, _(P.StorageService)),
|
|
5642
|
+
I(2, _(G.EncryptKeyPairUseCase)),
|
|
5643
|
+
I(3, _(G.GetEncryptionKeyUseCase)),
|
|
5644
|
+
I(4, _(G.GetOrCreateKeyPairUseCase)),
|
|
5645
|
+
F("design:paramtypes", [
|
|
5620
5646
|
Object,
|
|
5621
5647
|
Object,
|
|
5622
5648
|
Object,
|
|
5623
5649
|
Object,
|
|
5624
5650
|
Object
|
|
5625
5651
|
])
|
|
5626
|
-
],
|
|
5652
|
+
], ka);
|
|
5627
5653
|
//#endregion
|
|
5628
5654
|
//#region src/internal/storage/use-case/MigrateDbUseCase.ts
|
|
5629
|
-
var
|
|
5655
|
+
var Aa = class {
|
|
5630
5656
|
loggerFactory;
|
|
5631
5657
|
storageService;
|
|
5632
5658
|
keyPairMigrationService;
|
|
@@ -5648,51 +5674,51 @@ var ka = class {
|
|
|
5648
5674
|
async migrateToV2() {
|
|
5649
5675
|
let e = await this.storageService.setDbVersion(2);
|
|
5650
5676
|
if (e.isLeft()) throw this.logger.error("Failed to store DB version in IndexedDB", { error: e.extract() }), Error("Failed to migrate DB version to IndexedDB");
|
|
5651
|
-
this.storageService.removeItem(
|
|
5677
|
+
this.storageService.removeItem($.DB_VERSION), this.logger.info("Database migrated to version 2");
|
|
5652
5678
|
}
|
|
5653
5679
|
async migrateToV3() {
|
|
5654
|
-
this.storageService.getItem(
|
|
5655
|
-
let t = this.storageService.getItem(
|
|
5656
|
-
"ethereum" in t || (t[
|
|
5657
|
-
}), this.storageService.removeItem(
|
|
5680
|
+
this.storageService.getItem($.SELECTED_ACCOUNT).ifJust((e) => {
|
|
5681
|
+
let t = this.storageService.getItem($.SELECTED_ACCOUNTS).orDefault({});
|
|
5682
|
+
"ethereum" in t || (t[w] = e, this.storageService.saveItem($.SELECTED_ACCOUNTS, t));
|
|
5683
|
+
}), this.storageService.removeItem($.SELECTED_ACCOUNT);
|
|
5658
5684
|
let e = await this.storageService.setDbVersion(3);
|
|
5659
5685
|
if (e.isLeft()) throw this.logger.error("Failed to store DB version to already migrated database", { error: e.extract() }), Error("Failed to store DB version to already migrated database");
|
|
5660
5686
|
this.logger.info("Database migrated to version 3");
|
|
5661
5687
|
}
|
|
5662
5688
|
};
|
|
5663
|
-
|
|
5689
|
+
Aa = L([
|
|
5664
5690
|
v(),
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5691
|
+
I(0, _(N.LoggerPublisher)),
|
|
5692
|
+
I(1, _(P.StorageService)),
|
|
5693
|
+
I(2, _(P.KeyPairMigrationService)),
|
|
5694
|
+
F("design:paramtypes", [
|
|
5669
5695
|
Object,
|
|
5670
5696
|
Object,
|
|
5671
5697
|
Object
|
|
5672
5698
|
])
|
|
5673
|
-
],
|
|
5699
|
+
], Aa);
|
|
5674
5700
|
//#endregion
|
|
5675
5701
|
//#region src/internal/storage/di/storageModule.ts
|
|
5676
|
-
function
|
|
5702
|
+
function ja({ stub: e }) {
|
|
5677
5703
|
return new g(({ bind: e }) => {
|
|
5678
|
-
e(
|
|
5704
|
+
e(P.StorageService).to(Da).inSingletonScope(), e(P.IndexedDbService).to(Oa).inSingletonScope(), e(P.MigrateDbUseCase).to(Aa).inSingletonScope(), e(P.KeyPairMigrationService).to(ka).inSingletonScope();
|
|
5679
5705
|
});
|
|
5680
5706
|
}
|
|
5681
5707
|
//#endregion
|
|
5682
5708
|
//#region src/internal/transaction-history/model/TransactionHistoryError.ts
|
|
5683
|
-
var
|
|
5709
|
+
var Ma = class extends x {
|
|
5684
5710
|
constructor(e, t) {
|
|
5685
5711
|
super(e, "TransactionHistoryError", t);
|
|
5686
5712
|
}
|
|
5687
5713
|
};
|
|
5688
5714
|
//#endregion
|
|
5689
5715
|
//#region src/internal/transaction-history/utils/resolveNetworkSlug.ts
|
|
5690
|
-
function
|
|
5716
|
+
function Na(e, t) {
|
|
5691
5717
|
return t ? e : void 0;
|
|
5692
5718
|
}
|
|
5693
5719
|
//#endregion
|
|
5694
5720
|
//#region src/internal/transaction-history/datasource/coinService/DefaultTransactionHistoryDataSource.ts
|
|
5695
|
-
var
|
|
5721
|
+
var Pa = (/* @__PURE__ */ new Date(0)).toISOString(), Fa = "-FEES", Ia = 20, La = class {
|
|
5696
5722
|
networkService;
|
|
5697
5723
|
config;
|
|
5698
5724
|
blockchainProviderManager;
|
|
@@ -5701,16 +5727,16 @@ var Na = (/* @__PURE__ */ new Date(0)).toISOString(), Pa = "-FEES", Fa = 20, Ia
|
|
|
5701
5727
|
this.networkService = e, this.config = t, this.blockchainProviderManager = n, this.logger = r("DefaultTransactionHistoryDataSource");
|
|
5702
5728
|
}
|
|
5703
5729
|
async getTransactions(e, t, n) {
|
|
5704
|
-
let r = this.blockchainProviderManager.describeCurrency(t).map((e) => e.family), i =
|
|
5730
|
+
let r = this.blockchainProviderManager.describeCurrency(t).map((e) => e.family), i = Na(t, r.extract());
|
|
5705
5731
|
if (!i) return this.logger.warn("Unsupported currency for transaction history", {
|
|
5706
5732
|
currencyId: t,
|
|
5707
5733
|
address: e
|
|
5708
|
-
}), f(new
|
|
5734
|
+
}), f(new Ma(`Unsupported currency for transaction history: ${t}`, {
|
|
5709
5735
|
address: e,
|
|
5710
5736
|
currencyId: t
|
|
5711
5737
|
}));
|
|
5712
5738
|
let a = this.buildRequestUrl(i, e, this.buildQueryParams(n));
|
|
5713
|
-
return (await this.networkService.get(a)).mapLeft((n) => new
|
|
5739
|
+
return (await this.networkService.get(a)).mapLeft((n) => new Ma(`Failed to fetch transaction history for ${e}`, {
|
|
5714
5740
|
address: e,
|
|
5715
5741
|
currencyId: t,
|
|
5716
5742
|
originalError: n.message
|
|
@@ -5735,7 +5761,7 @@ var Na = (/* @__PURE__ */ new Date(0)).toISOString(), Pa = "-FEES", Fa = 20, Ia
|
|
|
5735
5761
|
}
|
|
5736
5762
|
mapDtoToPage(e, t) {
|
|
5737
5763
|
return {
|
|
5738
|
-
items: e.items.slice(0,
|
|
5764
|
+
items: e.items.slice(0, Ia).map((e) => this.mapDtoToEntry(e, t)),
|
|
5739
5765
|
nextPageToken: e.next ?? void 0
|
|
5740
5766
|
};
|
|
5741
5767
|
}
|
|
@@ -5759,7 +5785,7 @@ var Na = (/* @__PURE__ */ new Date(0)).toISOString(), Pa = "-FEES", Fa = 20, Ia
|
|
|
5759
5785
|
return t && t !== "0" ? t : e.value ?? "0";
|
|
5760
5786
|
}
|
|
5761
5787
|
resolveTimestamp(e) {
|
|
5762
|
-
return e.tx?.block?.time ?? e.tx?.date ??
|
|
5788
|
+
return e.tx?.block?.time ?? e.tx?.date ?? Pa;
|
|
5763
5789
|
}
|
|
5764
5790
|
resolveAsset(e) {
|
|
5765
5791
|
let t = e.asset;
|
|
@@ -5782,53 +5808,53 @@ var Na = (/* @__PURE__ */ new Date(0)).toISOString(), Pa = "-FEES", Fa = 20, Ia
|
|
|
5782
5808
|
if (e.type === "IN") return "received";
|
|
5783
5809
|
}
|
|
5784
5810
|
detectFeeOnlyOperation(e) {
|
|
5785
|
-
return e.id?.endsWith(
|
|
5811
|
+
return e.id?.endsWith(Fa) ?? !1;
|
|
5786
5812
|
}
|
|
5787
5813
|
};
|
|
5788
|
-
|
|
5814
|
+
La = L([
|
|
5789
5815
|
v(),
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5816
|
+
I(0, _(U.NetworkService)),
|
|
5817
|
+
I(1, _(k.Config)),
|
|
5818
|
+
I(2, _(O.BlockchainProviderManager)),
|
|
5819
|
+
I(3, _(N.LoggerPublisher)),
|
|
5820
|
+
F("design:paramtypes", [
|
|
5795
5821
|
Object,
|
|
5796
|
-
|
|
5822
|
+
H === void 0 ? Object : H,
|
|
5797
5823
|
Object,
|
|
5798
5824
|
Object
|
|
5799
5825
|
])
|
|
5800
|
-
],
|
|
5826
|
+
], La);
|
|
5801
5827
|
//#endregion
|
|
5802
5828
|
//#region src/internal/transaction-history/use-case/buildTransactionHistoryItem.ts
|
|
5803
|
-
function
|
|
5804
|
-
let i =
|
|
5829
|
+
function Ra({ entry: e, normalizedAddress: t, assetInfo: n, nativeAssetInfo: r }) {
|
|
5830
|
+
let i = za(e, t);
|
|
5805
5831
|
return {
|
|
5806
5832
|
hash: e.hash,
|
|
5807
|
-
type:
|
|
5833
|
+
type: Ha(i),
|
|
5808
5834
|
direction: i,
|
|
5809
|
-
kind:
|
|
5810
|
-
status:
|
|
5835
|
+
kind: Ba(e),
|
|
5836
|
+
status: Va(e),
|
|
5811
5837
|
value: e.value,
|
|
5812
5838
|
asset: n,
|
|
5813
5839
|
timestamp: e.timestamp,
|
|
5814
5840
|
blockHeight: e.blockHeight,
|
|
5815
|
-
fee:
|
|
5841
|
+
fee: Ua(e, t, r)
|
|
5816
5842
|
};
|
|
5817
5843
|
}
|
|
5818
|
-
function
|
|
5844
|
+
function za(e, t) {
|
|
5819
5845
|
let n = e.senders.includes(t), r = e.recipients.includes(t);
|
|
5820
5846
|
return n && r ? "self" : n ? "sent" : r ? "received" : e.direction ?? "self";
|
|
5821
5847
|
}
|
|
5822
|
-
function
|
|
5848
|
+
function Ba(e) {
|
|
5823
5849
|
return e.isFeeOnlyOperation ? "fees" : "transfer";
|
|
5824
5850
|
}
|
|
5825
|
-
function
|
|
5851
|
+
function Va(e) {
|
|
5826
5852
|
return e.failed ? "failed" : "confirmed";
|
|
5827
5853
|
}
|
|
5828
|
-
function
|
|
5854
|
+
function Ha(e) {
|
|
5829
5855
|
return e === "received" ? "received" : "sent";
|
|
5830
5856
|
}
|
|
5831
|
-
function
|
|
5857
|
+
function Ua(e, t, n) {
|
|
5832
5858
|
let r = e.fee;
|
|
5833
5859
|
if (r && !(r.payer && r.payer !== t)) return {
|
|
5834
5860
|
amount: r.amount,
|
|
@@ -5837,7 +5863,7 @@ function Ha(e, t, n) {
|
|
|
5837
5863
|
}
|
|
5838
5864
|
//#endregion
|
|
5839
5865
|
//#region src/internal/transaction-history/use-case/FetchTransactionHistoryUseCase.ts
|
|
5840
|
-
var
|
|
5866
|
+
var Wa = class {
|
|
5841
5867
|
dataSource;
|
|
5842
5868
|
calDataSource;
|
|
5843
5869
|
blockchainProviderManager;
|
|
@@ -5879,7 +5905,7 @@ var Ua = class {
|
|
|
5879
5905
|
}
|
|
5880
5906
|
async transformPage(e, t, n, r, i) {
|
|
5881
5907
|
return {
|
|
5882
|
-
transactions: await Promise.all(e.items.map(async (e) =>
|
|
5908
|
+
transactions: await Promise.all(e.items.map(async (e) => Ra({
|
|
5883
5909
|
entry: e,
|
|
5884
5910
|
normalizedAddress: t,
|
|
5885
5911
|
assetInfo: await this.resolveAssetInfo(e, n, r),
|
|
@@ -5915,22 +5941,22 @@ var Ua = class {
|
|
|
5915
5941
|
return this.blockchainProviderManager.describeCurrency(e).map((e) => e.nativeDecimals).orDefaultLazy(() => (this.logger.warn("Unresolved decimals, reporting raw amounts", { currencyId: e }), 0));
|
|
5916
5942
|
}
|
|
5917
5943
|
};
|
|
5918
|
-
|
|
5944
|
+
Wa = L([
|
|
5919
5945
|
v(),
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5946
|
+
I(0, _(N.LoggerPublisher)),
|
|
5947
|
+
I(1, _(z.TransactionHistoryDataSource)),
|
|
5948
|
+
I(2, _(D.CalDataSource)),
|
|
5949
|
+
I(3, _(O.BlockchainProviderManager)),
|
|
5950
|
+
F("design:paramtypes", [
|
|
5925
5951
|
Object,
|
|
5926
5952
|
Object,
|
|
5927
5953
|
Object,
|
|
5928
5954
|
Object
|
|
5929
5955
|
])
|
|
5930
|
-
],
|
|
5956
|
+
], Wa);
|
|
5931
5957
|
//#endregion
|
|
5932
5958
|
//#region src/internal/transaction-history/use-case/HydrateTransactionsWithFiatUseCase.ts
|
|
5933
|
-
var
|
|
5959
|
+
var Ga = "unknown", Ka = class {
|
|
5934
5960
|
counterValueDataSource;
|
|
5935
5961
|
logger;
|
|
5936
5962
|
constructor(e, t) {
|
|
@@ -5944,13 +5970,13 @@ var Wa = "unknown", Ga = class {
|
|
|
5944
5970
|
groupTransactionsByLedgerId(e) {
|
|
5945
5971
|
let t = /* @__PURE__ */ new Map();
|
|
5946
5972
|
for (let n of e) {
|
|
5947
|
-
let e = n.asset.ledgerId ??
|
|
5973
|
+
let e = n.asset.ledgerId ?? Ga, r = t.get(e) ?? [];
|
|
5948
5974
|
r.push(n), t.set(e, r);
|
|
5949
5975
|
}
|
|
5950
5976
|
return t;
|
|
5951
5977
|
}
|
|
5952
5978
|
async hydrateTransactionGroup(e, t, n) {
|
|
5953
|
-
if (t ===
|
|
5979
|
+
if (t === Ga) return this.logger.warn("Skipping fiat hydration for transactions without ledgerId", { transactionCount: e.length }), e;
|
|
5954
5980
|
let { minDate: r, maxDate: i } = this.getDateRange(e);
|
|
5955
5981
|
return (await this.counterValueDataSource.getHistoricalRates(t, n, r, i)).caseOf({
|
|
5956
5982
|
Left: (r) => (this.logger.warn("Failed to fetch historical rates for transactions", {
|
|
@@ -5997,22 +6023,22 @@ var Wa = "unknown", Ga = class {
|
|
|
5997
6023
|
if (r.isFinite()) return r.shiftedBy(-t).multipliedBy(n).toFixed(2);
|
|
5998
6024
|
}
|
|
5999
6025
|
};
|
|
6000
|
-
|
|
6026
|
+
Ka = L([
|
|
6001
6027
|
v(),
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
],
|
|
6028
|
+
I(0, _(N.LoggerPublisher)),
|
|
6029
|
+
I(1, _(D.CounterValueDataSource)),
|
|
6030
|
+
F("design:paramtypes", [Object, Object])
|
|
6031
|
+
], Ka);
|
|
6006
6032
|
//#endregion
|
|
6007
6033
|
//#region src/internal/transaction-history/di/transactionHistoryModule.ts
|
|
6008
|
-
function
|
|
6034
|
+
function qa({ stub: e }) {
|
|
6009
6035
|
return new g(({ bind: e }) => {
|
|
6010
|
-
e(
|
|
6036
|
+
e(z.TransactionHistoryDataSource).to(La).inSingletonScope(), e(z.FetchTransactionHistoryUseCase).to(Wa).inSingletonScope(), e(z.HydrateTransactionsWithFiatUseCase).to(Ka).inSingletonScope();
|
|
6011
6037
|
});
|
|
6012
6038
|
}
|
|
6013
6039
|
//#endregion
|
|
6014
6040
|
//#region src/internal/blockchain-provider/service/DefaultBlockchainProviderManager.ts
|
|
6015
|
-
var
|
|
6041
|
+
var Ja = "ethereum", Ya = 18, Xa = class {
|
|
6016
6042
|
contextService;
|
|
6017
6043
|
storageService;
|
|
6018
6044
|
logger;
|
|
@@ -6042,7 +6068,7 @@ var qa = "ethereum", Ja = 18, Ya = class {
|
|
|
6042
6068
|
let t = this.providers.get(e);
|
|
6043
6069
|
if (!t) return [];
|
|
6044
6070
|
let n = new Map(t.dappConfig.networks.map((e) => [e.currencyId, e]));
|
|
6045
|
-
if (e ===
|
|
6071
|
+
if (e === Ja) for (let e of this.storageService.getConfigOverrides()) n.set(e.currencyId, e);
|
|
6046
6072
|
return [...n.values()];
|
|
6047
6073
|
}
|
|
6048
6074
|
getAllNetworks() {
|
|
@@ -6065,37 +6091,37 @@ var qa = "ethereum", Ja = 18, Ya = class {
|
|
|
6065
6091
|
let t = this.storageService.getConfigOverrides().find(e);
|
|
6066
6092
|
return t ? p.of({
|
|
6067
6093
|
currencyId: t.currencyId,
|
|
6068
|
-
family:
|
|
6094
|
+
family: Ja,
|
|
6069
6095
|
networkId: t.id,
|
|
6070
|
-
nativeDecimals:
|
|
6096
|
+
nativeDecimals: Ya
|
|
6071
6097
|
}) : p.empty();
|
|
6072
6098
|
}
|
|
6073
6099
|
};
|
|
6074
|
-
|
|
6100
|
+
Xa = L([
|
|
6075
6101
|
v(),
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6102
|
+
I(0, _(A.ContextService)),
|
|
6103
|
+
I(1, _(N.LoggerPublisher)),
|
|
6104
|
+
I(2, _(P.StorageService)),
|
|
6105
|
+
F("design:paramtypes", [
|
|
6080
6106
|
Object,
|
|
6081
6107
|
Object,
|
|
6082
6108
|
Object
|
|
6083
6109
|
])
|
|
6084
|
-
],
|
|
6110
|
+
], Xa);
|
|
6085
6111
|
//#endregion
|
|
6086
6112
|
//#region src/internal/backend/utils.ts
|
|
6087
|
-
function
|
|
6113
|
+
function Za(e) {
|
|
6088
6114
|
return typeof e == "object" && !!e && "jsonrpc" in e && "id" in e && ("result" in e || "error" in e);
|
|
6089
6115
|
}
|
|
6090
|
-
function
|
|
6116
|
+
function Qa(e) {
|
|
6091
6117
|
return typeof e == "object" && !!e && "result" in e && !("error" in e);
|
|
6092
6118
|
}
|
|
6093
|
-
function
|
|
6119
|
+
function $a(e) {
|
|
6094
6120
|
return typeof e == "object" && !!e && "transactionIdentifier" in e;
|
|
6095
6121
|
}
|
|
6096
6122
|
//#endregion
|
|
6097
6123
|
//#region src/internal/balance/constants/networkConstants.ts
|
|
6098
|
-
var
|
|
6124
|
+
var eo = {
|
|
6099
6125
|
1: "ethereum",
|
|
6100
6126
|
61: "ethereum_classic",
|
|
6101
6127
|
17e3: "ethereum_holesky",
|
|
@@ -6146,12 +6172,12 @@ var $a = {
|
|
|
6146
6172
|
300: "zksync_sepolia",
|
|
6147
6173
|
5042: "arc"
|
|
6148
6174
|
};
|
|
6149
|
-
function
|
|
6150
|
-
return
|
|
6175
|
+
function to(e) {
|
|
6176
|
+
return eo[e];
|
|
6151
6177
|
}
|
|
6152
6178
|
//#endregion
|
|
6153
6179
|
//#region src/internal/blockchain-provider/service/DefaultCoreFacadeService.ts
|
|
6154
|
-
var
|
|
6180
|
+
var no = class {
|
|
6155
6181
|
_navigationIntentService;
|
|
6156
6182
|
_contextService;
|
|
6157
6183
|
_blockchainProviderManager;
|
|
@@ -6180,7 +6206,7 @@ var to = class {
|
|
|
6180
6206
|
rpc: e
|
|
6181
6207
|
})).caseOf({
|
|
6182
6208
|
Right: (e) => {
|
|
6183
|
-
if (
|
|
6209
|
+
if (Za(e) || $a(e)) return e;
|
|
6184
6210
|
throw Error("Unexpected broadcast response for JSON-RPC request");
|
|
6185
6211
|
},
|
|
6186
6212
|
Left: (e) => {
|
|
@@ -6189,7 +6215,7 @@ var to = class {
|
|
|
6189
6215
|
});
|
|
6190
6216
|
}
|
|
6191
6217
|
async requestAccount(e) {
|
|
6192
|
-
return
|
|
6218
|
+
return T(this._contextService.getContext(), e) || new Promise((t, n) => {
|
|
6193
6219
|
let r = new ae(), i = (e) => {
|
|
6194
6220
|
if (o(), e.detail.status === "error") {
|
|
6195
6221
|
n(e.detail.error);
|
|
@@ -6197,7 +6223,7 @@ var to = class {
|
|
|
6197
6223
|
}
|
|
6198
6224
|
t(e.detail.account);
|
|
6199
6225
|
}, a = () => {
|
|
6200
|
-
o(), n(new
|
|
6226
|
+
o(), n(new Ct("User closed the modal"));
|
|
6201
6227
|
}, o = () => {
|
|
6202
6228
|
window.removeEventListener("ledger-provider-account-selected", i), window.removeEventListener("ledger-provider-close", a);
|
|
6203
6229
|
};
|
|
@@ -6246,9 +6272,11 @@ var to = class {
|
|
|
6246
6272
|
};
|
|
6247
6273
|
}
|
|
6248
6274
|
getSdkConfig() {
|
|
6275
|
+
let e = this._config.getClearSigningEndpoints();
|
|
6249
6276
|
return {
|
|
6250
6277
|
originToken: this._config.originToken,
|
|
6251
|
-
dAppIdentifier: this._config.dAppIdentifier
|
|
6278
|
+
dAppIdentifier: this._config.dAppIdentifier,
|
|
6279
|
+
...e ? { clearSigningEndpoints: e } : {}
|
|
6252
6280
|
};
|
|
6253
6281
|
}
|
|
6254
6282
|
isModalOpen() {
|
|
@@ -6271,14 +6299,14 @@ var to = class {
|
|
|
6271
6299
|
}
|
|
6272
6300
|
_warmCurrencyMetadata(e) {
|
|
6273
6301
|
if (e.name !== "signTransaction" || !e.params.broadcast) return;
|
|
6274
|
-
let t =
|
|
6302
|
+
let t = T(this._contextService.getContext(), e.params.family);
|
|
6275
6303
|
t && this._calDataSource.getCurrencyInformation(t.currencyId);
|
|
6276
6304
|
}
|
|
6277
6305
|
trackBroadcastedTransaction(e, t) {
|
|
6278
6306
|
this._trackBroadcastedTransaction.execute(e, t);
|
|
6279
6307
|
}
|
|
6280
6308
|
async estimateGasFromCoinService(e) {
|
|
6281
|
-
let t =
|
|
6309
|
+
let t = to(e.chainId);
|
|
6282
6310
|
if (t) return (await this._coinServiceDataSource.estimateTransactionFee(t, {
|
|
6283
6311
|
type: "send",
|
|
6284
6312
|
sender: e.from,
|
|
@@ -6299,24 +6327,24 @@ var to = class {
|
|
|
6299
6327
|
});
|
|
6300
6328
|
}
|
|
6301
6329
|
};
|
|
6302
|
-
|
|
6330
|
+
no = L([
|
|
6303
6331
|
v(),
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6332
|
+
I(0, _(Zi.NavigationIntentService)),
|
|
6333
|
+
I(1, _(A.ContextService)),
|
|
6334
|
+
I(2, _(O.BlockchainProviderManager)),
|
|
6335
|
+
I(3, _(En.BackendService)),
|
|
6336
|
+
I(4, _(M.DeviceManagementKitService)),
|
|
6337
|
+
I(5, _(k.Config)),
|
|
6338
|
+
I(6, _(Ji.ModalService)),
|
|
6339
|
+
I(7, _(D.CoinServiceDataSource)),
|
|
6340
|
+
I(8, _(D.CalDataSource)),
|
|
6341
|
+
I(9, _(W.TrackTransactionStarted)),
|
|
6342
|
+
I(10, _(W.TrackTransactionCompleted)),
|
|
6343
|
+
I(11, _(W.TrackTypedMessageStarted)),
|
|
6344
|
+
I(12, _(W.TrackTypedMessageCompleted)),
|
|
6345
|
+
I(13, _(Z.TrackBroadcastedTransactionUseCase)),
|
|
6346
|
+
I(14, _(N.LoggerPublisher)),
|
|
6347
|
+
F("design:paramtypes", [
|
|
6320
6348
|
Object,
|
|
6321
6349
|
Object,
|
|
6322
6350
|
Object,
|
|
@@ -6333,17 +6361,17 @@ to = I([
|
|
|
6333
6361
|
Object,
|
|
6334
6362
|
Object
|
|
6335
6363
|
])
|
|
6336
|
-
],
|
|
6364
|
+
], no);
|
|
6337
6365
|
//#endregion
|
|
6338
6366
|
//#region src/internal/blockchain-provider/di/blockchainProviderModule.ts
|
|
6339
|
-
function
|
|
6367
|
+
function ro() {
|
|
6340
6368
|
return new g(({ bind: e }) => {
|
|
6341
|
-
e(
|
|
6369
|
+
e(O.BlockchainProviderManager).to(Xa).inSingletonScope(), e(O.CoreFacadeService).to(no).inSingletonScope();
|
|
6342
6370
|
});
|
|
6343
6371
|
}
|
|
6344
6372
|
//#endregion
|
|
6345
6373
|
//#region src/internal/di.ts
|
|
6346
|
-
function
|
|
6374
|
+
function io({ loggerLevel: e = "info", dmkConfig: t, dmkLogLevel: n = "error", apiKey: r, dAppIdentifier: i, environment: a = "production", devConfig: o = { stub: {
|
|
6347
6375
|
base: !1,
|
|
6348
6376
|
account: !1,
|
|
6349
6377
|
device: !1,
|
|
@@ -6361,21 +6389,21 @@ function ro({ loggerLevel: e = "info", dmkConfig: t, dmkLogLevel: n = "error", a
|
|
|
6361
6389
|
}), sr(), Un({ stub: o.stub.balance }), Ki({
|
|
6362
6390
|
stub: o.stub.base,
|
|
6363
6391
|
errorTrackingConfig: Ar
|
|
6364
|
-
}),
|
|
6392
|
+
}), _n({ stub: o.stub.account }), Dn({ stub: o.stub.base }), vr({ stub: o.stub.dAppConfig }), Dr({
|
|
6365
6393
|
stub: o.stub.device,
|
|
6366
6394
|
dmkConfig: t,
|
|
6367
6395
|
dmkLogLevel: n
|
|
6368
|
-
}), Ni({ stub: o.stub.base }),
|
|
6396
|
+
}), Ni({ stub: o.stub.base }), ja({ stub: o.stub.base }), Yn(), ia({ stub: o.stub.base }), qa({ stub: o.stub.transactionHistory }), ro(), Li({ stub: o.stub.base }), rr({ stub: o.stub.base }), Gn({ stub: o.stub.base }), ba(), Yi(), Qi(), Zn(), ga()), s;
|
|
6369
6397
|
}
|
|
6370
6398
|
//#endregion
|
|
6371
6399
|
//#region src/api/LedgerButtonCore.ts
|
|
6372
|
-
var
|
|
6400
|
+
var ao = class {
|
|
6373
6401
|
opts;
|
|
6374
6402
|
container;
|
|
6375
6403
|
_logger;
|
|
6376
6404
|
_modalService;
|
|
6377
6405
|
get _contextService() {
|
|
6378
|
-
return this.container.get(
|
|
6406
|
+
return this.container.get(A.ContextService);
|
|
6379
6407
|
}
|
|
6380
6408
|
get _navigationIntentService() {
|
|
6381
6409
|
return this.container.get(Zi.NavigationIntentService);
|
|
@@ -6383,24 +6411,24 @@ var io = class {
|
|
|
6383
6411
|
deviceConnectionSubscription;
|
|
6384
6412
|
pendingDeviceCleanup;
|
|
6385
6413
|
constructor(e) {
|
|
6386
|
-
this.opts = e, this.container =
|
|
6387
|
-
let t = this.container.get(
|
|
6414
|
+
this.opts = e, this.container = io(this.opts);
|
|
6415
|
+
let t = this.container.get(N.LoggerPublisher);
|
|
6388
6416
|
this._logger = t("Ledger Button Core"), this._modalService = this.container.get(Ji.ModalService), this.initializeContext();
|
|
6389
6417
|
}
|
|
6390
6418
|
async initializeContext() {
|
|
6391
6419
|
this._logger.debug("Initializing context");
|
|
6392
|
-
let e = await this.container.get(
|
|
6393
|
-
await this.container.get(
|
|
6394
|
-
let t = this.container.get(
|
|
6395
|
-
t.setDisconnectHandler((e) => this.disconnect(e)), this.container.get(
|
|
6420
|
+
let e = await this.container.get(Rt.GetDAppConfigUseCase).execute();
|
|
6421
|
+
await this.container.get(P.MigrateDbUseCase).execute();
|
|
6422
|
+
let t = this.container.get(O.CoreFacadeService);
|
|
6423
|
+
t.setDisconnectHandler((e) => this.disconnect(e)), this.container.get(O.BlockchainProviderManager).init(t, e, this.opts.blockchainProviderFactories ?? []), await this.restoreContext(), this.container.get(Z.PendingTransactionController);
|
|
6396
6424
|
}
|
|
6397
6425
|
async restoreContext() {
|
|
6398
|
-
let e = this.container.get(
|
|
6426
|
+
let e = this.container.get(P.StorageService), t = e.getTrustChainId().extract(), n = e.isTrustChainValid();
|
|
6399
6427
|
t && !n && (this._logger.debug("Logging out, trust chain is expired"), e.resetStorage());
|
|
6400
|
-
let r = n ? e.getSelectedAccounts() : /* @__PURE__ */ new Map(), i = this.container.get(
|
|
6428
|
+
let r = n ? e.getSelectedAccounts() : /* @__PURE__ */ new Map(), i = this.container.get(O.BlockchainProviderManager), a = r.get(w), o = a ? i.describeCurrency(a.currencyId).chain((e) => {
|
|
6401
6429
|
let t = Number(e.networkId);
|
|
6402
6430
|
return Number.isFinite(t) ? p.of(t) : p.empty();
|
|
6403
|
-
}).orDefault(1) : 1, s = await e.isWelcomeScreenCompleted(), ee = await e.getUserConsent(), te = ee.isJust() ? ee.extract().consentGiven : void 0, c = e.hasDeveloperMode(), ne = this.container.get(
|
|
6431
|
+
}).orDefault(1) : 1, s = await e.isWelcomeScreenCompleted(), ee = await e.getUserConsent(), te = ee.isJust() ? ee.extract().consentGiven : void 0, c = e.hasDeveloperMode(), ne = this.container.get(Q.IsMobileUseCase).execute(), re = await this.container.get(j.CurrencyService).initialize();
|
|
6404
6432
|
this._contextService.onEvent({
|
|
6405
6433
|
type: "initialize_context",
|
|
6406
6434
|
context: {
|
|
@@ -6431,7 +6459,7 @@ var io = class {
|
|
|
6431
6459
|
this.deviceConnectionSubscription?.unsubscribe(), this.deviceConnectionSubscription = void 0;
|
|
6432
6460
|
}
|
|
6433
6461
|
getDeviceService() {
|
|
6434
|
-
return this.container.get(
|
|
6462
|
+
return this.container.get(M.DeviceManagementKitService);
|
|
6435
6463
|
}
|
|
6436
6464
|
hasKnownDeviceSession() {
|
|
6437
6465
|
let e = this.getDeviceService();
|
|
@@ -6442,7 +6470,7 @@ var io = class {
|
|
|
6442
6470
|
}
|
|
6443
6471
|
async releaseDeviceSafely() {
|
|
6444
6472
|
try {
|
|
6445
|
-
await this.container.get(
|
|
6473
|
+
await this.container.get(M.DisconnectDeviceUseCase).execute();
|
|
6446
6474
|
} catch (e) {
|
|
6447
6475
|
this._logger.warn("Failed to release the device session", { error: e });
|
|
6448
6476
|
}
|
|
@@ -6454,7 +6482,7 @@ var io = class {
|
|
|
6454
6482
|
if (e) {
|
|
6455
6483
|
let t = new Map(this._contextService.getContext().selectedAccounts);
|
|
6456
6484
|
if (t.delete(e), t.size > 0) {
|
|
6457
|
-
this._logger.debug("Disconnecting account for family", { family: e }), this.container.get(
|
|
6485
|
+
this._logger.debug("Disconnecting account for family", { family: e }), this.container.get(P.StorageService).removeSelectedAccount(e), this._contextService.onEvent({
|
|
6458
6486
|
type: "account_disconnected",
|
|
6459
6487
|
family: e
|
|
6460
6488
|
});
|
|
@@ -6464,11 +6492,11 @@ var io = class {
|
|
|
6464
6492
|
await this.resetSession();
|
|
6465
6493
|
}
|
|
6466
6494
|
async resetSession() {
|
|
6467
|
-
this._logger.debug("Resetting session"), this.stopListeningToDevice(), await this.releaseDeviceSafely(), this.container.get(
|
|
6495
|
+
this._logger.debug("Resetting session"), this.stopListeningToDevice(), await this.releaseDeviceSafely(), this.container.get(P.StorageService).resetStorage(), await this.restoreContext();
|
|
6468
6496
|
}
|
|
6469
6497
|
async connectToDevice(e) {
|
|
6470
6498
|
this._logger.debug("Connecting to device", { type: e }), await this.waitForPendingDeviceCleanup(), await this.releaseCurrentDeviceIfNeeded();
|
|
6471
|
-
let t = await this.container.get(
|
|
6499
|
+
let t = await this.container.get(M.ConnectDeviceUseCase).execute({ type: e });
|
|
6472
6500
|
return this._contextService.onEvent({
|
|
6473
6501
|
type: "device_connected",
|
|
6474
6502
|
device: t
|
|
@@ -6476,50 +6504,50 @@ var io = class {
|
|
|
6476
6504
|
}
|
|
6477
6505
|
async disconnectFromDevice() {
|
|
6478
6506
|
this._logger.debug("Disconnecting from device"), this.stopListeningToDevice();
|
|
6479
|
-
let e = await this.container.get(
|
|
6507
|
+
let e = await this.container.get(M.DisconnectDeviceUseCase).execute();
|
|
6480
6508
|
return this._contextService.onEvent({ type: "device_disconnected" }), e;
|
|
6481
6509
|
}
|
|
6482
6510
|
async getReferralUrl() {
|
|
6483
|
-
return this.container.get(
|
|
6511
|
+
return this.container.get(Rt.GetDAppConfigUseCase).execute().then((e) => e.referralUrl);
|
|
6484
6512
|
}
|
|
6485
6513
|
async switchDevice(e) {
|
|
6486
|
-
return this._logger.debug("Switching device", { type: e }), this.container.get(
|
|
6514
|
+
return this._logger.debug("Switching device", { type: e }), this.container.get(M.SwitchDeviceUseCase).execute({ type: e });
|
|
6487
6515
|
}
|
|
6488
6516
|
async fetchAccountsFromCloudSync() {
|
|
6489
|
-
return this.container.get(
|
|
6517
|
+
return this.container.get(E.FetchAccountsUseCase).execute();
|
|
6490
6518
|
}
|
|
6491
6519
|
observeAccounts(e) {
|
|
6492
|
-
return this.container.get(
|
|
6520
|
+
return this.container.get(E.ObserveAccountsWithFiatUseCase).execute(e);
|
|
6493
6521
|
}
|
|
6494
6522
|
observeAccountGroups(e) {
|
|
6495
|
-
return this.container.get(
|
|
6523
|
+
return this.container.get(E.ObserveAccountGroupsUseCase).execute(e);
|
|
6496
6524
|
}
|
|
6497
6525
|
observeNetworksForSelectedAddress() {
|
|
6498
|
-
return this.container.get(
|
|
6526
|
+
return this.container.get(E.ObserveNetworksForSelectedAddressUseCase).execute();
|
|
6499
6527
|
}
|
|
6500
6528
|
selectAccountForNetwork(e) {
|
|
6501
|
-
return this.container.get(
|
|
6529
|
+
return this.container.get(E.FindAccountForNetworkUseCase).execute(e).map((e) => (this.selectAccount(e), !0)).orDefault(!1);
|
|
6502
6530
|
}
|
|
6503
6531
|
selectAccount(e) {
|
|
6504
6532
|
let { family: t, chainId: n } = this.resolveFamilyAndChainId(e.currencyId);
|
|
6505
|
-
this.container.get(
|
|
6533
|
+
this.container.get(E.AccountService).selectAccount(e, t), this._contextService.onEvent({
|
|
6506
6534
|
type: "account_changed",
|
|
6507
6535
|
account: e,
|
|
6508
6536
|
family: t,
|
|
6509
6537
|
chainId: n
|
|
6510
|
-
}), this.container.get(
|
|
6538
|
+
}), this.container.get(W.TrackOnboarding).execute(e, t);
|
|
6511
6539
|
}
|
|
6512
|
-
getSelectedAccount(e =
|
|
6513
|
-
return
|
|
6540
|
+
getSelectedAccount(e = w) {
|
|
6541
|
+
return T(this._contextService.getContext(), e);
|
|
6514
6542
|
}
|
|
6515
6543
|
getActiveSelectedAccount() {
|
|
6516
|
-
return
|
|
6544
|
+
return Pt(this._contextService.getContext());
|
|
6517
6545
|
}
|
|
6518
6546
|
getActiveFamily() {
|
|
6519
|
-
return
|
|
6547
|
+
return Ft(this._contextService.getContext());
|
|
6520
6548
|
}
|
|
6521
6549
|
getConnectedFamilies() {
|
|
6522
|
-
return
|
|
6550
|
+
return Nt(this._contextService.getContext());
|
|
6523
6551
|
}
|
|
6524
6552
|
setActiveFamily(e) {
|
|
6525
6553
|
this._contextService.onEvent({
|
|
@@ -6528,9 +6556,9 @@ var io = class {
|
|
|
6528
6556
|
});
|
|
6529
6557
|
}
|
|
6530
6558
|
resolveFamilyAndChainId(e) {
|
|
6531
|
-
let t = this.container.get(
|
|
6559
|
+
let t = this.container.get(O.BlockchainProviderManager).describeCurrency(e);
|
|
6532
6560
|
return {
|
|
6533
|
-
family: t.map((e) => e.family).orDefault(
|
|
6561
|
+
family: t.map((e) => e.family).orDefault(w),
|
|
6534
6562
|
chainId: t.chain((e) => {
|
|
6535
6563
|
let t = Number(e.networkId);
|
|
6536
6564
|
return Number.isFinite(t) ? p.of(t) : p.empty();
|
|
@@ -6538,81 +6566,81 @@ var io = class {
|
|
|
6538
6566
|
};
|
|
6539
6567
|
}
|
|
6540
6568
|
getConnectedDevice() {
|
|
6541
|
-
return this._logger.debug("Getting connected device"), this.container.get(
|
|
6569
|
+
return this._logger.debug("Getting connected device"), this.container.get(M.DeviceManagementKitService).connectedDevice;
|
|
6542
6570
|
}
|
|
6543
6571
|
async listAvailableDevices() {
|
|
6544
|
-
return this._logger.debug("Listing available devices"), this.container.get(
|
|
6572
|
+
return this._logger.debug("Listing available devices"), this.container.get(M.ListAvailableDevicesUseCase).execute();
|
|
6545
6573
|
}
|
|
6546
6574
|
async hasConsent() {
|
|
6547
|
-
return this._logger.debug("Checking user consent"), await this.container.get(
|
|
6575
|
+
return this._logger.debug("Checking user consent"), await this.container.get(It.ConsentService).hasConsent();
|
|
6548
6576
|
}
|
|
6549
6577
|
async hasRespondedToConsent() {
|
|
6550
|
-
return this._logger.debug("Checking if user has responded to consent"), await this.container.get(
|
|
6578
|
+
return this._logger.debug("Checking if user has responded to consent"), await this.container.get(It.ConsentService).hasRespondedToConsent();
|
|
6551
6579
|
}
|
|
6552
6580
|
async giveConsent() {
|
|
6553
|
-
this._logger.debug("Giving user consent"), await this.container.get(
|
|
6581
|
+
this._logger.debug("Giving user consent"), await this.container.get(It.ConsentService).giveConsent(), this._contextService.onEvent({ type: "tracking_consent_given" });
|
|
6554
6582
|
}
|
|
6555
6583
|
async refuseConsent() {
|
|
6556
|
-
this._logger.debug("Refusing user consent"), await this.container.get(
|
|
6584
|
+
this._logger.debug("Refusing user consent"), await this.container.get(It.ConsentService).refuseConsent(), this._contextService.onEvent({ type: "tracking_consent_refused" });
|
|
6557
6585
|
}
|
|
6558
6586
|
async removeConsent() {
|
|
6559
|
-
this._logger.debug("Removing user consent"), await this.container.get(
|
|
6587
|
+
this._logger.debug("Removing user consent"), await this.container.get(It.ConsentService).removeConsent(), this._contextService.onEvent({ type: "tracking_consent_refused" });
|
|
6560
6588
|
}
|
|
6561
6589
|
async setWelcomeScreenCompleted() {
|
|
6562
|
-
this._logger.debug("Setting welcome screen as completed"), await this.container.get(
|
|
6590
|
+
this._logger.debug("Setting welcome screen as completed"), await this.container.get(P.StorageService).saveWelcomeScreenCompleted(), this._contextService.onEvent({ type: "welcome_screen_completed" });
|
|
6563
6591
|
}
|
|
6564
6592
|
isWelcomeScreenCompleted() {
|
|
6565
6593
|
return this._contextService.getContext().welcomeScreenCompleted;
|
|
6566
6594
|
}
|
|
6567
6595
|
enableDeveloperMode() {
|
|
6568
|
-
this._logger.debug("Enabling developer mode"), this.container.get(
|
|
6596
|
+
this._logger.debug("Enabling developer mode"), this.container.get(P.StorageService).saveDeveloperMode(), this._contextService.onEvent({ type: "developer_mode_enabled" });
|
|
6569
6597
|
}
|
|
6570
6598
|
hasDeveloperMode() {
|
|
6571
6599
|
return this._contextService.getContext().hasDeveloperMode;
|
|
6572
6600
|
}
|
|
6573
6601
|
getFeatureFlags() {
|
|
6574
|
-
return this.container.get(
|
|
6602
|
+
return this.container.get(P.StorageService).getFeatureFlags();
|
|
6575
6603
|
}
|
|
6576
6604
|
setFeatureFlag(e, t) {
|
|
6577
6605
|
this._logger.debug("Updating feature flag", {
|
|
6578
6606
|
flag: e,
|
|
6579
6607
|
enabled: t
|
|
6580
6608
|
});
|
|
6581
|
-
let n = this.container.get(
|
|
6609
|
+
let n = this.container.get(P.StorageService);
|
|
6582
6610
|
n.saveFeatureFlags({
|
|
6583
6611
|
...n.getFeatureFlags(),
|
|
6584
6612
|
[e]: t
|
|
6585
6613
|
});
|
|
6586
6614
|
}
|
|
6587
6615
|
getBlockchainNetworks(e) {
|
|
6588
|
-
return this.container.get(
|
|
6616
|
+
return this.container.get(O.BlockchainProviderManager).getNetworks(e);
|
|
6589
6617
|
}
|
|
6590
6618
|
getConfigOverrides() {
|
|
6591
|
-
return this.container.get(
|
|
6619
|
+
return this.container.get(P.StorageService).getConfigOverrides();
|
|
6592
6620
|
}
|
|
6593
6621
|
setConfigOverrides(e) {
|
|
6594
|
-
this._logger.debug("Updating config overrides", { overrides: e }), this.container.get(
|
|
6622
|
+
this._logger.debug("Updating config overrides", { overrides: e }), this.container.get(P.StorageService).saveConfigOverrides(e);
|
|
6595
6623
|
}
|
|
6596
6624
|
getPreferredFiatCurrency() {
|
|
6597
6625
|
return this._contextService.getContext().preferredFiatCurrency ?? "USD";
|
|
6598
6626
|
}
|
|
6599
6627
|
getSupportedFiatCurrencies() {
|
|
6600
|
-
return this.container.get(
|
|
6628
|
+
return this.container.get(j.CurrencyService).getSupportedFiatCurrencies();
|
|
6601
6629
|
}
|
|
6602
6630
|
async savePreferredFiatCurrency(e) {
|
|
6603
|
-
this._logger.debug("Saving preferred fiat currency", { currency: e }), await this.container.get(
|
|
6631
|
+
this._logger.debug("Saving preferred fiat currency", { currency: e }), await this.container.get(j.CurrencyService).savePreferredFiatCurrency(e), this._contextService.onEvent({
|
|
6604
6632
|
type: "preferred_fiat_currency_changed",
|
|
6605
6633
|
currency: e
|
|
6606
6634
|
});
|
|
6607
6635
|
}
|
|
6608
6636
|
async savePreferredLanguage(e) {
|
|
6609
|
-
this._logger.debug("Saving preferred language", { language: e }), await this.container.get(
|
|
6637
|
+
this._logger.debug("Saving preferred language", { language: e }), await this.container.get(P.StorageService).savePreferredLanguage(e);
|
|
6610
6638
|
}
|
|
6611
6639
|
async getPreferredLanguage() {
|
|
6612
|
-
return (await this.container.get(
|
|
6640
|
+
return (await this.container.get(P.StorageService).getPreferredLanguage()).extract();
|
|
6613
6641
|
}
|
|
6614
6642
|
async jsonRpcRequest(e) {
|
|
6615
|
-
return this._logger.debug("JSON RPC request", { args: e }), this.container.get(
|
|
6643
|
+
return this._logger.debug("JSON RPC request", { args: e }), this.container.get(O.CoreFacadeService).broadcastRPC(e, {
|
|
6616
6644
|
name: "ethereum",
|
|
6617
6645
|
chainId: this._contextService.getContext().chainId.toString()
|
|
6618
6646
|
});
|
|
@@ -6623,12 +6651,12 @@ var io = class {
|
|
|
6623
6651
|
connectToLedgerSync() {
|
|
6624
6652
|
this._logger.debug("Connecting to ledger sync");
|
|
6625
6653
|
let e = this._contextService.getContext().selectedAccounts.size > 0;
|
|
6626
|
-
return e || this.container.get(
|
|
6654
|
+
return e || this.container.get(W.TrackLedgerSyncOpened).execute(), this.container.get(Ut.LedgerSyncService).authenticate().pipe(xe(async (t) => {
|
|
6627
6655
|
this.isAuthContext(t) && (this._contextService.onEvent({
|
|
6628
6656
|
type: "trustchain_connected",
|
|
6629
6657
|
trustChainId: t.trustChainId,
|
|
6630
6658
|
applicationPath: t.applicationPath
|
|
6631
|
-
}), !e && await this.container.get(
|
|
6659
|
+
}), !e && await this.container.get(W.TrackLedgerSyncActivated).execute());
|
|
6632
6660
|
}));
|
|
6633
6661
|
}
|
|
6634
6662
|
isAuthContext(e) {
|
|
@@ -6637,30 +6665,30 @@ var io = class {
|
|
|
6637
6665
|
observeContext() {
|
|
6638
6666
|
return this._contextService.observeContext();
|
|
6639
6667
|
}
|
|
6640
|
-
async fetchSelectedAccount(e =
|
|
6641
|
-
let t = await this.container.get(
|
|
6668
|
+
async fetchSelectedAccount(e = w) {
|
|
6669
|
+
let t = await this.container.get(E.FetchSelectedAccountUseCase).execute(e);
|
|
6642
6670
|
return t.isRight() ? t.unsafeCoerce() : void 0;
|
|
6643
6671
|
}
|
|
6644
6672
|
observePendingTransactions() {
|
|
6645
|
-
return this.container.get(
|
|
6673
|
+
return this.container.get(Z.PendingTransactionController).observePendingTransactions();
|
|
6646
6674
|
}
|
|
6647
6675
|
observeBroadcastedTransaction(e) {
|
|
6648
|
-
return this.container.get(
|
|
6676
|
+
return this.container.get(Z.PendingTransactionController).observeBroadcastedTransaction(e);
|
|
6649
6677
|
}
|
|
6650
6678
|
getConfig() {
|
|
6651
|
-
return this.container.get(
|
|
6679
|
+
return this.container.get(k.Config);
|
|
6652
6680
|
}
|
|
6653
6681
|
setLogLevel(e) {
|
|
6654
|
-
this.container.get(
|
|
6682
|
+
this.container.get(k.Config).setLogLevel(e);
|
|
6655
6683
|
}
|
|
6656
6684
|
isMobile() {
|
|
6657
|
-
return this.container.get(
|
|
6685
|
+
return this.container.get(Q.IsMobileUseCase).execute();
|
|
6658
6686
|
}
|
|
6659
6687
|
isSupportedPlatform() {
|
|
6660
|
-
return this.container.get(
|
|
6688
|
+
return this.container.get(Q.IsSupportedPlatformUseCase).execute();
|
|
6661
6689
|
}
|
|
6662
6690
|
setChainId(e) {
|
|
6663
|
-
let t = this.container.get(
|
|
6691
|
+
let t = this.container.get(O.BlockchainProviderManager).describeNetwork(String(e)).map((e) => e.currencyId).extract();
|
|
6664
6692
|
this._contextService.onEvent({
|
|
6665
6693
|
type: "chain_changed",
|
|
6666
6694
|
chainId: e,
|
|
@@ -6671,7 +6699,7 @@ var io = class {
|
|
|
6671
6699
|
return this._contextService.getContext().chainId;
|
|
6672
6700
|
}
|
|
6673
6701
|
async getCurrencyInfo(e) {
|
|
6674
|
-
let t = await this.container.get(
|
|
6702
|
+
let t = await this.container.get(D.CalDataSource).getCurrencyInformation(e);
|
|
6675
6703
|
if (t.isRight()) {
|
|
6676
6704
|
let { name: e, ticker: n, transactionExplorerUrlTemplate: r } = t.extract();
|
|
6677
6705
|
return {
|
|
@@ -6686,53 +6714,53 @@ var io = class {
|
|
|
6686
6714
|
};
|
|
6687
6715
|
}
|
|
6688
6716
|
async trackMobileRedirectLedgerWallet() {
|
|
6689
|
-
await this.container.get(
|
|
6717
|
+
await this.container.get(W.TrackMobileRedirectLedgerWallet).execute();
|
|
6690
6718
|
}
|
|
6691
6719
|
async trackFloatingButtonClick() {
|
|
6692
|
-
await this.container.get(
|
|
6720
|
+
await this.container.get(W.TrackFloatingButtonClick).execute();
|
|
6693
6721
|
}
|
|
6694
6722
|
async trackViewTransactionDetailsClicked(e, t) {
|
|
6695
|
-
await this.container.get(
|
|
6723
|
+
await this.container.get(W.TrackViewTransactionDetailsClick).execute(e, t);
|
|
6696
6724
|
}
|
|
6697
6725
|
async trackViewAllTransactionsClicked(e) {
|
|
6698
|
-
await this.container.get(
|
|
6726
|
+
await this.container.get(W.TrackViewAllTransactions).trackClicked(e);
|
|
6699
6727
|
}
|
|
6700
6728
|
async trackViewAllTransactionsRedirectConfirmed(e) {
|
|
6701
|
-
await this.container.get(
|
|
6729
|
+
await this.container.get(W.TrackViewAllTransactions).trackRedirectConfirmed(e);
|
|
6702
6730
|
}
|
|
6703
6731
|
async trackViewAllTransactionsRedirectCancelled(e) {
|
|
6704
|
-
await this.container.get(
|
|
6732
|
+
await this.container.get(W.TrackViewAllTransactions).trackRedirectCancelled(e);
|
|
6705
6733
|
}
|
|
6706
6734
|
async trackLanguageChanged(e) {
|
|
6707
|
-
await this.container.get(
|
|
6735
|
+
await this.container.get(W.TrackLanguageChanged).execute(e);
|
|
6708
6736
|
}
|
|
6709
6737
|
async trackCurrencyChanged(e) {
|
|
6710
|
-
await this.container.get(
|
|
6738
|
+
await this.container.get(W.TrackCurrencyChanged).execute(e);
|
|
6711
6739
|
}
|
|
6712
6740
|
async trackWalletActionClicked(e) {
|
|
6713
|
-
await this.container.get(
|
|
6741
|
+
await this.container.get(W.TrackWalletAction).trackWalletActionClicked(e);
|
|
6714
6742
|
}
|
|
6715
6743
|
async trackWalletRedirectConfirmed(e) {
|
|
6716
|
-
await this.container.get(
|
|
6744
|
+
await this.container.get(W.TrackWalletAction).trackWalletRedirectConfirmed(e);
|
|
6717
6745
|
}
|
|
6718
6746
|
async trackWalletRedirectCancelled(e) {
|
|
6719
|
-
await this.container.get(
|
|
6747
|
+
await this.container.get(W.TrackWalletAction).trackWalletRedirectCancelled(e);
|
|
6720
6748
|
}
|
|
6721
6749
|
};
|
|
6722
6750
|
//#endregion
|
|
6723
6751
|
//#region src/api/model/signing/SignIntentType.ts
|
|
6724
|
-
function
|
|
6752
|
+
function oo(e) {
|
|
6725
6753
|
return e === "transaction" ? "transaction" : "message";
|
|
6726
6754
|
}
|
|
6727
6755
|
//#endregion
|
|
6728
6756
|
//#region src/api/blockchain-provider/utils/findBlockchainConfig.ts
|
|
6729
|
-
var
|
|
6757
|
+
var so = (e, t) => e.find((e) => e.blockchain === t);
|
|
6730
6758
|
//#endregion
|
|
6731
6759
|
//#region src/api/utils/byteUtils.ts
|
|
6732
|
-
function
|
|
6760
|
+
function co(e) {
|
|
6733
6761
|
let t = ne(e);
|
|
6734
6762
|
if (!t) throw Error("Invalid hex string");
|
|
6735
6763
|
return new TextDecoder("utf-8").decode(t);
|
|
6736
6764
|
}
|
|
6737
6765
|
//#endregion
|
|
6738
|
-
export {
|
|
6766
|
+
export { bt as AccountNotFoundError, mt as AccountNotSelectedError, Qe as BlindSigningDisabledError, xt as BroadcastTransactionError, w as DEFAULT_BLOCKCHAIN_FAMILY, ft as DeviceConnectionError, Xe as DeviceDisconnectedError, tt as DeviceFirmwareOutdatedError, Ye as DeviceNotOnboardedError, Je as DeviceNotSupportedError, et as DeviceOutOfMemoryError, ht as FailToOpenAppError, vt as FailedToFetchEncryptedAccountsError, Ze as IncorrectSeedError, ao as LedgerButtonCore, x as LedgerButtonError, kt as LedgerKeyringProtocolError, Et as LedgerSyncAuthContextMissingError, Pi as LedgerSyncAuthenticationError, Ot as LedgerSyncConnectionFailedError, Tt as LedgerSyncError, Dt as LedgerSyncNoSessionIdError, Ct as ModalClosedError, St as NetworkError, _t as NoAccountInSyncError, wt as NoBlockchainProviderError, gt as NoCompatibleAccountsError, yt as NoSelectedAccountError, pt as SignTransactionError, C as StorageIDBGetError, jt as StorageIDBNotInitializedError, At as StorageIDBOpenError, Mt as StorageIDBRemoveError, S as StorageIDBStoreError, $e as UserRejectedTransactionError, ma as buildExplorerTransactionUrl, $t as calculateTotalFiatValue, qe as createOpenAppConfig, so as findBlockchainConfig, qt as formatBalance, Ft as getActiveFamily, Pt as getActiveSelectedAccount, Nt as getConnectedFamilies, dt as getLedgerProviderIcon, T as getSelectedAccount, co as hexToUtf8, fa as isBroadcastedTransactionResult, $a as isCoinServiceBroadcastResponse, Za as isJsonRpcResponse, Qa as isJsonRpcResponseSuccess, pa as isSignedMessageOrTypedDataResult, da as isSignedTransactionResult, nt as mapOpenAppDeviceActionError, it as normalizeDeviceError, at as normalizeSignFlowStatusError, oo as toSignIntentType, ct as waitForDeviceSession };
|