@toruslabs/ethereum-controllers 6.3.2 → 7.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/757.ethereumControllers.cjs.js +226 -0
- package/dist/ethereumControllers.cjs.js +19077 -2288
- package/dist/ethereumControllers.esm.js +1808 -1614
- package/dist/ethereumControllers.umd.min.js +1 -1
- package/dist/lib.cjs/AccountAbstraction/AccountAbstractionController.js +217 -0
- package/dist/lib.cjs/AccountAbstraction/smartAccounts/BiconomySmartAccount.js +29 -0
- package/dist/lib.cjs/AccountAbstraction/smartAccounts/KernelSmartAccount.js +24 -0
- package/dist/lib.cjs/AccountAbstraction/smartAccounts/NexusSmartAccount.js +30 -0
- package/dist/lib.cjs/AccountAbstraction/smartAccounts/SafeSmartAccount.js +32 -0
- package/dist/lib.cjs/AccountAbstraction/smartAccounts/TrustSmartAccount.js +31 -0
- package/dist/lib.cjs/Block/PollingBlockTracker.js +1 -2
- package/dist/lib.cjs/Currency/CurrencyController.js +1 -2
- package/dist/lib.cjs/Gas/GasFeeController.js +1 -2
- package/dist/lib.cjs/Message/AddChainController.js +6 -9
- package/dist/lib.cjs/Message/MessageController.js +7 -10
- package/dist/lib.cjs/Message/PersonalMessageController.js +7 -10
- package/dist/lib.cjs/Message/SwitchChainController.js +6 -9
- package/dist/lib.cjs/Message/TypedMessageController.js +8 -8
- package/dist/lib.cjs/Nfts/NftsController.js +1 -2
- package/dist/lib.cjs/Preferences/PreferencesController.js +19 -3
- package/dist/lib.cjs/Tokens/TokenRatesController.js +1 -2
- package/dist/lib.cjs/Tokens/TokensController.js +1 -1
- package/dist/lib.cjs/Transaction/PendingTransactionTracker.js +2 -1
- package/dist/lib.cjs/index.js +15 -5
- package/dist/lib.cjs/utils/constants.js +10 -12
- package/dist/lib.cjs/utils/helpers.js +0 -25
- package/dist/lib.esm/AccountAbstraction/AccountAbstractionController.js +213 -0
- package/dist/lib.esm/AccountAbstraction/smartAccounts/BiconomySmartAccount.js +27 -0
- package/dist/lib.esm/AccountAbstraction/smartAccounts/KernelSmartAccount.js +22 -0
- package/dist/lib.esm/AccountAbstraction/smartAccounts/NexusSmartAccount.js +28 -0
- package/dist/lib.esm/AccountAbstraction/smartAccounts/SafeSmartAccount.js +30 -0
- package/dist/lib.esm/AccountAbstraction/smartAccounts/TrustSmartAccount.js +29 -0
- package/dist/lib.esm/Block/PollingBlockTracker.js +1 -2
- package/dist/lib.esm/Currency/CurrencyController.js +1 -2
- package/dist/lib.esm/Gas/GasFeeController.js +1 -2
- package/dist/lib.esm/Message/AddChainController.js +3 -6
- package/dist/lib.esm/Message/MessageController.js +4 -7
- package/dist/lib.esm/Message/PersonalMessageController.js +4 -7
- package/dist/lib.esm/Message/SwitchChainController.js +3 -6
- package/dist/lib.esm/Message/TypedMessageController.js +5 -5
- package/dist/lib.esm/Nfts/NftsController.js +1 -2
- package/dist/lib.esm/Preferences/PreferencesController.js +19 -3
- package/dist/lib.esm/Tokens/TokenRatesController.js +1 -2
- package/dist/lib.esm/Tokens/TokensController.js +2 -2
- package/dist/lib.esm/Transaction/PendingTransactionTracker.js +2 -1
- package/dist/lib.esm/index.js +8 -3
- package/dist/lib.esm/utils/constants.js +10 -11
- package/dist/lib.esm/utils/helpers.js +1 -25
- package/dist/types/AccountAbstraction/AccountAbstractionController.d.ts +52 -0
- package/dist/types/AccountAbstraction/smartAccounts/BiconomySmartAccount.d.ts +15 -0
- package/dist/types/AccountAbstraction/smartAccounts/KernelSmartAccount.d.ts +16 -0
- package/dist/types/AccountAbstraction/smartAccounts/LightSmartAccount.d.ts +15 -0
- package/dist/types/AccountAbstraction/smartAccounts/NexusSmartAccount.d.ts +15 -0
- package/dist/types/AccountAbstraction/smartAccounts/SafeSmartAccount.d.ts +16 -0
- package/dist/types/AccountAbstraction/smartAccounts/SimpleSmartAccount.d.ts +16 -0
- package/dist/types/AccountAbstraction/smartAccounts/TrustSmartAccount.d.ts +16 -0
- package/dist/types/AccountAbstraction/smartAccounts/index.d.ts +5 -0
- package/dist/types/Block/PollingBlockTracker.d.ts +2 -2
- package/dist/types/Currency/CurrencyController.d.ts +2 -2
- package/dist/types/Message/AddChainController.d.ts +3 -6
- package/dist/types/Message/MessageController.d.ts +5 -8
- package/dist/types/Message/PersonalMessageController.d.ts +5 -8
- package/dist/types/Message/SwitchChainController.d.ts +3 -6
- package/dist/types/Message/TypedMessageController.d.ts +3 -3
- package/dist/types/Message/types.d.ts +2 -0
- package/dist/types/Message/utils.d.ts +2 -1
- package/dist/types/Network/createEthereumMiddleware.d.ts +2 -2
- package/dist/types/Nfts/NftsController.d.ts +2 -2
- package/dist/types/Preferences/PreferencesController.d.ts +4 -1
- package/dist/types/Tokens/ITokensController.d.ts +4 -6
- package/dist/types/Tokens/TokenRatesController.d.ts +6 -14
- package/dist/types/Tokens/TokensController.d.ts +7 -7
- package/dist/types/Transaction/TransactionController.d.ts +2 -2
- package/dist/types/index.d.ts +2 -6
- package/dist/types/utils/constants.d.ts +8 -10
- package/dist/types/utils/helpers.d.ts +0 -3
- package/dist/types/utils/interfaces.d.ts +31 -2
- package/package.json +6 -4
- package/dist/lib.cjs/Message/AbstractMessageController.js +0 -107
- package/dist/lib.esm/Message/AbstractMessageController.js +0 -105
- package/dist/types/Message/AbstractMessageController.d.ts +0 -35
|
@@ -5,10 +5,9 @@ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
|
5
5
|
var baseControllers = require('@toruslabs/base-controllers');
|
|
6
6
|
var log = require('loglevel');
|
|
7
7
|
var constants = require('../utils/constants.js');
|
|
8
|
-
var AbstractMessageController = require('./AbstractMessageController.js');
|
|
9
8
|
var utils = require('./utils.js');
|
|
10
9
|
|
|
11
|
-
class TypedMessageController extends
|
|
10
|
+
class TypedMessageController extends baseControllers.AbstractMessageController {
|
|
12
11
|
constructor({
|
|
13
12
|
config,
|
|
14
13
|
state,
|
|
@@ -17,12 +16,13 @@ class TypedMessageController extends AbstractMessageController.AbstractMessageCo
|
|
|
17
16
|
}) {
|
|
18
17
|
super({
|
|
19
18
|
config,
|
|
20
|
-
state
|
|
21
|
-
getNetworkIdentifier
|
|
19
|
+
state
|
|
22
20
|
});
|
|
23
21
|
_defineProperty(this, "name", "TypedMessageController");
|
|
24
22
|
_defineProperty(this, "signTypedData", void 0);
|
|
23
|
+
_defineProperty(this, "getNetworkIdentifier", void 0);
|
|
25
24
|
this.signTypedData = signTypedData;
|
|
25
|
+
this.getNetworkIdentifier = getNetworkIdentifier;
|
|
26
26
|
this.initialize();
|
|
27
27
|
}
|
|
28
28
|
async processSignTypedMessage(messageId) {
|
|
@@ -37,12 +37,12 @@ class TypedMessageController extends AbstractMessageController.AbstractMessageCo
|
|
|
37
37
|
this.updateMessage(_objectSpread(_objectSpread({}, msgObject), {}, {
|
|
38
38
|
rawSig
|
|
39
39
|
}));
|
|
40
|
-
this.setMessageStatus(messageId,
|
|
40
|
+
this.setMessageStatus(messageId, baseControllers.MessageStatus.SIGNED);
|
|
41
41
|
return rawSig;
|
|
42
42
|
} catch (error) {
|
|
43
43
|
log.error(error);
|
|
44
44
|
msgObject.error = (error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : error.toString());
|
|
45
|
-
this.setMessageStatus(messageId,
|
|
45
|
+
this.setMessageStatus(messageId, baseControllers.MessageStatus.FAILED);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
async addNewUnapprovedMessage(messageParams, req) {
|
|
@@ -62,12 +62,12 @@ class TypedMessageController extends AbstractMessageController.AbstractMessageCo
|
|
|
62
62
|
const messageData = {
|
|
63
63
|
id: messageId,
|
|
64
64
|
messageParams,
|
|
65
|
-
status:
|
|
65
|
+
status: baseControllers.MessageStatus.UNAPPROVED,
|
|
66
66
|
time: Date.now(),
|
|
67
67
|
type: constants.METHOD_TYPES.ETH_SIGN_TYPED_DATA_V4
|
|
68
68
|
};
|
|
69
69
|
await this.addMessage(messageData);
|
|
70
|
-
this.emit(
|
|
70
|
+
this.emit(baseControllers.MESSAGE_EVENTS.UNAPPROVED_MESSAGE, {
|
|
71
71
|
messageData,
|
|
72
72
|
req
|
|
73
73
|
});
|
|
@@ -7,7 +7,6 @@ var deepmerge = require('deepmerge');
|
|
|
7
7
|
var ethers = require('ethers');
|
|
8
8
|
var log = require('loglevel');
|
|
9
9
|
var constants = require('../utils/constants.js');
|
|
10
|
-
var helpers = require('../utils/helpers.js');
|
|
11
10
|
var NftHandler = require('./NftHandler.js');
|
|
12
11
|
|
|
13
12
|
const DEFAULT_INTERVAL = 180 * 1000;
|
|
@@ -81,7 +80,7 @@ class NftsController extends baseControllers.BaseController {
|
|
|
81
80
|
return;
|
|
82
81
|
}
|
|
83
82
|
this._timer = window.setInterval(() => {
|
|
84
|
-
if (!
|
|
83
|
+
if (!baseControllers.idleTimeTracker.checkIfIdle()) {
|
|
85
84
|
this.detectNewNfts();
|
|
86
85
|
this.refreshNftBalances();
|
|
87
86
|
}
|
|
@@ -70,8 +70,13 @@ class PreferencesController extends baseControllers.BasePreferencesController {
|
|
|
70
70
|
web3AuthClientId,
|
|
71
71
|
web3AuthNetwork,
|
|
72
72
|
loginMode,
|
|
73
|
-
sessionPubKey
|
|
73
|
+
sessionPubKey,
|
|
74
|
+
aaProvider,
|
|
75
|
+
eoaAddress
|
|
74
76
|
} = params;
|
|
77
|
+
const {
|
|
78
|
+
chainId
|
|
79
|
+
} = this.getProviderConfig();
|
|
75
80
|
await super.init({
|
|
76
81
|
address,
|
|
77
82
|
userInfo,
|
|
@@ -80,7 +85,10 @@ class PreferencesController extends baseControllers.BasePreferencesController {
|
|
|
80
85
|
metadata: {
|
|
81
86
|
email: userInfo.email,
|
|
82
87
|
signatures,
|
|
83
|
-
network: web3AuthNetwork
|
|
88
|
+
network: web3AuthNetwork,
|
|
89
|
+
eoa_address: eoaAddress,
|
|
90
|
+
aa_provider: aaProvider,
|
|
91
|
+
chain_id: chainId
|
|
84
92
|
}
|
|
85
93
|
});
|
|
86
94
|
const {
|
|
@@ -99,9 +107,17 @@ class PreferencesController extends baseControllers.BasePreferencesController {
|
|
|
99
107
|
locale,
|
|
100
108
|
address,
|
|
101
109
|
type,
|
|
102
|
-
web3AuthNetwork
|
|
110
|
+
web3AuthNetwork,
|
|
111
|
+
metadata: {
|
|
112
|
+
aa_provider: aaProvider,
|
|
113
|
+
chain_id: chainId,
|
|
114
|
+
eoa_address: eoaAddress
|
|
115
|
+
}
|
|
103
116
|
});
|
|
104
117
|
}
|
|
118
|
+
if (eoaAddress) this.updateState({
|
|
119
|
+
eoaAddress
|
|
120
|
+
}, address);
|
|
105
121
|
this.storeUserLogin({
|
|
106
122
|
verifier: aggregateVerifier || verifier,
|
|
107
123
|
verifierId,
|
|
@@ -6,7 +6,6 @@ var baseControllers = require('@toruslabs/base-controllers');
|
|
|
6
6
|
var httpHelpers = require('@toruslabs/http-helpers');
|
|
7
7
|
var log = require('loglevel');
|
|
8
8
|
var constants = require('../utils/constants.js');
|
|
9
|
-
var helpers = require('../utils/helpers.js');
|
|
10
9
|
|
|
11
10
|
const DEFAULT_CURRENCY = "eth";
|
|
12
11
|
class TokenRatesController extends baseControllers.BaseController {
|
|
@@ -68,7 +67,7 @@ class TokenRatesController extends baseControllers.BaseController {
|
|
|
68
67
|
window.clearInterval(this.conversionInterval);
|
|
69
68
|
}
|
|
70
69
|
this.conversionInterval = window.setInterval(() => {
|
|
71
|
-
if (!
|
|
70
|
+
if (!baseControllers.idleTimeTracker.checkIfIdle()) {
|
|
72
71
|
this.updateExchangeRates();
|
|
73
72
|
}
|
|
74
73
|
}, this.config.pollInterval);
|
|
@@ -102,7 +102,7 @@ class TokensController extends baseControllers.BaseController {
|
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
104
|
this._timer = window.setInterval(() => {
|
|
105
|
-
if (!
|
|
105
|
+
if (!baseControllers.idleTimeTracker.checkIfIdle()) {
|
|
106
106
|
this.detectNewTokens();
|
|
107
107
|
this.refreshTokenBalances();
|
|
108
108
|
}
|
|
@@ -88,6 +88,7 @@ class PendingTransactionTracker extends auth.SafeEventEmitter {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
async _resubmitTx(txMeta, latestBlockNumber) {
|
|
91
|
+
if (txMeta.userOpHash) return;
|
|
91
92
|
if (!txMeta.firstRetryBlockNumber) {
|
|
92
93
|
this.emit(baseControllers.TX_EVENTS.TX_BLOCK_UPDATE, {
|
|
93
94
|
txMeta,
|
|
@@ -122,7 +123,7 @@ class PendingTransactionTracker extends auth.SafeEventEmitter {
|
|
|
122
123
|
const txId = txMeta.id;
|
|
123
124
|
|
|
124
125
|
// Only check submitted txs
|
|
125
|
-
if (txMeta.status !== baseControllers.TransactionStatus.submitted) return;
|
|
126
|
+
if (txMeta.status !== baseControllers.TransactionStatus.submitted || txMeta.isUserOperation) return;
|
|
126
127
|
|
|
127
128
|
// extra check in case there was an uncaught error during the
|
|
128
129
|
// signature and submission process
|
package/dist/lib.cjs/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var AccountTrackerController = require('./Account/AccountTrackerController.js');
|
|
4
|
+
var AccountAbstractionController = require('./AccountAbstraction/AccountAbstractionController.js');
|
|
4
5
|
var PollingBlockTracker = require('./Block/PollingBlockTracker.js');
|
|
5
6
|
var CurrencyController = require('./Currency/CurrencyController.js');
|
|
6
7
|
var GasFeeController = require('./Gas/GasFeeController.js');
|
|
7
8
|
var KeyringController = require('./Keyring/KeyringController.js');
|
|
8
|
-
var AbstractMessageController = require('./Message/AbstractMessageController.js');
|
|
9
9
|
var AddChainController = require('./Message/AddChainController.js');
|
|
10
10
|
var MessageController = require('./Message/MessageController.js');
|
|
11
11
|
var PersonalMessageController = require('./Message/PersonalMessageController.js');
|
|
@@ -32,15 +32,22 @@ var abis = require('./utils/abis.js');
|
|
|
32
32
|
var constants = require('./utils/constants.js');
|
|
33
33
|
var conversionUtils = require('./utils/conversionUtils.js');
|
|
34
34
|
var helpers = require('./utils/helpers.js');
|
|
35
|
+
var BiconomySmartAccount = require('./AccountAbstraction/smartAccounts/BiconomySmartAccount.js');
|
|
36
|
+
var KernelSmartAccount = require('./AccountAbstraction/smartAccounts/KernelSmartAccount.js');
|
|
37
|
+
var NexusSmartAccount = require('./AccountAbstraction/smartAccounts/NexusSmartAccount.js');
|
|
38
|
+
var SafeSmartAccount = require('./AccountAbstraction/smartAccounts/SafeSmartAccount.js');
|
|
39
|
+
var TrustSmartAccount = require('./AccountAbstraction/smartAccounts/TrustSmartAccount.js');
|
|
35
40
|
|
|
36
41
|
|
|
37
42
|
|
|
38
43
|
exports.AccountTrackerController = AccountTrackerController.AccountTrackerController;
|
|
44
|
+
exports.AccountAbstractionController = AccountAbstractionController.AccountAbstractionController;
|
|
45
|
+
exports.eoaInterceptorMiddleware = AccountAbstractionController.eoaInterceptorMiddleware;
|
|
46
|
+
exports.eoaProviderAsMiddleware = AccountAbstractionController.eoaProviderAsMiddleware;
|
|
39
47
|
exports.PollingBlockTracker = PollingBlockTracker.PollingBlockTracker;
|
|
40
48
|
exports.CurrencyController = CurrencyController.CurrencyController;
|
|
41
49
|
exports.GasFeeController = GasFeeController.GasFeeController;
|
|
42
50
|
exports.KeyringController = KeyringController.KeyringController;
|
|
43
|
-
exports.AbstractMessageController = AbstractMessageController.AbstractMessageController;
|
|
44
51
|
exports.AddChainController = AddChainController.AddChainController;
|
|
45
52
|
exports.MessageController = MessageController.MessageController;
|
|
46
53
|
exports.PersonalMessageController = PersonalMessageController.PersonalMessageController;
|
|
@@ -125,9 +132,7 @@ exports.ETHERSCAN_SUPPORTED_CHAINS = constants.ETHERSCAN_SUPPORTED_CHAINS;
|
|
|
125
132
|
exports.GAS_ESTIMATE_TYPES = constants.GAS_ESTIMATE_TYPES;
|
|
126
133
|
exports.LOCALHOST = constants.LOCALHOST;
|
|
127
134
|
exports.MAINNET_CHAIN_ID = constants.MAINNET_CHAIN_ID;
|
|
128
|
-
exports.MESSAGE_EVENTS = constants.MESSAGE_EVENTS;
|
|
129
135
|
exports.METHOD_TYPES = constants.METHOD_TYPES;
|
|
130
|
-
exports.MessageStatus = constants.MessageStatus;
|
|
131
136
|
exports.OLD_ERC721_LIST = constants.OLD_ERC721_LIST;
|
|
132
137
|
exports.OPTIMISM_MAINNET_CHAIN_ID = constants.OPTIMISM_MAINNET_CHAIN_ID;
|
|
133
138
|
exports.OPTIMISM_TESTNET_CHAIN_ID = constants.OPTIMISM_TESTNET_CHAIN_ID;
|
|
@@ -135,6 +140,7 @@ exports.POLYGON_AMOY_CHAIN_ID = constants.POLYGON_AMOY_CHAIN_ID;
|
|
|
135
140
|
exports.POLYGON_CHAIN_ID = constants.POLYGON_CHAIN_ID;
|
|
136
141
|
exports.SEPOLIA_CHAIN_ID = constants.SEPOLIA_CHAIN_ID;
|
|
137
142
|
exports.SIMPLEHASH_SUPPORTED_CHAINS = constants.SIMPLEHASH_SUPPORTED_CHAINS;
|
|
143
|
+
exports.SMART_ACCOUNT = constants.SMART_ACCOUNT;
|
|
138
144
|
exports.SUPPORTED_NETWORKS = constants.SUPPORTED_NETWORKS;
|
|
139
145
|
exports.TEST_CHAINS = constants.TEST_CHAINS;
|
|
140
146
|
exports.TRANSACTION_ENVELOPE_TYPES = constants.TRANSACTION_ENVELOPE_TYPES;
|
|
@@ -164,7 +170,11 @@ exports.getEthTxStatus = helpers.getEthTxStatus;
|
|
|
164
170
|
exports.getEtherScanHashLink = helpers.getEtherScanHashLink;
|
|
165
171
|
exports.getIpfsEndpoint = helpers.getIpfsEndpoint;
|
|
166
172
|
exports.hexToBn = helpers.hexToBn;
|
|
167
|
-
exports.idleTimeTracker = helpers.idleTimeTracker;
|
|
168
173
|
exports.isAddressByChainId = helpers.isAddressByChainId;
|
|
169
174
|
exports.sanitizeNftMetdataUrl = helpers.sanitizeNftMetdataUrl;
|
|
170
175
|
exports.toChecksumAddressByChainId = helpers.toChecksumAddressByChainId;
|
|
176
|
+
exports.BiconomySmartAccount = BiconomySmartAccount.BiconomySmartAccount;
|
|
177
|
+
exports.KernelSmartAccount = KernelSmartAccount.KernelSmartAccount;
|
|
178
|
+
exports.NexusSmartAccount = NexusSmartAccount.NexusSmartAccount;
|
|
179
|
+
exports.SafeSmartAccount = SafeSmartAccount.SafeSmartAccount;
|
|
180
|
+
exports.TrustSmartAccount = TrustSmartAccount.TrustSmartAccount;
|
|
@@ -310,16 +310,15 @@ const COINGECKO_PLATFORMS_CHAIN_CODE_MAP = {
|
|
|
310
310
|
currency: "eth"
|
|
311
311
|
}
|
|
312
312
|
};
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
UNAPPROVED_MESSAGE: "unapprovedMessage"
|
|
313
|
+
const SMART_ACCOUNT = {
|
|
314
|
+
BICONOMY: "biconomy",
|
|
315
|
+
KERNEL: "kernel",
|
|
316
|
+
SAFE: "safe",
|
|
317
|
+
TRUST: "trust",
|
|
318
|
+
// TODO: disabled because of pimlico issues
|
|
319
|
+
LIGHT: "light",
|
|
320
|
+
SIMPLE: "simple",
|
|
321
|
+
NEXUS: "nexus"
|
|
323
322
|
};
|
|
324
323
|
|
|
325
324
|
exports.ARBITRUM_MAINNET_CHAIN_ID = ARBITRUM_MAINNET_CHAIN_ID;
|
|
@@ -346,9 +345,7 @@ exports.ETHERSCAN_SUPPORTED_CHAINS = ETHERSCAN_SUPPORTED_CHAINS;
|
|
|
346
345
|
exports.GAS_ESTIMATE_TYPES = GAS_ESTIMATE_TYPES;
|
|
347
346
|
exports.LOCALHOST = LOCALHOST;
|
|
348
347
|
exports.MAINNET_CHAIN_ID = MAINNET_CHAIN_ID;
|
|
349
|
-
exports.MESSAGE_EVENTS = MESSAGE_EVENTS;
|
|
350
348
|
exports.METHOD_TYPES = METHOD_TYPES;
|
|
351
|
-
exports.MessageStatus = MessageStatus;
|
|
352
349
|
exports.OLD_ERC721_LIST = OLD_ERC721_LIST;
|
|
353
350
|
exports.OPTIMISM_MAINNET_CHAIN_ID = OPTIMISM_MAINNET_CHAIN_ID;
|
|
354
351
|
exports.OPTIMISM_TESTNET_CHAIN_ID = OPTIMISM_TESTNET_CHAIN_ID;
|
|
@@ -356,6 +353,7 @@ exports.POLYGON_AMOY_CHAIN_ID = POLYGON_AMOY_CHAIN_ID;
|
|
|
356
353
|
exports.POLYGON_CHAIN_ID = POLYGON_CHAIN_ID;
|
|
357
354
|
exports.SEPOLIA_CHAIN_ID = SEPOLIA_CHAIN_ID;
|
|
358
355
|
exports.SIMPLEHASH_SUPPORTED_CHAINS = SIMPLEHASH_SUPPORTED_CHAINS;
|
|
356
|
+
exports.SMART_ACCOUNT = SMART_ACCOUNT;
|
|
359
357
|
exports.SUPPORTED_NETWORKS = SUPPORTED_NETWORKS;
|
|
360
358
|
exports.TEST_CHAINS = TEST_CHAINS;
|
|
361
359
|
exports.TRANSACTION_ENVELOPE_TYPES = TRANSACTION_ENVELOPE_TYPES;
|
|
@@ -93,30 +93,6 @@ function formatDate(inputDate) {
|
|
|
93
93
|
function formatTime(time) {
|
|
94
94
|
return new Date(time).toTimeString().slice(0, 8);
|
|
95
95
|
}
|
|
96
|
-
const idleTimeTracker = (activityThresholdTime => {
|
|
97
|
-
let isIdle = false;
|
|
98
|
-
let idleTimeout = null;
|
|
99
|
-
const resetTimer = () => {
|
|
100
|
-
if (idleTimeout) {
|
|
101
|
-
window.clearTimeout(idleTimeout);
|
|
102
|
-
}
|
|
103
|
-
isIdle = false;
|
|
104
|
-
idleTimeout = window.setTimeout(() => {
|
|
105
|
-
isIdle = true;
|
|
106
|
-
}, activityThresholdTime * 1000);
|
|
107
|
-
};
|
|
108
|
-
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
109
|
-
window.addEventListener("load", resetTimer);
|
|
110
|
-
document.addEventListener("mousemove", resetTimer);
|
|
111
|
-
document.addEventListener("keydown", resetTimer);
|
|
112
|
-
}
|
|
113
|
-
function checkIfIdle() {
|
|
114
|
-
return isIdle;
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
checkIfIdle
|
|
118
|
-
};
|
|
119
|
-
})(60 * 3);
|
|
120
96
|
function isAddressByChainId(address, _chainId) {
|
|
121
97
|
// TOOD: add rsk network checks.
|
|
122
98
|
return util.isValidAddress(address);
|
|
@@ -238,7 +214,6 @@ exports.getEthTxStatus = getEthTxStatus;
|
|
|
238
214
|
exports.getEtherScanHashLink = getEtherScanHashLink;
|
|
239
215
|
exports.getIpfsEndpoint = getIpfsEndpoint;
|
|
240
216
|
exports.hexToBn = hexToBn;
|
|
241
|
-
exports.idleTimeTracker = idleTimeTracker;
|
|
242
217
|
exports.isAddressByChainId = isAddressByChainId;
|
|
243
218
|
exports.sanitizeNftMetdataUrl = sanitizeNftMetdataUrl;
|
|
244
219
|
exports.toChecksumAddressByChainId = toChecksumAddressByChainId;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import { BaseController, TransactionStatus } from '@toruslabs/base-controllers';
|
|
4
|
+
import { JRPCEngine, providerFromEngine } from '@web3auth/auth';
|
|
5
|
+
import { isHexString } from 'ethers';
|
|
6
|
+
import log from 'loglevel';
|
|
7
|
+
import { defineChain, createPublicClient, http, createWalletClient } from 'viem';
|
|
8
|
+
import { createPaymasterClient, createBundlerClient } from 'viem/account-abstraction';
|
|
9
|
+
|
|
10
|
+
const eoaInterceptorMiddleware = eoaAddress => (req, res, next, end) => {
|
|
11
|
+
req.isAAProviderRequest = true;
|
|
12
|
+
if (req.method === "eth_accounts" || req.method === "eth_requestAccounts") {
|
|
13
|
+
res.result = [eoaAddress];
|
|
14
|
+
end();
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
next();
|
|
18
|
+
};
|
|
19
|
+
function eoaProviderAsMiddleware(provider) {
|
|
20
|
+
return async (req, res, _next, end) => {
|
|
21
|
+
// send request to provider
|
|
22
|
+
try {
|
|
23
|
+
const providerRes = await provider.request(req);
|
|
24
|
+
res.result = providerRes;
|
|
25
|
+
return end();
|
|
26
|
+
} catch (error) {
|
|
27
|
+
return end(error);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
class AccountAbstractionController extends BaseController {
|
|
32
|
+
constructor({
|
|
33
|
+
config,
|
|
34
|
+
state,
|
|
35
|
+
getProviderConfig,
|
|
36
|
+
onNetworkStateChange
|
|
37
|
+
}) {
|
|
38
|
+
super({
|
|
39
|
+
state,
|
|
40
|
+
config
|
|
41
|
+
});
|
|
42
|
+
_defineProperty(this, "_smartAccount", void 0);
|
|
43
|
+
_defineProperty(this, "_publicClient", void 0);
|
|
44
|
+
_defineProperty(this, "_walletClient", void 0);
|
|
45
|
+
_defineProperty(this, "_bundlerClient", void 0);
|
|
46
|
+
_defineProperty(this, "_paymasterClient", void 0);
|
|
47
|
+
_defineProperty(this, "getProviderConfig", void 0);
|
|
48
|
+
this.initialize();
|
|
49
|
+
this.getProviderConfig = getProviderConfig;
|
|
50
|
+
// TODO: handle network change in torus controller & call setupProvider
|
|
51
|
+
onNetworkStateChange(networkState => {
|
|
52
|
+
if (networkState.chainId !== this.config.chainId) {
|
|
53
|
+
this.configure({
|
|
54
|
+
chainId: networkState.chainId
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
get smartAccount() {
|
|
60
|
+
return this._smartAccount;
|
|
61
|
+
}
|
|
62
|
+
get bundlerClient() {
|
|
63
|
+
return this._bundlerClient;
|
|
64
|
+
}
|
|
65
|
+
get walletClient() {
|
|
66
|
+
return this._walletClient;
|
|
67
|
+
}
|
|
68
|
+
async setupProvider(eoaProvider, eoaAddress) {
|
|
69
|
+
var _this$config$bundlerC;
|
|
70
|
+
const providerConfig = this.getProviderConfig();
|
|
71
|
+
const chain = defineChain({
|
|
72
|
+
id: Number.parseInt(providerConfig.chainId, 16),
|
|
73
|
+
// id in number form
|
|
74
|
+
name: providerConfig.displayName,
|
|
75
|
+
rpcUrls: {
|
|
76
|
+
default: {
|
|
77
|
+
http: [providerConfig.rpcTarget],
|
|
78
|
+
webSocket: [providerConfig.wsTarget]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
blockExplorers: providerConfig.blockExplorerUrl ? {
|
|
82
|
+
default: {
|
|
83
|
+
name: "explorer",
|
|
84
|
+
// TODO: correct name if chain config has it
|
|
85
|
+
url: providerConfig.blockExplorerUrl
|
|
86
|
+
}
|
|
87
|
+
} : undefined,
|
|
88
|
+
nativeCurrency: {
|
|
89
|
+
name: providerConfig.tickerName,
|
|
90
|
+
symbol: providerConfig.ticker,
|
|
91
|
+
decimals: providerConfig.decimals || 18
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
this._publicClient = createPublicClient({
|
|
95
|
+
chain,
|
|
96
|
+
transport: http(providerConfig.rpcTarget)
|
|
97
|
+
});
|
|
98
|
+
const aaEngine = new JRPCEngine();
|
|
99
|
+
aaEngine.push(eoaInterceptorMiddleware(eoaAddress));
|
|
100
|
+
aaEngine.push(eoaProviderAsMiddleware(eoaProvider));
|
|
101
|
+
const provider = providerFromEngine(aaEngine);
|
|
102
|
+
this._smartAccount = await this.config.smartAccountInit.getSmartAccount({
|
|
103
|
+
owner: provider,
|
|
104
|
+
client: this._publicClient
|
|
105
|
+
});
|
|
106
|
+
if (this.config.paymasterConfig) {
|
|
107
|
+
var _this$config$paymaste;
|
|
108
|
+
this._paymasterClient = createPaymasterClient(_objectSpread(_objectSpread({}, this.config.paymasterConfig), {}, {
|
|
109
|
+
transport: (_this$config$paymaste = this.config.paymasterConfig.transport) !== null && _this$config$paymaste !== void 0 ? _this$config$paymaste : http(this.config.paymasterConfig.url)
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
112
|
+
this._bundlerClient = createBundlerClient(_objectSpread(_objectSpread({}, this.config.bundlerConfig), {}, {
|
|
113
|
+
account: this.smartAccount,
|
|
114
|
+
client: this._publicClient,
|
|
115
|
+
transport: (_this$config$bundlerC = this.config.bundlerConfig.transport) !== null && _this$config$bundlerC !== void 0 ? _this$config$bundlerC : http(this.config.bundlerConfig.url),
|
|
116
|
+
paymaster: this._paymasterClient
|
|
117
|
+
}));
|
|
118
|
+
this._walletClient = createWalletClient({
|
|
119
|
+
account: this.smartAccount,
|
|
120
|
+
chain,
|
|
121
|
+
transport: http()
|
|
122
|
+
});
|
|
123
|
+
log.info("check: this._smartAccount", this.smartAccount.address);
|
|
124
|
+
this.update({
|
|
125
|
+
smartAccountAddress: this.smartAccount.address
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async sendTransaction(id, tx, address) {
|
|
129
|
+
var _txParams$chainId;
|
|
130
|
+
if (address.toLowerCase() !== this.smartAccount.address.toLowerCase()) {
|
|
131
|
+
throw new Error("Invalid address");
|
|
132
|
+
}
|
|
133
|
+
const txParams = tx;
|
|
134
|
+
const userOperationParams = {
|
|
135
|
+
account: this.smartAccount,
|
|
136
|
+
calls: [{
|
|
137
|
+
to: txParams.to,
|
|
138
|
+
// Explicit conversation required to avoid value being passed as hex
|
|
139
|
+
value: BigInt(txParams.value),
|
|
140
|
+
data: txParams.data
|
|
141
|
+
}]
|
|
142
|
+
// should not use maxFeePerGas/maxPriorityFeePerGas from transaction params since that's fee for transaction not user operation and let bundler handle it instead
|
|
143
|
+
};
|
|
144
|
+
const userOpMeta = {
|
|
145
|
+
transactionParams: txParams,
|
|
146
|
+
chainId: (_txParams$chainId = txParams.chainId) !== null && _txParams$chainId !== void 0 ? _txParams$chainId : this.getProviderConfig().chainId,
|
|
147
|
+
createdAt: new Date(),
|
|
148
|
+
status: TransactionStatus.approved
|
|
149
|
+
};
|
|
150
|
+
this.updateUserOpMeta(id, userOpMeta);
|
|
151
|
+
// @ts-expect-error viem types are too deep
|
|
152
|
+
const userOpHash = await this.bundlerClient.sendUserOperation(userOperationParams);
|
|
153
|
+
this.updateUserOpMeta(id, {
|
|
154
|
+
userOpHash,
|
|
155
|
+
status: TransactionStatus.submitted
|
|
156
|
+
});
|
|
157
|
+
const txReceipt = await this.bundlerClient.waitForUserOperationReceipt({
|
|
158
|
+
hash: userOpHash
|
|
159
|
+
});
|
|
160
|
+
this.updateUserOpMeta(id, {
|
|
161
|
+
receipt: txReceipt,
|
|
162
|
+
status: txReceipt.success ? TransactionStatus.confirmed : TransactionStatus.failed
|
|
163
|
+
});
|
|
164
|
+
return txReceipt.receipt.transactionHash;
|
|
165
|
+
}
|
|
166
|
+
async signMessage(message, address) {
|
|
167
|
+
if (address.toLowerCase() !== this.smartAccount.address.toLowerCase()) {
|
|
168
|
+
throw new Error("Invalid address");
|
|
169
|
+
}
|
|
170
|
+
return this.smartAccount.sign({
|
|
171
|
+
hash: message
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
async signPersonalMessage(message, address) {
|
|
175
|
+
var _this$walletClient;
|
|
176
|
+
if (address.toLowerCase() !== this.smartAccount.address.toLowerCase()) {
|
|
177
|
+
throw new Error("Invalid address");
|
|
178
|
+
}
|
|
179
|
+
return (_this$walletClient = this.walletClient) === null || _this$walletClient === void 0 ? void 0 : _this$walletClient.signMessage({
|
|
180
|
+
account: this.smartAccount,
|
|
181
|
+
message: isHexString(message) ? {
|
|
182
|
+
raw: message
|
|
183
|
+
} : message
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
async signTypedData(data, address) {
|
|
187
|
+
var _this$walletClient2;
|
|
188
|
+
if (address.toLowerCase() !== this.smartAccount.address.toLowerCase()) {
|
|
189
|
+
throw new Error("Invalid address");
|
|
190
|
+
}
|
|
191
|
+
return (_this$walletClient2 = this.walletClient) === null || _this$walletClient2 === void 0 ? void 0 : _this$walletClient2.signTypedData({
|
|
192
|
+
account: this.smartAccount,
|
|
193
|
+
domain: _objectSpread(_objectSpread({}, data.domain), {}, {
|
|
194
|
+
verifyingContract: data.domain.verifyingContract,
|
|
195
|
+
salt: data.domain.salt,
|
|
196
|
+
chainId: Number(data.domain.chainId)
|
|
197
|
+
}),
|
|
198
|
+
primaryType: data.primaryType,
|
|
199
|
+
types: data.types,
|
|
200
|
+
message: data.message
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
updateUserOpMeta(id, data) {
|
|
204
|
+
const userOp = this.state.userOperations[id];
|
|
205
|
+
this.update({
|
|
206
|
+
userOperations: _objectSpread(_objectSpread({}, this.state.userOperations), {}, {
|
|
207
|
+
[id]: _objectSpread(_objectSpread({}, userOp), data)
|
|
208
|
+
})
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export { AccountAbstractionController, eoaInterceptorMiddleware, eoaProviderAsMiddleware };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import { toBiconomySmartAccount } from 'permissionless/accounts';
|
|
4
|
+
import { entryPoint06Address } from 'viem/account-abstraction';
|
|
5
|
+
import { SMART_ACCOUNT } from '../../utils/constants.js';
|
|
6
|
+
|
|
7
|
+
class BiconomySmartAccount {
|
|
8
|
+
constructor(options) {
|
|
9
|
+
_defineProperty(this, "name", SMART_ACCOUNT.BICONOMY);
|
|
10
|
+
_defineProperty(this, "options", void 0);
|
|
11
|
+
this.options = options;
|
|
12
|
+
}
|
|
13
|
+
async getSmartAccount(params) {
|
|
14
|
+
var _this$options, _this$options2;
|
|
15
|
+
return toBiconomySmartAccount(_objectSpread(_objectSpread(_objectSpread({}, this.options || {}), {}, {
|
|
16
|
+
entryPoint: {
|
|
17
|
+
address: ((_this$options = this.options) === null || _this$options === void 0 || (_this$options = _this$options.entryPoint) === null || _this$options === void 0 ? void 0 : _this$options.address) || entryPoint06Address,
|
|
18
|
+
version: ((_this$options2 = this.options) === null || _this$options2 === void 0 || (_this$options2 = _this$options2.entryPoint) === null || _this$options2 === void 0 ? void 0 : _this$options2.version) || "0.6"
|
|
19
|
+
}
|
|
20
|
+
}, params), {}, {
|
|
21
|
+
owners: [params.owner],
|
|
22
|
+
client: params.client
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { BiconomySmartAccount };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import { toEcdsaKernelSmartAccount } from 'permissionless/accounts';
|
|
4
|
+
import { SMART_ACCOUNT } from '../../utils/constants.js';
|
|
5
|
+
|
|
6
|
+
// use type of function so we don't need to pass in generic to parameter type
|
|
7
|
+
|
|
8
|
+
class KernelSmartAccount {
|
|
9
|
+
constructor(options) {
|
|
10
|
+
_defineProperty(this, "name", SMART_ACCOUNT.KERNEL);
|
|
11
|
+
_defineProperty(this, "options", void 0);
|
|
12
|
+
this.options = options;
|
|
13
|
+
}
|
|
14
|
+
async getSmartAccount(params) {
|
|
15
|
+
return toEcdsaKernelSmartAccount(_objectSpread(_objectSpread(_objectSpread({}, this.options || {}), params), {}, {
|
|
16
|
+
owners: [params.owner],
|
|
17
|
+
client: params.client
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { KernelSmartAccount };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import { toNexusSmartAccount } from 'permissionless/accounts';
|
|
4
|
+
import { entryPoint07Address } from 'viem/account-abstraction';
|
|
5
|
+
import { SMART_ACCOUNT } from '../../utils/constants.js';
|
|
6
|
+
|
|
7
|
+
class NexusSmartAccount {
|
|
8
|
+
constructor(options) {
|
|
9
|
+
_defineProperty(this, "name", SMART_ACCOUNT.NEXUS);
|
|
10
|
+
_defineProperty(this, "options", void 0);
|
|
11
|
+
this.options = options;
|
|
12
|
+
}
|
|
13
|
+
async getSmartAccount(params) {
|
|
14
|
+
var _this$options, _this$options2, _this$options3;
|
|
15
|
+
return toNexusSmartAccount(_objectSpread(_objectSpread(_objectSpread({}, this.options || {}), {}, {
|
|
16
|
+
entryPoint: {
|
|
17
|
+
address: ((_this$options = this.options) === null || _this$options === void 0 || (_this$options = _this$options.entryPoint) === null || _this$options === void 0 ? void 0 : _this$options.address) || entryPoint07Address,
|
|
18
|
+
version: ((_this$options2 = this.options) === null || _this$options2 === void 0 || (_this$options2 = _this$options2.entryPoint) === null || _this$options2 === void 0 ? void 0 : _this$options2.version) || "0.7"
|
|
19
|
+
},
|
|
20
|
+
version: ((_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.version) || "1.0.0"
|
|
21
|
+
}, params), {}, {
|
|
22
|
+
owners: [params.owner],
|
|
23
|
+
client: params.client
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { NexusSmartAccount };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import { toSafeSmartAccount } from 'permissionless/accounts';
|
|
4
|
+
import { entryPoint07Address } from 'viem/account-abstraction';
|
|
5
|
+
import { SMART_ACCOUNT } from '../../utils/constants.js';
|
|
6
|
+
|
|
7
|
+
// use type of function so we don't need to pass in generic to parameter type
|
|
8
|
+
|
|
9
|
+
class SafeSmartAccount {
|
|
10
|
+
constructor(options) {
|
|
11
|
+
_defineProperty(this, "name", SMART_ACCOUNT.SAFE);
|
|
12
|
+
_defineProperty(this, "options", void 0);
|
|
13
|
+
this.options = options;
|
|
14
|
+
}
|
|
15
|
+
async getSmartAccount(params) {
|
|
16
|
+
var _this$options, _this$options2, _this$options3;
|
|
17
|
+
return toSafeSmartAccount(_objectSpread(_objectSpread(_objectSpread({}, this.options || {}), {}, {
|
|
18
|
+
entryPoint: {
|
|
19
|
+
address: ((_this$options = this.options) === null || _this$options === void 0 || (_this$options = _this$options.entryPoint) === null || _this$options === void 0 ? void 0 : _this$options.address) || entryPoint07Address,
|
|
20
|
+
version: ((_this$options2 = this.options) === null || _this$options2 === void 0 || (_this$options2 = _this$options2.entryPoint) === null || _this$options2 === void 0 ? void 0 : _this$options2.version) || "0.7"
|
|
21
|
+
},
|
|
22
|
+
version: ((_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.version) || "1.4.1"
|
|
23
|
+
}, params), {}, {
|
|
24
|
+
owners: [params.owner],
|
|
25
|
+
client: params.client
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { SafeSmartAccount };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
+
import { toTrustSmartAccount } from 'permissionless/accounts';
|
|
4
|
+
import { entryPoint06Address } from 'viem/account-abstraction';
|
|
5
|
+
import { SMART_ACCOUNT } from '../../utils/constants.js';
|
|
6
|
+
|
|
7
|
+
// use type of function so we don't need to pass in generic to parameter type
|
|
8
|
+
|
|
9
|
+
class TrustSmartAccount {
|
|
10
|
+
constructor(options) {
|
|
11
|
+
_defineProperty(this, "name", SMART_ACCOUNT.TRUST);
|
|
12
|
+
_defineProperty(this, "options", void 0);
|
|
13
|
+
this.options = options;
|
|
14
|
+
}
|
|
15
|
+
async getSmartAccount(params) {
|
|
16
|
+
var _this$options, _this$options2;
|
|
17
|
+
return toTrustSmartAccount(_objectSpread(_objectSpread(_objectSpread({}, this.options || {}), {}, {
|
|
18
|
+
entryPoint: {
|
|
19
|
+
address: ((_this$options = this.options) === null || _this$options === void 0 || (_this$options = _this$options.entryPoint) === null || _this$options === void 0 ? void 0 : _this$options.address) || entryPoint06Address,
|
|
20
|
+
version: ((_this$options2 = this.options) === null || _this$options2 === void 0 || (_this$options2 = _this$options2.entryPoint) === null || _this$options2 === void 0 ? void 0 : _this$options2.version) || "0.6"
|
|
21
|
+
}
|
|
22
|
+
}, params), {}, {
|
|
23
|
+
owner: params.owner,
|
|
24
|
+
client: params.client
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { TrustSmartAccount };
|