@metamask/smart-transactions-controller 12.0.1 → 13.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -2
- package/dist/SmartTransactionsController.d.ts +72 -45
- package/dist/SmartTransactionsController.js +192 -156
- package/dist/SmartTransactionsController.js.map +1 -1
- package/dist/constants.d.ts +5 -0
- package/dist/constants.js +6 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.js.map +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
+
};
|
|
2
8
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
9
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
10
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
@@ -7,90 +13,106 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
7
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
15
|
};
|
|
10
|
-
var _SmartTransactionsController_instances, _SmartTransactionsController_updateSmartTransaction, _SmartTransactionsController_addMetaMetricsPropsToNewSmartTransaction, _SmartTransactionsController_createOrUpdateSmartTransaction, _SmartTransactionsController_doesTransactionNeedConfirmation, _SmartTransactionsController_confirmSmartTransaction, _SmartTransactionsController_getChainId, _SmartTransactionsController_getEthQuery, _SmartTransactionsController_getCurrentSmartTransactions, _SmartTransactionsController_wipeSmartTransactionsPerChainId;
|
|
16
|
+
var _SmartTransactionsController_instances, _SmartTransactionsController_interval, _SmartTransactionsController_clientId, _SmartTransactionsController_chainId, _SmartTransactionsController_supportedChainIds, _SmartTransactionsController_getNonceLock, _SmartTransactionsController_ethQuery, _SmartTransactionsController_confirmExternalTransaction, _SmartTransactionsController_getRegularTransactions, _SmartTransactionsController_trackMetaMetricsEvent, _SmartTransactionsController_getMetaMetricsProps, _SmartTransactionsController_fetch, _SmartTransactionsController_updateSmartTransaction, _SmartTransactionsController_addMetaMetricsPropsToNewSmartTransaction, _SmartTransactionsController_createOrUpdateSmartTransaction, _SmartTransactionsController_doesTransactionNeedConfirmation, _SmartTransactionsController_confirmSmartTransaction, _SmartTransactionsController_getChainId, _SmartTransactionsController_getEthQuery, _SmartTransactionsController_getCurrentSmartTransactions, _SmartTransactionsController_wipeSmartTransactionsPerChainId;
|
|
11
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.DEFAULT_INTERVAL = void 0;
|
|
13
|
-
// eslint-disable-next-line import/no-nodejs-modules
|
|
18
|
+
exports.getDefaultSmartTransactionsControllerState = exports.DEFAULT_INTERVAL = void 0;
|
|
14
19
|
const bytes_1 = require("@ethersproject/bytes");
|
|
15
20
|
const controller_utils_1 = require("@metamask/controller-utils");
|
|
16
21
|
const eth_query_1 = __importDefault(require("@metamask/eth-query"));
|
|
17
22
|
const polling_controller_1 = require("@metamask/polling-controller");
|
|
18
23
|
const transaction_controller_1 = require("@metamask/transaction-controller");
|
|
19
24
|
const bignumber_js_1 = require("bignumber.js");
|
|
20
|
-
// eslint-disable-next-line import/no-nodejs-modules
|
|
21
|
-
const events_1 = __importDefault(require("events"));
|
|
22
25
|
const cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
|
23
26
|
const constants_1 = require("./constants");
|
|
24
27
|
const types_1 = require("./types");
|
|
25
28
|
const utils_1 = require("./utils");
|
|
26
29
|
const SECOND = 1000;
|
|
27
30
|
exports.DEFAULT_INTERVAL = SECOND * 5;
|
|
31
|
+
const DEFAULT_CLIENT_ID = 'default';
|
|
28
32
|
const ETH_QUERY_ERROR_MSG = '`ethQuery` is not defined on SmartTransactionsController';
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
33
|
+
/**
|
|
34
|
+
* The name of the {@link SmartTransactionsController}
|
|
35
|
+
*/
|
|
36
|
+
const controllerName = 'SmartTransactionsController';
|
|
37
|
+
const controllerMetadata = {
|
|
38
|
+
smartTransactionsState: {
|
|
39
|
+
persist: false,
|
|
40
|
+
anonymous: true,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Get the default {@link SmartTransactionsController} state.
|
|
45
|
+
*
|
|
46
|
+
* @returns The default {@link SmartTransactionsController} state.
|
|
47
|
+
*/
|
|
48
|
+
function getDefaultSmartTransactionsControllerState() {
|
|
49
|
+
return {
|
|
50
|
+
smartTransactionsState: {
|
|
51
|
+
smartTransactions: {},
|
|
52
|
+
userOptIn: null,
|
|
53
|
+
userOptInV2: null,
|
|
54
|
+
fees: {
|
|
55
|
+
approvalTxFees: null,
|
|
56
|
+
tradeTxFees: null,
|
|
57
|
+
},
|
|
58
|
+
liveness: true,
|
|
59
|
+
livenessByChainId: {
|
|
60
|
+
[controller_utils_1.ChainId.mainnet]: true,
|
|
61
|
+
[controller_utils_1.ChainId.sepolia]: true,
|
|
62
|
+
},
|
|
63
|
+
feesByChainId: {
|
|
64
|
+
[controller_utils_1.ChainId.mainnet]: {
|
|
65
|
+
approvalTxFees: null,
|
|
66
|
+
tradeTxFees: null,
|
|
56
67
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
tradeTxFees: undefined,
|
|
61
|
-
},
|
|
62
|
-
[controller_utils_1.ChainId.sepolia]: {
|
|
63
|
-
approvalTxFees: undefined,
|
|
64
|
-
tradeTxFees: undefined,
|
|
65
|
-
},
|
|
68
|
+
[controller_utils_1.ChainId.sepolia]: {
|
|
69
|
+
approvalTxFees: null,
|
|
70
|
+
tradeTxFees: null,
|
|
66
71
|
},
|
|
67
72
|
},
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
exports.getDefaultSmartTransactionsControllerState = getDefaultSmartTransactionsControllerState;
|
|
77
|
+
class SmartTransactionsController extends polling_controller_1.StaticIntervalPollingController {
|
|
78
|
+
constructor({ interval = exports.DEFAULT_INTERVAL, clientId = DEFAULT_CLIENT_ID, chainId: InitialChainId = controller_utils_1.ChainId.mainnet, supportedChainIds = [controller_utils_1.ChainId.mainnet, controller_utils_1.ChainId.sepolia], getNonceLock, confirmExternalTransaction, trackMetaMetricsEvent, state = {}, messenger, getTransactions, getMetaMetricsProps, }) {
|
|
79
|
+
super({
|
|
80
|
+
name: controllerName,
|
|
81
|
+
metadata: controllerMetadata,
|
|
82
|
+
messenger,
|
|
83
|
+
state: Object.assign(Object.assign({}, getDefaultSmartTransactionsControllerState()), state),
|
|
84
|
+
});
|
|
85
|
+
_SmartTransactionsController_instances.add(this);
|
|
86
|
+
_SmartTransactionsController_interval.set(this, void 0);
|
|
87
|
+
_SmartTransactionsController_clientId.set(this, void 0);
|
|
88
|
+
_SmartTransactionsController_chainId.set(this, void 0);
|
|
89
|
+
_SmartTransactionsController_supportedChainIds.set(this, void 0);
|
|
90
|
+
_SmartTransactionsController_getNonceLock.set(this, void 0);
|
|
91
|
+
_SmartTransactionsController_ethQuery.set(this, void 0);
|
|
92
|
+
_SmartTransactionsController_confirmExternalTransaction.set(this, void 0);
|
|
93
|
+
_SmartTransactionsController_getRegularTransactions.set(this, void 0);
|
|
94
|
+
_SmartTransactionsController_trackMetaMetricsEvent.set(this, void 0);
|
|
95
|
+
_SmartTransactionsController_getMetaMetricsProps.set(this, void 0);
|
|
96
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_interval, interval, "f");
|
|
97
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_clientId, clientId, "f");
|
|
98
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_chainId, InitialChainId, "f");
|
|
99
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_supportedChainIds, supportedChainIds, "f");
|
|
100
|
+
this.setIntervalLength(interval);
|
|
101
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_getNonceLock, getNonceLock, "f");
|
|
102
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_ethQuery, undefined, "f");
|
|
103
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_confirmExternalTransaction, confirmExternalTransaction, "f");
|
|
104
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_getRegularTransactions, getTransactions, "f");
|
|
105
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_trackMetaMetricsEvent, trackMetaMetricsEvent, "f");
|
|
106
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_getMetaMetricsProps, getMetaMetricsProps, "f");
|
|
78
107
|
this.initializeSmartTransactionsForChainId();
|
|
79
|
-
|
|
80
|
-
const { configuration: { chainId }, provider, } = this.getNetworkClientById
|
|
81
|
-
this
|
|
82
|
-
this
|
|
108
|
+
this.messagingSystem.subscribe('NetworkController:stateChange', ({ selectedNetworkClientId }) => {
|
|
109
|
+
const { configuration: { chainId }, provider, } = this.messagingSystem.call('NetworkController:getNetworkClientById', selectedNetworkClientId);
|
|
110
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_chainId, chainId, "f");
|
|
111
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_ethQuery, new eth_query_1.default(provider), "f");
|
|
83
112
|
this.initializeSmartTransactionsForChainId();
|
|
84
113
|
this.checkPoll(this.state);
|
|
85
114
|
});
|
|
86
|
-
this.subscribe((currentState) => this.checkPoll(currentState));
|
|
87
|
-
this.eventEmitter = new events_1.default();
|
|
88
|
-
}
|
|
89
|
-
/* istanbul ignore next */
|
|
90
|
-
async fetch(request, options) {
|
|
91
|
-
const { clientId } = this.config;
|
|
92
|
-
const fetchOptions = Object.assign(Object.assign({}, options), { headers: Object.assign({ 'Content-Type': 'application/json' }, (clientId && { 'X-Client-Id': clientId })) });
|
|
93
|
-
return (0, utils_1.handleFetch)(request, fetchOptions);
|
|
115
|
+
this.messagingSystem.subscribe(`${controllerName}:stateChange`, (currentState) => this.checkPoll(currentState));
|
|
94
116
|
}
|
|
95
117
|
async _executePoll(networkClientId) {
|
|
96
118
|
// if this is going to be truly UI driven polling we shouldn't really reach here
|
|
@@ -98,14 +120,13 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
98
120
|
// wondering if we should add some kind of predicate to the polling controller to check whether
|
|
99
121
|
// we should poll or not
|
|
100
122
|
const chainId = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_getChainId).call(this, { networkClientId });
|
|
101
|
-
if (!this.
|
|
123
|
+
if (!__classPrivateFieldGet(this, _SmartTransactionsController_supportedChainIds, "f").includes(chainId)) {
|
|
102
124
|
return Promise.resolve();
|
|
103
125
|
}
|
|
104
126
|
return this.updateSmartTransactions({ networkClientId });
|
|
105
127
|
}
|
|
106
|
-
checkPoll(
|
|
107
|
-
const
|
|
108
|
-
const currentSmartTransactions = smartTransactions[this.config.chainId];
|
|
128
|
+
checkPoll({ smartTransactionsState: { smartTransactions }, }) {
|
|
129
|
+
const currentSmartTransactions = smartTransactions[__classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f")];
|
|
109
130
|
const pendingTransactions = currentSmartTransactions === null || currentSmartTransactions === void 0 ? void 0 : currentSmartTransactions.filter(utils_1.isSmartTransactionPending);
|
|
110
131
|
if (!this.timeoutHandle && (pendingTransactions === null || pendingTransactions === void 0 ? void 0 : pendingTransactions.length) > 0) {
|
|
111
132
|
this.poll();
|
|
@@ -115,33 +136,34 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
115
136
|
}
|
|
116
137
|
}
|
|
117
138
|
initializeSmartTransactionsForChainId() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
139
|
+
if (__classPrivateFieldGet(this, _SmartTransactionsController_supportedChainIds, "f").includes(__classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f"))) {
|
|
140
|
+
this.update((state) => {
|
|
141
|
+
var _a;
|
|
142
|
+
state.smartTransactionsState.smartTransactions[__classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f")] =
|
|
143
|
+
(_a = state.smartTransactionsState.smartTransactions[__classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f")]) !== null && _a !== void 0 ? _a : [];
|
|
123
144
|
});
|
|
124
145
|
}
|
|
125
146
|
}
|
|
126
147
|
async poll(interval) {
|
|
127
|
-
|
|
128
|
-
|
|
148
|
+
if (interval) {
|
|
149
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_interval, interval, "f");
|
|
150
|
+
}
|
|
129
151
|
this.timeoutHandle && clearInterval(this.timeoutHandle);
|
|
130
|
-
if (!
|
|
152
|
+
if (!__classPrivateFieldGet(this, _SmartTransactionsController_supportedChainIds, "f").includes(__classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f"))) {
|
|
131
153
|
return;
|
|
132
154
|
}
|
|
133
155
|
this.timeoutHandle = setInterval(() => {
|
|
134
156
|
(0, controller_utils_1.safelyExecute)(async () => this.updateSmartTransactions());
|
|
135
|
-
}, this
|
|
157
|
+
}, __classPrivateFieldGet(this, _SmartTransactionsController_interval, "f"));
|
|
136
158
|
await (0, controller_utils_1.safelyExecute)(async () => this.updateSmartTransactions());
|
|
137
159
|
}
|
|
138
160
|
async stop() {
|
|
139
161
|
this.timeoutHandle && clearInterval(this.timeoutHandle);
|
|
140
162
|
this.timeoutHandle = undefined;
|
|
141
163
|
}
|
|
142
|
-
setOptInState(
|
|
143
|
-
this.update({
|
|
144
|
-
|
|
164
|
+
setOptInState(optInState) {
|
|
165
|
+
this.update((state) => {
|
|
166
|
+
state.smartTransactionsState.userOptInV2 = optInState;
|
|
145
167
|
});
|
|
146
168
|
}
|
|
147
169
|
trackStxStatusChange(smartTransaction, prevSmartTransaction) {
|
|
@@ -150,7 +172,7 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
150
172
|
if (updatedSmartTransaction.status === (prevSmartTransaction === null || prevSmartTransaction === void 0 ? void 0 : prevSmartTransaction.status)) {
|
|
151
173
|
return; // If status hasn't changed, don't track it again.
|
|
152
174
|
}
|
|
153
|
-
this.
|
|
175
|
+
__classPrivateFieldGet(this, _SmartTransactionsController_trackMetaMetricsEvent, "f").call(this, {
|
|
154
176
|
event: constants_1.MetaMetricsEventName.StxStatusUpdated,
|
|
155
177
|
category: constants_1.MetaMetricsEventCategory.Transactions,
|
|
156
178
|
properties: (0, utils_1.getSmartTransactionMetricsProperties)(updatedSmartTransaction),
|
|
@@ -158,19 +180,18 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
158
180
|
});
|
|
159
181
|
}
|
|
160
182
|
isNewSmartTransaction(smartTransactionUuid) {
|
|
161
|
-
const {
|
|
162
|
-
const
|
|
163
|
-
const { smartTransactions } = smartTransactionsState;
|
|
164
|
-
const currentSmartTransactions = smartTransactions[chainId];
|
|
183
|
+
const { smartTransactionsState: { smartTransactions }, } = this.state;
|
|
184
|
+
const currentSmartTransactions = smartTransactions[__classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f")];
|
|
165
185
|
const currentIndex = currentSmartTransactions === null || currentSmartTransactions === void 0 ? void 0 : currentSmartTransactions.findIndex((stx) => stx.uuid === smartTransactionUuid);
|
|
166
186
|
return currentIndex === -1 || currentIndex === undefined;
|
|
167
187
|
}
|
|
168
188
|
updateSmartTransaction(smartTransaction, { networkClientId } = {}) {
|
|
169
|
-
let
|
|
189
|
+
let ethQuery = __classPrivateFieldGet(this, _SmartTransactionsController_ethQuery, "f");
|
|
190
|
+
let chainId = __classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f");
|
|
170
191
|
if (networkClientId) {
|
|
171
|
-
const
|
|
172
|
-
chainId =
|
|
173
|
-
ethQuery = new eth_query_1.default(
|
|
192
|
+
const { configuration, provider } = this.messagingSystem.call('NetworkController:getNetworkClientById', networkClientId);
|
|
193
|
+
chainId = configuration.chainId;
|
|
194
|
+
ethQuery = new eth_query_1.default(provider);
|
|
174
195
|
}
|
|
175
196
|
__classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_createOrUpdateSmartTransaction).call(this, smartTransaction, {
|
|
176
197
|
chainId,
|
|
@@ -178,7 +199,7 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
178
199
|
});
|
|
179
200
|
}
|
|
180
201
|
async updateSmartTransactions({ networkClientId, } = {}) {
|
|
181
|
-
const { smartTransactions } = this.state
|
|
202
|
+
const { smartTransactionsState: { smartTransactions }, } = this.state;
|
|
182
203
|
const chainId = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_getChainId).call(this, { networkClientId });
|
|
183
204
|
const smartTransactionsForChainId = smartTransactions[chainId];
|
|
184
205
|
const transactionsToUpdate = smartTransactionsForChainId
|
|
@@ -198,7 +219,7 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
198
219
|
const chainId = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_getChainId).call(this, { networkClientId });
|
|
199
220
|
const ethQuery = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_getEthQuery).call(this, { networkClientId });
|
|
200
221
|
const url = `${(0, utils_1.getAPIRequestURL)(types_1.APIType.BATCH_STATUS, chainId)}?${params.toString()}`;
|
|
201
|
-
const data = (await this.
|
|
222
|
+
const data = (await __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_fetch).call(this, url));
|
|
202
223
|
for (const [uuid, stxStatus] of Object.entries(data)) {
|
|
203
224
|
const smartTransaction = {
|
|
204
225
|
statusMetadata: stxStatus,
|
|
@@ -214,18 +235,18 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
214
235
|
return data;
|
|
215
236
|
}
|
|
216
237
|
async addNonceToTransaction(transaction) {
|
|
217
|
-
const nonceLock = await this.
|
|
238
|
+
const nonceLock = await __classPrivateFieldGet(this, _SmartTransactionsController_getNonceLock, "f").call(this, transaction.from);
|
|
218
239
|
const nonce = nonceLock.nextNonce;
|
|
219
240
|
nonceLock.releaseLock();
|
|
220
241
|
return Object.assign(Object.assign({}, transaction), { nonce: `0x${nonce.toString(16)}` });
|
|
221
242
|
}
|
|
222
243
|
clearFees() {
|
|
223
244
|
const fees = {
|
|
224
|
-
approvalTxFees:
|
|
225
|
-
tradeTxFees:
|
|
245
|
+
approvalTxFees: null,
|
|
246
|
+
tradeTxFees: null,
|
|
226
247
|
};
|
|
227
|
-
this.update({
|
|
228
|
-
|
|
248
|
+
this.update((state) => {
|
|
249
|
+
state.smartTransactionsState.fees = fees;
|
|
229
250
|
});
|
|
230
251
|
return fees;
|
|
231
252
|
}
|
|
@@ -247,7 +268,7 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
247
268
|
unsignedTradeTransactionWithNonce = await this.addNonceToTransaction(tradeTx);
|
|
248
269
|
}
|
|
249
270
|
transactions.push(unsignedTradeTransactionWithNonce);
|
|
250
|
-
const data = await this.
|
|
271
|
+
const data = await __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_fetch).call(this, (0, utils_1.getAPIRequestURL)(types_1.APIType.GET_FEES, chainId), {
|
|
251
272
|
method: 'POST',
|
|
252
273
|
body: JSON.stringify({
|
|
253
274
|
txs: transactions,
|
|
@@ -260,18 +281,20 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
260
281
|
tradeTxFees = data === null || data === void 0 ? void 0 : data.txs[1];
|
|
261
282
|
}
|
|
262
283
|
else {
|
|
284
|
+
approvalTxFees = null;
|
|
263
285
|
tradeTxFees = data === null || data === void 0 ? void 0 : data.txs[0];
|
|
264
286
|
}
|
|
265
|
-
this.update({
|
|
266
|
-
|
|
267
|
-
fees
|
|
287
|
+
this.update((state) => {
|
|
288
|
+
if (chainId === __classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f")) {
|
|
289
|
+
state.smartTransactionsState.fees = {
|
|
268
290
|
approvalTxFees,
|
|
269
291
|
tradeTxFees,
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
state.smartTransactionsState.feesByChainId[chainId] = {
|
|
295
|
+
approvalTxFees,
|
|
296
|
+
tradeTxFees,
|
|
297
|
+
};
|
|
275
298
|
});
|
|
276
299
|
return {
|
|
277
300
|
approvalTxFees,
|
|
@@ -281,10 +304,10 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
281
304
|
// * After this successful call client must add a nonce representative to
|
|
282
305
|
// * transaction controller external transactions list
|
|
283
306
|
async submitSignedTransactions({ transactionMeta, txParams, signedTransactions, signedCanceledTransactions, networkClientId, }) {
|
|
284
|
-
var _a;
|
|
307
|
+
var _a, _b;
|
|
285
308
|
const chainId = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_getChainId).call(this, { networkClientId });
|
|
286
309
|
const ethQuery = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_getEthQuery).call(this, { networkClientId });
|
|
287
|
-
const data = await this.
|
|
310
|
+
const data = await __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_fetch).call(this, (0, utils_1.getAPIRequestURL)(types_1.APIType.SUBMIT_TRANSACTIONS, chainId), {
|
|
288
311
|
method: 'POST',
|
|
289
312
|
body: JSON.stringify({
|
|
290
313
|
rawTxs: signedTransactions,
|
|
@@ -302,17 +325,15 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
302
325
|
catch (error) {
|
|
303
326
|
console.error('provider error', error);
|
|
304
327
|
}
|
|
305
|
-
const requiresNonce = !txParams.nonce;
|
|
328
|
+
const requiresNonce = txParams && !txParams.nonce;
|
|
306
329
|
let nonce;
|
|
307
330
|
let nonceLock;
|
|
308
331
|
let nonceDetails = {};
|
|
309
332
|
if (requiresNonce) {
|
|
310
|
-
nonceLock = await this.
|
|
333
|
+
nonceLock = await __classPrivateFieldGet(this, _SmartTransactionsController_getNonceLock, "f").call(this, txParams.from);
|
|
311
334
|
nonce = (0, bytes_1.hexlify)(nonceLock.nextNonce);
|
|
312
335
|
nonceDetails = nonceLock.nonceDetails;
|
|
313
|
-
|
|
314
|
-
(_a = txParams.nonce) !== null && _a !== void 0 ? _a : (txParams.nonce = nonce);
|
|
315
|
-
}
|
|
336
|
+
(_a = txParams.nonce) !== null && _a !== void 0 ? _a : (txParams.nonce = nonce);
|
|
316
337
|
}
|
|
317
338
|
const submitTransactionResponse = Object.assign(Object.assign({}, data), { txHash: (0, utils_1.getTxHash)(signedTransactions[0]) });
|
|
318
339
|
try {
|
|
@@ -326,7 +347,7 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
326
347
|
uuid: submitTransactionResponse.uuid,
|
|
327
348
|
txHash: submitTransactionResponse.txHash,
|
|
328
349
|
cancellable: true,
|
|
329
|
-
type: (transactionMeta === null || transactionMeta === void 0 ? void 0 : transactionMeta.type)
|
|
350
|
+
type: (_b = transactionMeta === null || transactionMeta === void 0 ? void 0 : transactionMeta.type) !== null && _b !== void 0 ? _b : 'swap',
|
|
330
351
|
}, { chainId, ethQuery });
|
|
331
352
|
}
|
|
332
353
|
finally {
|
|
@@ -339,7 +360,7 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
339
360
|
// in transaction controller external transactions list
|
|
340
361
|
async cancelSmartTransaction(uuid, { networkClientId, } = {}) {
|
|
341
362
|
const chainId = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_getChainId).call(this, { networkClientId });
|
|
342
|
-
await this.
|
|
363
|
+
await __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_fetch).call(this, (0, utils_1.getAPIRequestURL)(types_1.APIType.CANCEL, chainId), {
|
|
343
364
|
method: 'POST',
|
|
344
365
|
body: JSON.stringify({ uuid }),
|
|
345
366
|
});
|
|
@@ -348,20 +369,23 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
348
369
|
const chainId = __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_getChainId).call(this, { networkClientId });
|
|
349
370
|
let liveness = false;
|
|
350
371
|
try {
|
|
351
|
-
const response = await this.
|
|
352
|
-
liveness = Boolean(response.
|
|
372
|
+
const response = await __classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_fetch).call(this, (0, utils_1.getAPIRequestURL)(types_1.APIType.LIVENESS, chainId));
|
|
373
|
+
liveness = Boolean(response.smartTransactions);
|
|
353
374
|
}
|
|
354
375
|
catch (error) {
|
|
355
376
|
console.log('"fetchLiveness" API call failed');
|
|
356
377
|
}
|
|
357
|
-
this.update({
|
|
358
|
-
|
|
378
|
+
this.update((state) => {
|
|
379
|
+
if (chainId === __classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f")) {
|
|
380
|
+
state.smartTransactionsState.liveness = liveness;
|
|
381
|
+
}
|
|
382
|
+
state.smartTransactionsState.livenessByChainId[chainId] = liveness;
|
|
359
383
|
});
|
|
360
384
|
return liveness;
|
|
361
385
|
}
|
|
362
386
|
async setStatusRefreshInterval(interval) {
|
|
363
|
-
if (interval !== this
|
|
364
|
-
this
|
|
387
|
+
if (interval !== __classPrivateFieldGet(this, _SmartTransactionsController_interval, "f")) {
|
|
388
|
+
__classPrivateFieldSet(this, _SmartTransactionsController_interval, interval, "f");
|
|
365
389
|
}
|
|
366
390
|
}
|
|
367
391
|
getTransactions({ addressFrom, status, }) {
|
|
@@ -388,53 +412,55 @@ class SmartTransactionsController extends polling_controller_1.StaticIntervalPol
|
|
|
388
412
|
}
|
|
389
413
|
const addressLowerCase = address.toLowerCase();
|
|
390
414
|
if (ignoreNetwork) {
|
|
391
|
-
const { smartTransactions } = this.state
|
|
415
|
+
const { smartTransactionsState: { smartTransactions }, } = this.state;
|
|
392
416
|
Object.keys(smartTransactions).forEach((chainId) => {
|
|
393
|
-
const chainIdHex = chainId;
|
|
394
417
|
__classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_wipeSmartTransactionsPerChainId).call(this, {
|
|
395
|
-
chainId
|
|
418
|
+
chainId,
|
|
396
419
|
addressLowerCase,
|
|
397
420
|
});
|
|
398
421
|
});
|
|
399
422
|
}
|
|
400
423
|
else {
|
|
401
424
|
__classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_wipeSmartTransactionsPerChainId).call(this, {
|
|
402
|
-
chainId: this
|
|
425
|
+
chainId: __classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f"),
|
|
403
426
|
addressLowerCase,
|
|
404
427
|
});
|
|
405
428
|
}
|
|
406
429
|
}
|
|
407
430
|
}
|
|
408
431
|
exports.default = SmartTransactionsController;
|
|
409
|
-
|
|
432
|
+
_SmartTransactionsController_interval = new WeakMap(), _SmartTransactionsController_clientId = new WeakMap(), _SmartTransactionsController_chainId = new WeakMap(), _SmartTransactionsController_supportedChainIds = new WeakMap(), _SmartTransactionsController_getNonceLock = new WeakMap(), _SmartTransactionsController_ethQuery = new WeakMap(), _SmartTransactionsController_confirmExternalTransaction = new WeakMap(), _SmartTransactionsController_getRegularTransactions = new WeakMap(), _SmartTransactionsController_trackMetaMetricsEvent = new WeakMap(), _SmartTransactionsController_getMetaMetricsProps = new WeakMap(), _SmartTransactionsController_instances = new WeakSet(), _SmartTransactionsController_fetch =
|
|
433
|
+
/* istanbul ignore next */
|
|
434
|
+
async function _SmartTransactionsController_fetch(request, options) {
|
|
435
|
+
const fetchOptions = Object.assign(Object.assign({}, options), { headers: Object.assign({ 'Content-Type': 'application/json' }, (__classPrivateFieldGet(this, _SmartTransactionsController_clientId, "f") && { 'X-Client-Id': __classPrivateFieldGet(this, _SmartTransactionsController_clientId, "f") })) });
|
|
436
|
+
return (0, utils_1.handleFetch)(request, fetchOptions);
|
|
437
|
+
}, _SmartTransactionsController_updateSmartTransaction = function _SmartTransactionsController_updateSmartTransaction(smartTransaction, { chainId = __classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f"), }) {
|
|
410
438
|
var _a;
|
|
411
|
-
const { smartTransactionsState } = this.state;
|
|
412
|
-
const { smartTransactions } = smartTransactionsState;
|
|
439
|
+
const { smartTransactionsState: { smartTransactions }, } = this.state;
|
|
413
440
|
const currentSmartTransactions = (_a = smartTransactions[chainId]) !== null && _a !== void 0 ? _a : [];
|
|
414
441
|
const currentIndex = currentSmartTransactions === null || currentSmartTransactions === void 0 ? void 0 : currentSmartTransactions.findIndex((stx) => stx.uuid === smartTransaction.uuid);
|
|
415
442
|
if (currentIndex === -1) {
|
|
416
443
|
return; // Smart transaction not found, don't update anything.
|
|
417
444
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
445
|
+
if (!(0, controller_utils_1.isSafeDynamicKey)(chainId)) {
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
this.update((state) => {
|
|
449
|
+
state.smartTransactionsState.smartTransactions[chainId][currentIndex] = Object.assign(Object.assign({}, state.smartTransactionsState.smartTransactions[chainId][currentIndex]), smartTransaction);
|
|
423
450
|
});
|
|
424
451
|
}, _SmartTransactionsController_addMetaMetricsPropsToNewSmartTransaction = async function _SmartTransactionsController_addMetaMetricsPropsToNewSmartTransaction(smartTransaction) {
|
|
425
|
-
const metaMetricsProps = await this.
|
|
452
|
+
const metaMetricsProps = await __classPrivateFieldGet(this, _SmartTransactionsController_getMetaMetricsProps, "f").call(this);
|
|
426
453
|
smartTransaction.accountHardwareType =
|
|
427
454
|
metaMetricsProps === null || metaMetricsProps === void 0 ? void 0 : metaMetricsProps.accountHardwareType;
|
|
428
455
|
smartTransaction.accountType = metaMetricsProps === null || metaMetricsProps === void 0 ? void 0 : metaMetricsProps.accountType;
|
|
429
456
|
smartTransaction.deviceModel = metaMetricsProps === null || metaMetricsProps === void 0 ? void 0 : metaMetricsProps.deviceModel;
|
|
430
|
-
}, _SmartTransactionsController_createOrUpdateSmartTransaction = async function _SmartTransactionsController_createOrUpdateSmartTransaction(smartTransaction, { chainId = this
|
|
457
|
+
}, _SmartTransactionsController_createOrUpdateSmartTransaction = async function _SmartTransactionsController_createOrUpdateSmartTransaction(smartTransaction, { chainId = __classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f"), ethQuery = __classPrivateFieldGet(this, _SmartTransactionsController_ethQuery, "f"), }) {
|
|
431
458
|
var _a;
|
|
432
|
-
const { smartTransactionsState } = this.state;
|
|
433
|
-
const { smartTransactions } = smartTransactionsState;
|
|
459
|
+
const { smartTransactionsState: { smartTransactions }, } = this.state;
|
|
434
460
|
const currentSmartTransactions = (_a = smartTransactions[chainId]) !== null && _a !== void 0 ? _a : [];
|
|
435
461
|
const currentIndex = currentSmartTransactions === null || currentSmartTransactions === void 0 ? void 0 : currentSmartTransactions.findIndex((stx) => stx.uuid === smartTransaction.uuid);
|
|
436
462
|
const isNewSmartTransaction = this.isNewSmartTransaction(smartTransaction.uuid);
|
|
437
|
-
if (this
|
|
463
|
+
if (__classPrivateFieldGet(this, _SmartTransactionsController_ethQuery, "f") === undefined) {
|
|
438
464
|
throw new Error(ETH_QUERY_ERROR_MSG);
|
|
439
465
|
}
|
|
440
466
|
if (isNewSmartTransaction) {
|
|
@@ -459,14 +485,15 @@ _SmartTransactionsController_instances = new WeakSet(), _SmartTransactionsContro
|
|
|
459
485
|
.concat(currentSmartTransactions.slice(cancelledNonceIndex + 1))
|
|
460
486
|
.concat(historifiedSmartTransaction)
|
|
461
487
|
: currentSmartTransactions.concat(historifiedSmartTransaction);
|
|
462
|
-
this.update({
|
|
463
|
-
smartTransactionsState
|
|
488
|
+
this.update((state) => {
|
|
489
|
+
state.smartTransactionsState.smartTransactions[__classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f")] =
|
|
490
|
+
nextSmartTransactions;
|
|
464
491
|
});
|
|
465
492
|
return;
|
|
466
493
|
}
|
|
467
494
|
// We have to emit this event here, because then a txHash is returned to the TransactionController once it's available
|
|
468
495
|
// and the #doesTransactionNeedConfirmation function will work properly, since it will find the txHash in the regular transactions list.
|
|
469
|
-
this.
|
|
496
|
+
this.messagingSystem.publish(`SmartTransactionsController:smartTransaction`, smartTransaction);
|
|
470
497
|
if ((smartTransaction.status === types_1.SmartTransactionStatuses.SUCCESS ||
|
|
471
498
|
smartTransaction.status === types_1.SmartTransactionStatuses.REVERTED) &&
|
|
472
499
|
!smartTransaction.confirmed) {
|
|
@@ -487,7 +514,7 @@ _SmartTransactionsController_instances = new WeakSet(), _SmartTransactionsContro
|
|
|
487
514
|
if (!txHash) {
|
|
488
515
|
return true;
|
|
489
516
|
}
|
|
490
|
-
const transactions = this.
|
|
517
|
+
const transactions = __classPrivateFieldGet(this, _SmartTransactionsController_getRegularTransactions, "f").call(this);
|
|
491
518
|
const foundTransaction = transactions === null || transactions === void 0 ? void 0 : transactions.find((tx) => {
|
|
492
519
|
var _a;
|
|
493
520
|
return ((_a = tx.hash) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === txHash.toLowerCase();
|
|
@@ -499,7 +526,7 @@ _SmartTransactionsController_instances = new WeakSet(), _SmartTransactionsContro
|
|
|
499
526
|
// When it's in the submitted state, the TransactionController checks its status and confirms it,
|
|
500
527
|
// so no need to confirm it again here.
|
|
501
528
|
return ![transaction_controller_1.TransactionStatus.confirmed, transaction_controller_1.TransactionStatus.submitted].includes(foundTransaction.status);
|
|
502
|
-
}, _SmartTransactionsController_confirmSmartTransaction = async function _SmartTransactionsController_confirmSmartTransaction(smartTransaction, { chainId = this
|
|
529
|
+
}, _SmartTransactionsController_confirmSmartTransaction = async function _SmartTransactionsController_confirmSmartTransaction(smartTransaction, { chainId = __classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f"), ethQuery = __classPrivateFieldGet(this, _SmartTransactionsController_ethQuery, "f"), }) {
|
|
503
530
|
var _a;
|
|
504
531
|
if (ethQuery === undefined) {
|
|
505
532
|
throw new Error(ETH_QUERY_ERROR_MSG);
|
|
@@ -526,9 +553,13 @@ _SmartTransactionsController_instances = new WeakSet(), _SmartTransactionsContro
|
|
|
526
553
|
const txMeta = entry.length > 0
|
|
527
554
|
? Object.assign(Object.assign({}, originalTxMeta), { history: originalTxMeta.history.concat(entry) }) : originalTxMeta;
|
|
528
555
|
if (__classPrivateFieldGet(this, _SmartTransactionsController_instances, "m", _SmartTransactionsController_doesTransactionNeedConfirmation).call(this, txHash)) {
|
|
529
|
-
this
|
|
556
|
+
__classPrivateFieldGet(this, _SmartTransactionsController_confirmExternalTransaction, "f").call(this,
|
|
557
|
+
// TODO: Replace 'as' assertion with correct typing for `txMeta`
|
|
558
|
+
txMeta, transactionReceipt,
|
|
559
|
+
// TODO: Replace 'as' assertion with correct typing for `baseFeePerGas`
|
|
560
|
+
baseFeePerGas);
|
|
530
561
|
}
|
|
531
|
-
this.
|
|
562
|
+
__classPrivateFieldGet(this, _SmartTransactionsController_trackMetaMetricsEvent, "f").call(this, {
|
|
532
563
|
event: constants_1.MetaMetricsEventName.StxConfirmed,
|
|
533
564
|
category: constants_1.MetaMetricsEventCategory.Transactions,
|
|
534
565
|
properties: (0, utils_1.getSmartTransactionMetricsProperties)(smartTransaction),
|
|
@@ -540,42 +571,47 @@ _SmartTransactionsController_instances = new WeakSet(), _SmartTransactionsContro
|
|
|
540
571
|
}
|
|
541
572
|
}
|
|
542
573
|
catch (error) {
|
|
543
|
-
this.
|
|
574
|
+
__classPrivateFieldGet(this, _SmartTransactionsController_trackMetaMetricsEvent, "f").call(this, {
|
|
544
575
|
event: constants_1.MetaMetricsEventName.StxConfirmationFailed,
|
|
545
576
|
category: constants_1.MetaMetricsEventCategory.Transactions,
|
|
546
577
|
});
|
|
547
578
|
console.error('confirm error', error);
|
|
548
579
|
}
|
|
580
|
+
finally {
|
|
581
|
+
this.messagingSystem.publish(`SmartTransactionsController:smartTransactionConfirmationDone`, smartTransaction);
|
|
582
|
+
}
|
|
549
583
|
}, _SmartTransactionsController_getChainId = function _SmartTransactionsController_getChainId({ networkClientId, } = {}) {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
584
|
+
if (networkClientId) {
|
|
585
|
+
return this.messagingSystem.call('NetworkController:getNetworkClientById', networkClientId).configuration.chainId;
|
|
586
|
+
}
|
|
587
|
+
return __classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f");
|
|
553
588
|
}, _SmartTransactionsController_getEthQuery = function _SmartTransactionsController_getEthQuery({ networkClientId, } = {}) {
|
|
554
589
|
if (networkClientId) {
|
|
555
|
-
|
|
590
|
+
const { provider } = this.messagingSystem.call('NetworkController:getNetworkClientById', networkClientId);
|
|
591
|
+
return new eth_query_1.default(provider);
|
|
556
592
|
}
|
|
557
|
-
if (this
|
|
593
|
+
if (__classPrivateFieldGet(this, _SmartTransactionsController_ethQuery, "f") === undefined) {
|
|
558
594
|
throw new Error(ETH_QUERY_ERROR_MSG);
|
|
559
595
|
}
|
|
560
|
-
return this
|
|
596
|
+
return __classPrivateFieldGet(this, _SmartTransactionsController_ethQuery, "f");
|
|
561
597
|
}, _SmartTransactionsController_getCurrentSmartTransactions = function _SmartTransactionsController_getCurrentSmartTransactions() {
|
|
562
|
-
const { smartTransactions } = this.state
|
|
563
|
-
const
|
|
564
|
-
const currentSmartTransactions = smartTransactions === null || smartTransactions === void 0 ? void 0 : smartTransactions[chainId];
|
|
598
|
+
const { smartTransactionsState: { smartTransactions }, } = this.state;
|
|
599
|
+
const currentSmartTransactions = smartTransactions === null || smartTransactions === void 0 ? void 0 : smartTransactions[__classPrivateFieldGet(this, _SmartTransactionsController_chainId, "f")];
|
|
565
600
|
if (!currentSmartTransactions || currentSmartTransactions.length === 0) {
|
|
566
601
|
return [];
|
|
567
602
|
}
|
|
568
603
|
return currentSmartTransactions;
|
|
569
604
|
}, _SmartTransactionsController_wipeSmartTransactionsPerChainId = function _SmartTransactionsController_wipeSmartTransactionsPerChainId({ chainId, addressLowerCase, }) {
|
|
570
|
-
const { smartTransactions } = this.state
|
|
605
|
+
const { smartTransactionsState: { smartTransactions }, } = this.state;
|
|
571
606
|
const smartTransactionsForSelectedChain = smartTransactions === null || smartTransactions === void 0 ? void 0 : smartTransactions[chainId];
|
|
572
607
|
if (!smartTransactionsForSelectedChain ||
|
|
573
608
|
smartTransactionsForSelectedChain.length === 0) {
|
|
574
609
|
return;
|
|
575
610
|
}
|
|
576
611
|
const newSmartTransactionsForSelectedChain = smartTransactionsForSelectedChain.filter((smartTransaction) => { var _a; return ((_a = smartTransaction.txParams) === null || _a === void 0 ? void 0 : _a.from) !== addressLowerCase; });
|
|
577
|
-
this.update({
|
|
578
|
-
|
|
612
|
+
this.update((state) => {
|
|
613
|
+
state.smartTransactionsState.smartTransactions[chainId] =
|
|
614
|
+
newSmartTransactionsForSelectedChain;
|
|
579
615
|
});
|
|
580
616
|
};
|
|
581
617
|
//# sourceMappingURL=SmartTransactionsController.js.map
|