@toruslabs/ethereum-controllers 5.11.0 → 6.0.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/dist/ethereumControllers.cjs.js +80 -431
- package/dist/ethereumControllers.esm.js +30 -349
- package/dist/ethereumControllers.umd.min.js +1 -1
- package/dist/ethereumControllers.umd.min.js.LICENSE.txt +7 -2
- package/dist/lib.cjs/Account/AccountTrackerController.js +160 -0
- package/dist/lib.cjs/Block/PollingBlockTracker.js +85 -0
- package/dist/lib.cjs/Currency/CurrencyController.js +111 -0
- package/dist/lib.cjs/Gas/GasFeeController.js +214 -0
- package/dist/lib.cjs/Gas/gasUtil.js +148 -0
- package/dist/lib.cjs/Keyring/KeyringController.js +93 -0
- package/dist/lib.cjs/Message/AbstractMessageController.js +107 -0
- package/dist/lib.cjs/Message/AddChainController.js +78 -0
- package/dist/lib.cjs/Message/MessageController.js +77 -0
- package/dist/lib.cjs/Message/PersonalMessageController.js +77 -0
- package/dist/lib.cjs/Message/SwitchChainController.js +78 -0
- package/dist/lib.cjs/Message/TypedMessageController.js +81 -0
- package/dist/lib.cjs/Message/utils.js +112 -0
- package/dist/lib.cjs/Network/NetworkController.js +201 -0
- package/dist/lib.cjs/Network/cacheIdentifier.js +112 -0
- package/dist/lib.cjs/Network/createEthereumMiddleware.js +302 -0
- package/dist/lib.cjs/Network/createJsonRpcClient.js +64 -0
- package/dist/lib.cjs/Nfts/NftHandler.js +180 -0
- package/dist/lib.cjs/Nfts/NftsController.js +213 -0
- package/dist/lib.cjs/Preferences/PreferencesController.js +476 -0
- package/dist/lib.cjs/Tokens/TokenHandler.js +51 -0
- package/dist/lib.cjs/Tokens/TokenRatesController.js +112 -0
- package/dist/lib.cjs/Tokens/TokensController.js +259 -0
- package/dist/lib.cjs/Transaction/NonceTracker.js +150 -0
- package/dist/lib.cjs/Transaction/PendingTransactionTracker.js +222 -0
- package/dist/lib.cjs/Transaction/TransactionController.js +515 -0
- package/dist/lib.cjs/Transaction/TransactionGasUtil.js +81 -0
- package/dist/lib.cjs/Transaction/TransactionStateHistoryHelper.js +42 -0
- package/dist/lib.cjs/Transaction/TransactionStateManager.js +296 -0
- package/dist/lib.cjs/Transaction/TransactionUtils.js +341 -0
- package/dist/lib.cjs/index.js +171 -0
- package/dist/lib.cjs/utils/abis.js +510 -0
- package/dist/lib.cjs/utils/constants.js +362 -0
- package/dist/lib.cjs/utils/contractAddresses.js +16 -0
- package/dist/lib.cjs/utils/conversionUtils.js +232 -0
- package/dist/lib.cjs/utils/helpers.js +244 -0
- package/dist/lib.cjs/utils/lodashUtils.js +25 -0
- package/dist/lib.esm/Account/AccountTrackerController.js +158 -0
- package/dist/lib.esm/Block/PollingBlockTracker.js +83 -0
- package/dist/lib.esm/Currency/CurrencyController.js +109 -0
- package/dist/lib.esm/Gas/GasFeeController.js +212 -0
- package/dist/lib.esm/Gas/gasUtil.js +141 -0
- package/dist/lib.esm/Keyring/KeyringController.js +91 -0
- package/dist/lib.esm/Message/AbstractMessageController.js +105 -0
- package/dist/lib.esm/Message/AddChainController.js +76 -0
- package/dist/lib.esm/Message/MessageController.js +75 -0
- package/dist/lib.esm/Message/PersonalMessageController.js +75 -0
- package/dist/lib.esm/Message/SwitchChainController.js +76 -0
- package/dist/lib.esm/Message/TypedMessageController.js +79 -0
- package/dist/lib.esm/Message/utils.js +105 -0
- package/dist/lib.esm/Network/NetworkController.js +199 -0
- package/dist/lib.esm/Network/cacheIdentifier.js +107 -0
- package/dist/lib.esm/Network/createEthereumMiddleware.js +289 -0
- package/dist/lib.esm/Network/createJsonRpcClient.js +60 -0
- package/dist/lib.esm/Nfts/NftHandler.js +178 -0
- package/dist/lib.esm/Nfts/NftsController.js +211 -0
- package/dist/lib.esm/Preferences/PreferencesController.js +474 -0
- package/dist/lib.esm/Tokens/TokenHandler.js +49 -0
- package/dist/lib.esm/Tokens/TokenRatesController.js +109 -0
- package/dist/lib.esm/Tokens/TokensController.js +257 -0
- package/dist/lib.esm/Transaction/NonceTracker.js +148 -0
- package/dist/lib.esm/Transaction/PendingTransactionTracker.js +220 -0
- package/dist/lib.esm/Transaction/TransactionController.js +513 -0
- package/dist/lib.esm/Transaction/TransactionGasUtil.js +79 -0
- package/dist/lib.esm/Transaction/TransactionStateHistoryHelper.js +38 -0
- package/dist/lib.esm/Transaction/TransactionStateManager.js +294 -0
- package/dist/lib.esm/Transaction/TransactionUtils.js +326 -0
- package/dist/lib.esm/index.js +33 -0
- package/dist/lib.esm/utils/abis.js +505 -0
- package/dist/lib.esm/utils/constants.js +323 -0
- package/dist/lib.esm/utils/contractAddresses.js +14 -0
- package/dist/lib.esm/utils/conversionUtils.js +218 -0
- package/dist/lib.esm/utils/helpers.js +227 -0
- package/dist/lib.esm/utils/lodashUtils.js +21 -0
- package/dist/types/Account/AccountTrackerController.d.ts +5 -5
- package/dist/types/Block/PollingBlockTracker.d.ts +1 -2
- package/dist/types/Currency/CurrencyController.d.ts +1 -1
- package/dist/types/Gas/GasFeeController.d.ts +3 -3
- package/dist/types/Gas/gasUtil.d.ts +1 -1
- package/dist/types/Keyring/KeyringController.d.ts +3 -5
- package/dist/types/Message/AbstractMessageController.d.ts +5 -6
- package/dist/types/Message/AddChainController.d.ts +4 -4
- package/dist/types/Message/MessageController.d.ts +4 -4
- package/dist/types/Message/PersonalMessageController.d.ts +4 -4
- package/dist/types/Message/SwitchChainController.d.ts +4 -4
- package/dist/types/Message/TypedMessageController.d.ts +6 -7
- package/dist/types/Message/utils.d.ts +2 -7
- package/dist/types/Network/NetworkController.d.ts +4 -4
- package/dist/types/Network/cacheIdentifier.d.ts +1 -1
- package/dist/types/Network/createEthereumMiddleware.d.ts +2 -18
- package/dist/types/Network/createJsonRpcClient.d.ts +2 -2
- package/dist/types/Nfts/NftsController.d.ts +2 -2
- package/dist/types/Preferences/PreferencesController.d.ts +4 -4
- package/dist/types/Tokens/TokensController.d.ts +3 -3
- package/dist/types/Transaction/NonceTracker.d.ts +5 -5
- package/dist/types/Transaction/PendingTransactionTracker.d.ts +5 -5
- package/dist/types/Transaction/TransactionController.d.ts +12 -12
- package/dist/types/Transaction/TransactionGasUtil.d.ts +4 -4
- package/dist/types/Transaction/TransactionStateManager.d.ts +3 -3
- package/dist/types/Transaction/TransactionUtils.d.ts +1 -1
- package/dist/types/index.d.ts +12 -14
- package/dist/types/utils/constants.d.ts +1 -5
- package/dist/types/utils/helpers.d.ts +4 -4
- package/dist/types/utils/interfaces.d.ts +43 -23
- package/package.json +7 -7
- package/dist/types/Message/DecryptMessageController.d.ts +0 -20
- package/dist/types/Message/EncryptionPublicKeyController.d.ts +0 -20
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var AccountTrackerController = require('./Account/AccountTrackerController.js');
|
|
4
|
+
var PollingBlockTracker = require('./Block/PollingBlockTracker.js');
|
|
5
|
+
var CurrencyController = require('./Currency/CurrencyController.js');
|
|
6
|
+
var GasFeeController = require('./Gas/GasFeeController.js');
|
|
7
|
+
var KeyringController = require('./Keyring/KeyringController.js');
|
|
8
|
+
var AbstractMessageController = require('./Message/AbstractMessageController.js');
|
|
9
|
+
var AddChainController = require('./Message/AddChainController.js');
|
|
10
|
+
var MessageController = require('./Message/MessageController.js');
|
|
11
|
+
var PersonalMessageController = require('./Message/PersonalMessageController.js');
|
|
12
|
+
var SwitchChainController = require('./Message/SwitchChainController.js');
|
|
13
|
+
var TypedMessageController = require('./Message/TypedMessageController.js');
|
|
14
|
+
var utils = require('./Message/utils.js');
|
|
15
|
+
var createEthereumMiddleware = require('./Network/createEthereumMiddleware.js');
|
|
16
|
+
var createJsonRpcClient = require('./Network/createJsonRpcClient.js');
|
|
17
|
+
var NetworkController = require('./Network/NetworkController.js');
|
|
18
|
+
var NftHandler = require('./Nfts/NftHandler.js');
|
|
19
|
+
var NftsController = require('./Nfts/NftsController.js');
|
|
20
|
+
var PreferencesController = require('./Preferences/PreferencesController.js');
|
|
21
|
+
var TokenHandler = require('./Tokens/TokenHandler.js');
|
|
22
|
+
var TokenRatesController = require('./Tokens/TokenRatesController.js');
|
|
23
|
+
var TokensController = require('./Tokens/TokensController.js');
|
|
24
|
+
var NonceTracker = require('./Transaction/NonceTracker.js');
|
|
25
|
+
var PendingTransactionTracker = require('./Transaction/PendingTransactionTracker.js');
|
|
26
|
+
var TransactionController = require('./Transaction/TransactionController.js');
|
|
27
|
+
var TransactionGasUtil = require('./Transaction/TransactionGasUtil.js');
|
|
28
|
+
var TransactionStateHistoryHelper = require('./Transaction/TransactionStateHistoryHelper.js');
|
|
29
|
+
var TransactionStateManager = require('./Transaction/TransactionStateManager.js');
|
|
30
|
+
var TransactionUtils = require('./Transaction/TransactionUtils.js');
|
|
31
|
+
var abis = require('./utils/abis.js');
|
|
32
|
+
var constants = require('./utils/constants.js');
|
|
33
|
+
var conversionUtils = require('./utils/conversionUtils.js');
|
|
34
|
+
var helpers = require('./utils/helpers.js');
|
|
35
|
+
require('@toruslabs/base-controllers');
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
exports.AccountTrackerController = AccountTrackerController.AccountTrackerController;
|
|
40
|
+
exports.PollingBlockTracker = PollingBlockTracker.PollingBlockTracker;
|
|
41
|
+
exports.CurrencyController = CurrencyController.CurrencyController;
|
|
42
|
+
exports.GasFeeController = GasFeeController.GasFeeController;
|
|
43
|
+
exports.KeyringController = KeyringController.KeyringController;
|
|
44
|
+
exports.AbstractMessageController = AbstractMessageController.AbstractMessageController;
|
|
45
|
+
exports.AddChainController = AddChainController.AddChainController;
|
|
46
|
+
exports.MessageController = MessageController.MessageController;
|
|
47
|
+
exports.PersonalMessageController = PersonalMessageController.PersonalMessageController;
|
|
48
|
+
exports.SwitchChainController = SwitchChainController.SwitchChainController;
|
|
49
|
+
exports.TypedMessageController = TypedMessageController.TypedMessageController;
|
|
50
|
+
exports.normalizeMessageData = utils.normalizeMessageData;
|
|
51
|
+
exports.validateAddChainData = utils.validateAddChainData;
|
|
52
|
+
exports.validateAddress = utils.validateAddress;
|
|
53
|
+
exports.validateSignMessageData = utils.validateSignMessageData;
|
|
54
|
+
exports.validateSwitchChainData = utils.validateSwitchChainData;
|
|
55
|
+
exports.validateTypedSignMessageDataV4 = utils.validateTypedSignMessageDataV4;
|
|
56
|
+
exports.createEthereumMiddleware = createEthereumMiddleware.createEthereumMiddleware;
|
|
57
|
+
exports.createGetAccountsMiddleware = createEthereumMiddleware.createGetAccountsMiddleware;
|
|
58
|
+
exports.createPendingNonceMiddleware = createEthereumMiddleware.createPendingNonceMiddleware;
|
|
59
|
+
exports.createPendingTxMiddleware = createEthereumMiddleware.createPendingTxMiddleware;
|
|
60
|
+
exports.createProcessAddEthereumChain = createEthereumMiddleware.createProcessAddEthereumChain;
|
|
61
|
+
exports.createProcessEthSignMessage = createEthereumMiddleware.createProcessEthSignMessage;
|
|
62
|
+
exports.createProcessPersonalMessage = createEthereumMiddleware.createProcessPersonalMessage;
|
|
63
|
+
exports.createProcessSwitchEthereumChain = createEthereumMiddleware.createProcessSwitchEthereumChain;
|
|
64
|
+
exports.createProcessTransactionMiddleware = createEthereumMiddleware.createProcessTransactionMiddleware;
|
|
65
|
+
exports.createProcessTypedMessageV4 = createEthereumMiddleware.createProcessTypedMessageV4;
|
|
66
|
+
exports.createRequestAccountsMiddleware = createEthereumMiddleware.createRequestAccountsMiddleware;
|
|
67
|
+
exports.formatTxMetaForRpcResult = createEthereumMiddleware.formatTxMetaForRpcResult;
|
|
68
|
+
exports.createChainIdMiddleware = createJsonRpcClient.createChainIdMiddleware;
|
|
69
|
+
exports.createJsonRpcClient = createJsonRpcClient.createJsonRpcClient;
|
|
70
|
+
exports.createProviderConfigMiddleware = createJsonRpcClient.createProviderConfigMiddleware;
|
|
71
|
+
exports.NetworkController = NetworkController.NetworkController;
|
|
72
|
+
exports.NftHandler = NftHandler.NftHandler;
|
|
73
|
+
exports.NftsController = NftsController.NftsController;
|
|
74
|
+
exports.PreferencesController = PreferencesController.PreferencesController;
|
|
75
|
+
exports.TokenHandler = TokenHandler.TokenHandler;
|
|
76
|
+
exports.DEFAULT_CURRENCY = TokenRatesController.DEFAULT_CURRENCY;
|
|
77
|
+
exports.TokenRatesController = TokenRatesController.TokenRatesController;
|
|
78
|
+
exports.TokensController = TokensController.TokensController;
|
|
79
|
+
exports.NonceTracker = NonceTracker.NonceTracker;
|
|
80
|
+
exports.PendingTransactionTracker = PendingTransactionTracker.PendingTransactionTracker;
|
|
81
|
+
exports.TransactionController = TransactionController.TransactionController;
|
|
82
|
+
exports.TransactionGasUtil = TransactionGasUtil.TransactionGasUtil;
|
|
83
|
+
exports.generateHistoryEntry = TransactionStateHistoryHelper.generateHistoryEntry;
|
|
84
|
+
exports.replayHistory = TransactionStateHistoryHelper.replayHistory;
|
|
85
|
+
exports.snapshotFromTxMeta = TransactionStateHistoryHelper.snapshotFromTxMeta;
|
|
86
|
+
exports.TransactionStateManager = TransactionStateManager.TransactionStateManager;
|
|
87
|
+
exports.determineTransactionType = TransactionUtils.determineTransactionType;
|
|
88
|
+
exports.ensureFieldIsString = TransactionUtils.ensureFieldIsString;
|
|
89
|
+
exports.ensureMutuallyExclusiveFieldsNotProvided = TransactionUtils.ensureMutuallyExclusiveFieldsNotProvided;
|
|
90
|
+
exports.getFinalStates = TransactionUtils.getFinalStates;
|
|
91
|
+
exports.isEIP1559Transaction = TransactionUtils.isEIP1559Transaction;
|
|
92
|
+
exports.isLegacyTransaction = TransactionUtils.isLegacyTransaction;
|
|
93
|
+
exports.normalizeAndValidateTxParams = TransactionUtils.normalizeAndValidateTxParams;
|
|
94
|
+
exports.normalizeTxParameters = TransactionUtils.normalizeTxParameters;
|
|
95
|
+
exports.parseStandardTokenTransactionData = TransactionUtils.parseStandardTokenTransactionData;
|
|
96
|
+
exports.readAddressAsContract = TransactionUtils.readAddressAsContract;
|
|
97
|
+
exports.transactionMatchesNetwork = TransactionUtils.transactionMatchesNetwork;
|
|
98
|
+
exports.validateFrom = TransactionUtils.validateFrom;
|
|
99
|
+
exports.validateRecipient = TransactionUtils.validateRecipient;
|
|
100
|
+
exports.validateTxParameters = TransactionUtils.validateTxParameters;
|
|
101
|
+
exports.erc1155Abi = abis.erc1155Abi;
|
|
102
|
+
exports.erc20Abi = abis.erc20Abi;
|
|
103
|
+
exports.erc721Abi = abis.erc721Abi;
|
|
104
|
+
exports.singleBalanceCheckerAbi = abis.singleBalanceCheckerAbi;
|
|
105
|
+
exports.ARBITRUM_MAINNET_CHAIN_ID = constants.ARBITRUM_MAINNET_CHAIN_ID;
|
|
106
|
+
exports.ARBITRUM_TESTNET_CHAIN_ID = constants.ARBITRUM_TESTNET_CHAIN_ID;
|
|
107
|
+
exports.AVALANCHE_MAINNET_CHAIN_ID = constants.AVALANCHE_MAINNET_CHAIN_ID;
|
|
108
|
+
exports.AVALANCHE_TESTNET_CHAIN_ID = constants.AVALANCHE_TESTNET_CHAIN_ID;
|
|
109
|
+
exports.BASE_CHAIN_ID = constants.BASE_CHAIN_ID;
|
|
110
|
+
exports.BASE_TESTNET_CHAIN_ID = constants.BASE_TESTNET_CHAIN_ID;
|
|
111
|
+
exports.BSC_MAINNET_CHAIN_ID = constants.BSC_MAINNET_CHAIN_ID;
|
|
112
|
+
exports.BSC_TESTNET_CHAIN_ID = constants.BSC_TESTNET_CHAIN_ID;
|
|
113
|
+
exports.CELO_MAINNET_CHAIN_ID = constants.CELO_MAINNET_CHAIN_ID;
|
|
114
|
+
exports.CHAIN_ID_TO_GAS_LIMIT_BUFFER_MAP = constants.CHAIN_ID_TO_GAS_LIMIT_BUFFER_MAP;
|
|
115
|
+
exports.COINGECKO_PLATFORMS_CHAIN_CODE_MAP = constants.COINGECKO_PLATFORMS_CHAIN_CODE_MAP;
|
|
116
|
+
exports.COINGECKO_SUPPORTED_CURRENCIES = constants.COINGECKO_SUPPORTED_CURRENCIES;
|
|
117
|
+
exports.CONTRACT_TYPE_ERC1155 = constants.CONTRACT_TYPE_ERC1155;
|
|
118
|
+
exports.CONTRACT_TYPE_ERC20 = constants.CONTRACT_TYPE_ERC20;
|
|
119
|
+
exports.CONTRACT_TYPE_ERC721 = constants.CONTRACT_TYPE_ERC721;
|
|
120
|
+
exports.CONTRACT_TYPE_ETH = constants.CONTRACT_TYPE_ETH;
|
|
121
|
+
exports.ERC1155_INTERFACE_ID = constants.ERC1155_INTERFACE_ID;
|
|
122
|
+
exports.ERC721_ENUMERABLE_INTERFACE_ID = constants.ERC721_ENUMERABLE_INTERFACE_ID;
|
|
123
|
+
exports.ERC721_INTERFACE_ID = constants.ERC721_INTERFACE_ID;
|
|
124
|
+
exports.ERC721_METADATA_INTERFACE_ID = constants.ERC721_METADATA_INTERFACE_ID;
|
|
125
|
+
exports.ETHERSCAN_SUPPORTED_CHAINS = constants.ETHERSCAN_SUPPORTED_CHAINS;
|
|
126
|
+
exports.GAS_ESTIMATE_TYPES = constants.GAS_ESTIMATE_TYPES;
|
|
127
|
+
exports.LOCALHOST = constants.LOCALHOST;
|
|
128
|
+
exports.MAINNET_CHAIN_ID = constants.MAINNET_CHAIN_ID;
|
|
129
|
+
exports.MESSAGE_EVENTS = constants.MESSAGE_EVENTS;
|
|
130
|
+
exports.METHOD_TYPES = constants.METHOD_TYPES;
|
|
131
|
+
exports.MessageStatus = constants.MessageStatus;
|
|
132
|
+
exports.OLD_ERC721_LIST = constants.OLD_ERC721_LIST;
|
|
133
|
+
exports.OPTIMISM_MAINNET_CHAIN_ID = constants.OPTIMISM_MAINNET_CHAIN_ID;
|
|
134
|
+
exports.OPTIMISM_TESTNET_CHAIN_ID = constants.OPTIMISM_TESTNET_CHAIN_ID;
|
|
135
|
+
exports.POLYGON_AMOY_CHAIN_ID = constants.POLYGON_AMOY_CHAIN_ID;
|
|
136
|
+
exports.POLYGON_CHAIN_ID = constants.POLYGON_CHAIN_ID;
|
|
137
|
+
exports.SEPOLIA_CHAIN_ID = constants.SEPOLIA_CHAIN_ID;
|
|
138
|
+
exports.SIMPLEHASH_SUPPORTED_CHAINS = constants.SIMPLEHASH_SUPPORTED_CHAINS;
|
|
139
|
+
exports.SUPPORTED_NETWORKS = constants.SUPPORTED_NETWORKS;
|
|
140
|
+
exports.TEST_CHAINS = constants.TEST_CHAINS;
|
|
141
|
+
exports.TRANSACTION_ENVELOPE_TYPES = constants.TRANSACTION_ENVELOPE_TYPES;
|
|
142
|
+
exports.XDAI_CHAIN_ID = constants.XDAI_CHAIN_ID;
|
|
143
|
+
exports.addCurrencies = conversionUtils.addCurrencies;
|
|
144
|
+
exports.conversionGTE = conversionUtils.conversionGTE;
|
|
145
|
+
exports.conversionGreaterThan = conversionUtils.conversionGreaterThan;
|
|
146
|
+
exports.conversionLTE = conversionUtils.conversionLTE;
|
|
147
|
+
exports.conversionLessThan = conversionUtils.conversionLessThan;
|
|
148
|
+
exports.conversionMax = conversionUtils.conversionMax;
|
|
149
|
+
exports.conversionUtil = conversionUtils.conversionUtil;
|
|
150
|
+
exports.decGWEIToHexWEI = conversionUtils.decGWEIToHexWEI;
|
|
151
|
+
exports.getBigNumber = conversionUtils.getBigNumber;
|
|
152
|
+
exports.hexWEIToDecGWEI = conversionUtils.hexWEIToDecGWEI;
|
|
153
|
+
exports.multiplyCurrencies = conversionUtils.multiplyCurrencies;
|
|
154
|
+
exports.subtractCurrencies = conversionUtils.subtractCurrencies;
|
|
155
|
+
exports.toNegative = conversionUtils.toNegative;
|
|
156
|
+
exports.BNToHex = helpers.BNToHex;
|
|
157
|
+
exports.GAS_LIMITS = helpers.GAS_LIMITS;
|
|
158
|
+
exports.addEtherscanTransactions = helpers.addEtherscanTransactions;
|
|
159
|
+
exports.bnLessThan = helpers.bnLessThan;
|
|
160
|
+
exports.formatDate = helpers.formatDate;
|
|
161
|
+
exports.formatPastTx = helpers.formatPastTx;
|
|
162
|
+
exports.formatTime = helpers.formatTime;
|
|
163
|
+
exports.getChainType = helpers.getChainType;
|
|
164
|
+
exports.getEthTxStatus = helpers.getEthTxStatus;
|
|
165
|
+
exports.getEtherScanHashLink = helpers.getEtherScanHashLink;
|
|
166
|
+
exports.getIpfsEndpoint = helpers.getIpfsEndpoint;
|
|
167
|
+
exports.hexToBn = helpers.hexToBn;
|
|
168
|
+
exports.idleTimeTracker = helpers.idleTimeTracker;
|
|
169
|
+
exports.isAddressByChainId = helpers.isAddressByChainId;
|
|
170
|
+
exports.sanitizeNftMetdataUrl = helpers.sanitizeNftMetdataUrl;
|
|
171
|
+
exports.toChecksumAddressByChainId = helpers.toChecksumAddressByChainId;
|
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const erc20Abi = [{
|
|
4
|
+
constant: true,
|
|
5
|
+
inputs: [],
|
|
6
|
+
name: "name",
|
|
7
|
+
outputs: [{
|
|
8
|
+
name: "",
|
|
9
|
+
type: "string"
|
|
10
|
+
}],
|
|
11
|
+
payable: false,
|
|
12
|
+
type: "function"
|
|
13
|
+
}, {
|
|
14
|
+
constant: false,
|
|
15
|
+
inputs: [{
|
|
16
|
+
name: "_spender",
|
|
17
|
+
type: "address"
|
|
18
|
+
}, {
|
|
19
|
+
name: "_value",
|
|
20
|
+
type: "uint256"
|
|
21
|
+
}],
|
|
22
|
+
name: "approve",
|
|
23
|
+
outputs: [{
|
|
24
|
+
name: "success",
|
|
25
|
+
type: "bool"
|
|
26
|
+
}],
|
|
27
|
+
payable: false,
|
|
28
|
+
type: "function"
|
|
29
|
+
}, {
|
|
30
|
+
constant: true,
|
|
31
|
+
inputs: [],
|
|
32
|
+
name: "totalSupply",
|
|
33
|
+
outputs: [{
|
|
34
|
+
name: "",
|
|
35
|
+
type: "uint256"
|
|
36
|
+
}],
|
|
37
|
+
payable: false,
|
|
38
|
+
type: "function"
|
|
39
|
+
}, {
|
|
40
|
+
constant: false,
|
|
41
|
+
inputs: [{
|
|
42
|
+
name: "_from",
|
|
43
|
+
type: "address"
|
|
44
|
+
}, {
|
|
45
|
+
name: "_to",
|
|
46
|
+
type: "address"
|
|
47
|
+
}, {
|
|
48
|
+
name: "_value",
|
|
49
|
+
type: "uint256"
|
|
50
|
+
}],
|
|
51
|
+
name: "transferFrom",
|
|
52
|
+
outputs: [{
|
|
53
|
+
name: "success",
|
|
54
|
+
type: "bool"
|
|
55
|
+
}],
|
|
56
|
+
payable: false,
|
|
57
|
+
type: "function"
|
|
58
|
+
}, {
|
|
59
|
+
constant: true,
|
|
60
|
+
inputs: [],
|
|
61
|
+
name: "decimals",
|
|
62
|
+
outputs: [{
|
|
63
|
+
name: "",
|
|
64
|
+
type: "uint256"
|
|
65
|
+
}],
|
|
66
|
+
payable: false,
|
|
67
|
+
type: "function"
|
|
68
|
+
}, {
|
|
69
|
+
constant: true,
|
|
70
|
+
inputs: [{
|
|
71
|
+
name: "_owner",
|
|
72
|
+
type: "address"
|
|
73
|
+
}],
|
|
74
|
+
name: "balanceOf",
|
|
75
|
+
outputs: [{
|
|
76
|
+
name: "balance",
|
|
77
|
+
type: "uint256"
|
|
78
|
+
}],
|
|
79
|
+
payable: false,
|
|
80
|
+
type: "function"
|
|
81
|
+
}, {
|
|
82
|
+
constant: true,
|
|
83
|
+
inputs: [],
|
|
84
|
+
name: "symbol",
|
|
85
|
+
outputs: [{
|
|
86
|
+
name: "",
|
|
87
|
+
type: "string"
|
|
88
|
+
}],
|
|
89
|
+
payable: false,
|
|
90
|
+
type: "function"
|
|
91
|
+
}, {
|
|
92
|
+
constant: false,
|
|
93
|
+
inputs: [{
|
|
94
|
+
name: "_to",
|
|
95
|
+
type: "address"
|
|
96
|
+
}, {
|
|
97
|
+
name: "_value",
|
|
98
|
+
type: "uint256"
|
|
99
|
+
}],
|
|
100
|
+
name: "transfer",
|
|
101
|
+
outputs: [{
|
|
102
|
+
name: "success",
|
|
103
|
+
type: "bool"
|
|
104
|
+
}],
|
|
105
|
+
payable: false,
|
|
106
|
+
type: "function"
|
|
107
|
+
}, {
|
|
108
|
+
constant: false,
|
|
109
|
+
inputs: [{
|
|
110
|
+
name: "_spender",
|
|
111
|
+
type: "address"
|
|
112
|
+
}, {
|
|
113
|
+
name: "_value",
|
|
114
|
+
type: "uint256"
|
|
115
|
+
}, {
|
|
116
|
+
name: "_extraData",
|
|
117
|
+
type: "bytes"
|
|
118
|
+
}],
|
|
119
|
+
name: "approveAndCall",
|
|
120
|
+
outputs: [{
|
|
121
|
+
name: "success",
|
|
122
|
+
type: "bool"
|
|
123
|
+
}],
|
|
124
|
+
payable: false,
|
|
125
|
+
type: "function"
|
|
126
|
+
}, {
|
|
127
|
+
constant: true,
|
|
128
|
+
inputs: [{
|
|
129
|
+
name: "_owner",
|
|
130
|
+
type: "address"
|
|
131
|
+
}, {
|
|
132
|
+
name: "_spender",
|
|
133
|
+
type: "address"
|
|
134
|
+
}],
|
|
135
|
+
name: "allowance",
|
|
136
|
+
outputs: [{
|
|
137
|
+
name: "remaining",
|
|
138
|
+
type: "uint256"
|
|
139
|
+
}],
|
|
140
|
+
payable: false,
|
|
141
|
+
type: "function"
|
|
142
|
+
}, {
|
|
143
|
+
inputs: [{
|
|
144
|
+
name: "_initialAmount",
|
|
145
|
+
type: "uint256"
|
|
146
|
+
}, {
|
|
147
|
+
name: "_tokenName",
|
|
148
|
+
type: "string"
|
|
149
|
+
}, {
|
|
150
|
+
name: "_decimalUnits",
|
|
151
|
+
type: "uint8"
|
|
152
|
+
}, {
|
|
153
|
+
name: "_tokenSymbol",
|
|
154
|
+
type: "string"
|
|
155
|
+
}],
|
|
156
|
+
type: "constructor"
|
|
157
|
+
}, {
|
|
158
|
+
payable: false,
|
|
159
|
+
type: "fallback"
|
|
160
|
+
}];
|
|
161
|
+
const erc721Abi = [{
|
|
162
|
+
constant: true,
|
|
163
|
+
inputs: [{
|
|
164
|
+
name: "interfaceID",
|
|
165
|
+
type: "bytes4"
|
|
166
|
+
}],
|
|
167
|
+
name: "supportsInterface",
|
|
168
|
+
outputs: [{
|
|
169
|
+
name: "",
|
|
170
|
+
type: "bool"
|
|
171
|
+
}],
|
|
172
|
+
payable: false,
|
|
173
|
+
stateMutability: "view",
|
|
174
|
+
type: "function"
|
|
175
|
+
}, {
|
|
176
|
+
constant: true,
|
|
177
|
+
inputs: [],
|
|
178
|
+
name: "name",
|
|
179
|
+
outputs: [{
|
|
180
|
+
name: "_name",
|
|
181
|
+
type: "string"
|
|
182
|
+
}],
|
|
183
|
+
payable: false,
|
|
184
|
+
stateMutability: "view",
|
|
185
|
+
type: "function"
|
|
186
|
+
}, {
|
|
187
|
+
constant: true,
|
|
188
|
+
inputs: [{
|
|
189
|
+
name: "_tokenId",
|
|
190
|
+
type: "uint256"
|
|
191
|
+
}],
|
|
192
|
+
name: "getApproved",
|
|
193
|
+
outputs: [{
|
|
194
|
+
name: "",
|
|
195
|
+
type: "address"
|
|
196
|
+
}],
|
|
197
|
+
payable: false,
|
|
198
|
+
stateMutability: "view",
|
|
199
|
+
type: "function"
|
|
200
|
+
}, {
|
|
201
|
+
constant: false,
|
|
202
|
+
inputs: [{
|
|
203
|
+
name: "_approved",
|
|
204
|
+
type: "address"
|
|
205
|
+
}, {
|
|
206
|
+
name: "_tokenId",
|
|
207
|
+
type: "uint256"
|
|
208
|
+
}],
|
|
209
|
+
name: "approve",
|
|
210
|
+
outputs: [],
|
|
211
|
+
payable: true,
|
|
212
|
+
stateMutability: "payable",
|
|
213
|
+
type: "function"
|
|
214
|
+
}, {
|
|
215
|
+
constant: true,
|
|
216
|
+
inputs: [],
|
|
217
|
+
name: "totalSupply",
|
|
218
|
+
outputs: [{
|
|
219
|
+
name: "",
|
|
220
|
+
type: "uint256"
|
|
221
|
+
}],
|
|
222
|
+
payable: false,
|
|
223
|
+
stateMutability: "view",
|
|
224
|
+
type: "function"
|
|
225
|
+
}, {
|
|
226
|
+
constant: false,
|
|
227
|
+
inputs: [{
|
|
228
|
+
name: "_from",
|
|
229
|
+
type: "address"
|
|
230
|
+
}, {
|
|
231
|
+
name: "_to",
|
|
232
|
+
type: "address"
|
|
233
|
+
}, {
|
|
234
|
+
name: "_tokenId",
|
|
235
|
+
type: "uint256"
|
|
236
|
+
}],
|
|
237
|
+
name: "transferFrom",
|
|
238
|
+
outputs: [],
|
|
239
|
+
payable: true,
|
|
240
|
+
stateMutability: "payable",
|
|
241
|
+
type: "function"
|
|
242
|
+
}, {
|
|
243
|
+
constant: true,
|
|
244
|
+
inputs: [{
|
|
245
|
+
name: "_owner",
|
|
246
|
+
type: "address"
|
|
247
|
+
}, {
|
|
248
|
+
name: "_index",
|
|
249
|
+
type: "uint256"
|
|
250
|
+
}],
|
|
251
|
+
name: "tokenOfOwnerByIndex",
|
|
252
|
+
outputs: [{
|
|
253
|
+
name: "",
|
|
254
|
+
type: "uint256"
|
|
255
|
+
}],
|
|
256
|
+
payable: false,
|
|
257
|
+
stateMutability: "view",
|
|
258
|
+
type: "function"
|
|
259
|
+
}, {
|
|
260
|
+
constant: false,
|
|
261
|
+
inputs: [{
|
|
262
|
+
name: "_from",
|
|
263
|
+
type: "address"
|
|
264
|
+
}, {
|
|
265
|
+
name: "_to",
|
|
266
|
+
type: "address"
|
|
267
|
+
}, {
|
|
268
|
+
name: "_tokenId",
|
|
269
|
+
type: "uint256"
|
|
270
|
+
}],
|
|
271
|
+
name: "safeTransferFrom",
|
|
272
|
+
outputs: [],
|
|
273
|
+
payable: true,
|
|
274
|
+
stateMutability: "payable",
|
|
275
|
+
type: "function"
|
|
276
|
+
}, {
|
|
277
|
+
constant: true,
|
|
278
|
+
inputs: [{
|
|
279
|
+
name: "_index",
|
|
280
|
+
type: "uint256"
|
|
281
|
+
}],
|
|
282
|
+
name: "tokenByIndex",
|
|
283
|
+
outputs: [{
|
|
284
|
+
name: "",
|
|
285
|
+
type: "uint256"
|
|
286
|
+
}],
|
|
287
|
+
payable: false,
|
|
288
|
+
stateMutability: "view",
|
|
289
|
+
type: "function"
|
|
290
|
+
}, {
|
|
291
|
+
constant: true,
|
|
292
|
+
inputs: [{
|
|
293
|
+
name: "_tokenId",
|
|
294
|
+
type: "uint256"
|
|
295
|
+
}],
|
|
296
|
+
name: "ownerOf",
|
|
297
|
+
outputs: [{
|
|
298
|
+
name: "",
|
|
299
|
+
type: "address"
|
|
300
|
+
}],
|
|
301
|
+
payable: false,
|
|
302
|
+
stateMutability: "view",
|
|
303
|
+
type: "function"
|
|
304
|
+
}, {
|
|
305
|
+
constant: true,
|
|
306
|
+
inputs: [{
|
|
307
|
+
name: "_owner",
|
|
308
|
+
type: "address"
|
|
309
|
+
}],
|
|
310
|
+
name: "balanceOf",
|
|
311
|
+
outputs: [{
|
|
312
|
+
name: "",
|
|
313
|
+
type: "uint256"
|
|
314
|
+
}],
|
|
315
|
+
payable: false,
|
|
316
|
+
stateMutability: "view",
|
|
317
|
+
type: "function"
|
|
318
|
+
}, {
|
|
319
|
+
constant: true,
|
|
320
|
+
inputs: [],
|
|
321
|
+
name: "symbol",
|
|
322
|
+
outputs: [{
|
|
323
|
+
name: "_symbol",
|
|
324
|
+
type: "string"
|
|
325
|
+
}],
|
|
326
|
+
payable: false,
|
|
327
|
+
stateMutability: "view",
|
|
328
|
+
type: "function"
|
|
329
|
+
}, {
|
|
330
|
+
constant: true,
|
|
331
|
+
inputs: [{
|
|
332
|
+
name: "_tokenId",
|
|
333
|
+
type: "uint256"
|
|
334
|
+
}],
|
|
335
|
+
name: "tokenURI",
|
|
336
|
+
outputs: [{
|
|
337
|
+
name: "",
|
|
338
|
+
type: "string"
|
|
339
|
+
}],
|
|
340
|
+
payable: false,
|
|
341
|
+
stateMutability: "view",
|
|
342
|
+
type: "function"
|
|
343
|
+
}];
|
|
344
|
+
const erc1155Abi = [{
|
|
345
|
+
inputs: [{
|
|
346
|
+
internalType: "address",
|
|
347
|
+
name: "_owner",
|
|
348
|
+
type: "address"
|
|
349
|
+
}, {
|
|
350
|
+
internalType: "uint256",
|
|
351
|
+
name: "_id",
|
|
352
|
+
type: "uint256"
|
|
353
|
+
}],
|
|
354
|
+
name: "balanceOf",
|
|
355
|
+
outputs: [{
|
|
356
|
+
internalType: "uint256",
|
|
357
|
+
name: "",
|
|
358
|
+
type: "uint256"
|
|
359
|
+
}],
|
|
360
|
+
stateMutability: "view",
|
|
361
|
+
type: "function"
|
|
362
|
+
}, {
|
|
363
|
+
inputs: [{
|
|
364
|
+
internalType: "address[]",
|
|
365
|
+
name: "_owners",
|
|
366
|
+
type: "address[]"
|
|
367
|
+
}, {
|
|
368
|
+
internalType: "uint256[]",
|
|
369
|
+
name: "_ids",
|
|
370
|
+
type: "uint256[]"
|
|
371
|
+
}],
|
|
372
|
+
name: "balanceOfBatch",
|
|
373
|
+
outputs: [{
|
|
374
|
+
internalType: "uint256[]",
|
|
375
|
+
name: "",
|
|
376
|
+
type: "uint256[]"
|
|
377
|
+
}],
|
|
378
|
+
stateMutability: "view",
|
|
379
|
+
type: "function"
|
|
380
|
+
}, {
|
|
381
|
+
inputs: [{
|
|
382
|
+
internalType: "address",
|
|
383
|
+
name: "_owner",
|
|
384
|
+
type: "address"
|
|
385
|
+
}, {
|
|
386
|
+
internalType: "address",
|
|
387
|
+
name: "_operator",
|
|
388
|
+
type: "address"
|
|
389
|
+
}],
|
|
390
|
+
name: "isApprovedForAll",
|
|
391
|
+
outputs: [{
|
|
392
|
+
internalType: "bool",
|
|
393
|
+
name: "isOperator",
|
|
394
|
+
type: "bool"
|
|
395
|
+
}],
|
|
396
|
+
stateMutability: "view",
|
|
397
|
+
type: "function"
|
|
398
|
+
}, {
|
|
399
|
+
inputs: [{
|
|
400
|
+
internalType: "address",
|
|
401
|
+
name: "_from",
|
|
402
|
+
type: "address"
|
|
403
|
+
}, {
|
|
404
|
+
internalType: "address",
|
|
405
|
+
name: "_to",
|
|
406
|
+
type: "address"
|
|
407
|
+
}, {
|
|
408
|
+
internalType: "uint256",
|
|
409
|
+
name: "_id",
|
|
410
|
+
type: "uint256"
|
|
411
|
+
}, {
|
|
412
|
+
internalType: "uint256",
|
|
413
|
+
name: "_amount",
|
|
414
|
+
type: "uint256"
|
|
415
|
+
}, {
|
|
416
|
+
internalType: "bytes",
|
|
417
|
+
name: "_data",
|
|
418
|
+
type: "bytes"
|
|
419
|
+
}],
|
|
420
|
+
name: "safeTransferFrom",
|
|
421
|
+
outputs: [],
|
|
422
|
+
stateMutability: "nonpayable",
|
|
423
|
+
type: "function"
|
|
424
|
+
}, {
|
|
425
|
+
inputs: [{
|
|
426
|
+
internalType: "address",
|
|
427
|
+
name: "_operator",
|
|
428
|
+
type: "address"
|
|
429
|
+
}, {
|
|
430
|
+
internalType: "bool",
|
|
431
|
+
name: "_approved",
|
|
432
|
+
type: "bool"
|
|
433
|
+
}],
|
|
434
|
+
name: "setApprovalForAll",
|
|
435
|
+
outputs: [],
|
|
436
|
+
stateMutability: "nonpayable",
|
|
437
|
+
type: "function"
|
|
438
|
+
}, {
|
|
439
|
+
inputs: [{
|
|
440
|
+
internalType: "bytes4",
|
|
441
|
+
name: "_interfaceID",
|
|
442
|
+
type: "bytes4"
|
|
443
|
+
}],
|
|
444
|
+
name: "supportsInterface",
|
|
445
|
+
outputs: [{
|
|
446
|
+
internalType: "bool",
|
|
447
|
+
name: "",
|
|
448
|
+
type: "bool"
|
|
449
|
+
}],
|
|
450
|
+
stateMutability: "pure",
|
|
451
|
+
type: "function"
|
|
452
|
+
}, {
|
|
453
|
+
inputs: [{
|
|
454
|
+
internalType: "uint256",
|
|
455
|
+
name: "_id",
|
|
456
|
+
type: "uint256"
|
|
457
|
+
}],
|
|
458
|
+
name: "uri",
|
|
459
|
+
outputs: [{
|
|
460
|
+
internalType: "string",
|
|
461
|
+
name: "",
|
|
462
|
+
type: "string"
|
|
463
|
+
}],
|
|
464
|
+
stateMutability: "view",
|
|
465
|
+
type: "function"
|
|
466
|
+
}];
|
|
467
|
+
const singleBalanceCheckerAbi = [{
|
|
468
|
+
payable: true,
|
|
469
|
+
stateMutability: "payable",
|
|
470
|
+
type: "fallback"
|
|
471
|
+
}, {
|
|
472
|
+
constant: true,
|
|
473
|
+
inputs: [{
|
|
474
|
+
name: "user",
|
|
475
|
+
type: "address"
|
|
476
|
+
}, {
|
|
477
|
+
name: "token",
|
|
478
|
+
type: "address"
|
|
479
|
+
}],
|
|
480
|
+
name: "tokenBalance",
|
|
481
|
+
outputs: [{
|
|
482
|
+
name: "",
|
|
483
|
+
type: "uint256"
|
|
484
|
+
}],
|
|
485
|
+
payable: false,
|
|
486
|
+
stateMutability: "view",
|
|
487
|
+
type: "function"
|
|
488
|
+
}, {
|
|
489
|
+
constant: true,
|
|
490
|
+
inputs: [{
|
|
491
|
+
name: "users",
|
|
492
|
+
type: "address[]"
|
|
493
|
+
}, {
|
|
494
|
+
name: "tokens",
|
|
495
|
+
type: "address[]"
|
|
496
|
+
}],
|
|
497
|
+
name: "balances",
|
|
498
|
+
outputs: [{
|
|
499
|
+
name: "",
|
|
500
|
+
type: "uint256[]"
|
|
501
|
+
}],
|
|
502
|
+
payable: false,
|
|
503
|
+
stateMutability: "view",
|
|
504
|
+
type: "function"
|
|
505
|
+
}];
|
|
506
|
+
|
|
507
|
+
exports.erc1155Abi = erc1155Abi;
|
|
508
|
+
exports.erc20Abi = erc20Abi;
|
|
509
|
+
exports.erc721Abi = erc721Abi;
|
|
510
|
+
exports.singleBalanceCheckerAbi = singleBalanceCheckerAbi;
|