dequanto 0.0.1 → 0.0.7
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/.circleci/config.yml +28 -0
- package/actions/contracts.act.ts +50 -0
- package/actions/logs.act.ts +7 -0
- package/actions/safe.act.ts +7 -0
- package/actions/tokens.act.ts +20 -2
- package/configs/defi.yml +24 -0
- package/configs/dequanto.yml +49 -2
- package/contracts/abi/gnosis/GnosisSafe.json +979 -0
- package/contracts/gen/base/{ERC20Base.ts → ERC20Base/ERC20Base.ts} +136 -90
- package/contracts/gen/eth/WETHBase.ts +35 -35
- package/contracts/gnosis/GnosisSafe.ts +750 -0
- package/contracts/openzeppelin/AccessControl.json +206 -0
- package/contracts/openzeppelin/AccessControl.ts +236 -0
- package/contracts/openzeppelin/AccessControlCrossChain.json +219 -0
- package/contracts/openzeppelin/AccessControlCrossChain.ts +247 -0
- package/contracts/openzeppelin/AccessControlEnumerable.json +249 -0
- package/contracts/openzeppelin/AccessControlEnumerable.ts +258 -0
- package/contracts/openzeppelin/Address.json +1 -0
- package/contracts/openzeppelin/Address.ts +83 -0
- package/contracts/openzeppelin/Arrays.json +1 -0
- package/contracts/openzeppelin/Arrays.ts +83 -0
- package/contracts/openzeppelin/Base64.json +1 -0
- package/contracts/openzeppelin/Base64.ts +83 -0
- package/contracts/openzeppelin/BeaconProxy.json +71 -0
- package/contracts/openzeppelin/BeaconProxy.ts +163 -0
- package/contracts/openzeppelin/BitMaps.json +1 -0
- package/contracts/openzeppelin/BitMaps.ts +83 -0
- package/contracts/openzeppelin/Checkpoints.json +1 -0
- package/contracts/openzeppelin/Checkpoints.ts +83 -0
- package/contracts/openzeppelin/Clones.json +1 -0
- package/contracts/openzeppelin/Clones.ts +83 -0
- package/contracts/openzeppelin/ConditionalEscrow.json +156 -0
- package/contracts/openzeppelin/ConditionalEscrow.ts +236 -0
- package/contracts/openzeppelin/Context.json +1 -0
- package/contracts/openzeppelin/Context.ts +83 -0
- package/contracts/openzeppelin/Counters.json +1 -0
- package/contracts/openzeppelin/Counters.ts +83 -0
- package/contracts/openzeppelin/Create2.json +1 -0
- package/contracts/openzeppelin/Create2.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabled.json +1 -0
- package/contracts/openzeppelin/CrossChainEnabled.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabledAMB.json +13 -0
- package/contracts/openzeppelin/CrossChainEnabledAMB.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabledArbitrumL1.json +1 -0
- package/contracts/openzeppelin/CrossChainEnabledArbitrumL1.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabledArbitrumL2.json +1 -0
- package/contracts/openzeppelin/CrossChainEnabledArbitrumL2.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabledOptimism.json +1 -0
- package/contracts/openzeppelin/CrossChainEnabledOptimism.ts +83 -0
- package/contracts/openzeppelin/CrossChainEnabledPolygonChild.json +30 -0
- package/contracts/openzeppelin/CrossChainEnabledPolygonChild.ts +90 -0
- package/contracts/openzeppelin/DoubleEndedQueue.json +12 -0
- package/contracts/openzeppelin/DoubleEndedQueue.ts +83 -0
- package/contracts/openzeppelin/ECDSA.json +1 -0
- package/contracts/openzeppelin/ECDSA.ts +83 -0
- package/contracts/openzeppelin/EIP712.json +1 -0
- package/contracts/openzeppelin/EIP712.ts +83 -0
- package/contracts/openzeppelin/ERC1155.json +325 -0
- package/contracts/openzeppelin/ERC1155.ts +276 -0
- package/contracts/openzeppelin/ERC1155Burnable.json +360 -0
- package/contracts/openzeppelin/ERC1155Burnable.ts +298 -0
- package/contracts/openzeppelin/ERC1155Holder.json +99 -0
- package/contracts/openzeppelin/ERC1155Holder.ts +112 -0
- package/contracts/openzeppelin/ERC1155Pausable.json +353 -0
- package/contracts/openzeppelin/ERC1155Pausable.ts +345 -0
- package/contracts/openzeppelin/ERC1155PresetMinterPauser.json +734 -0
- package/contracts/openzeppelin/ERC1155PresetMinterPauser.ts +608 -0
- package/contracts/openzeppelin/ERC1155Receiver.json +99 -0
- package/contracts/openzeppelin/ERC1155Receiver.ts +112 -0
- package/contracts/openzeppelin/ERC1155Supply.json +352 -0
- package/contracts/openzeppelin/ERC1155Supply.ts +298 -0
- package/contracts/openzeppelin/ERC1155URIStorage.json +314 -0
- package/contracts/openzeppelin/ERC1155URIStorage.ts +276 -0
- package/contracts/openzeppelin/ERC165.json +21 -0
- package/contracts/openzeppelin/ERC165.ts +90 -0
- package/contracts/openzeppelin/ERC165Checker.json +1 -0
- package/contracts/openzeppelin/ERC165Checker.ts +83 -0
- package/contracts/openzeppelin/ERC165Storage.json +21 -0
- package/contracts/openzeppelin/ERC165Storage.ts +90 -0
- package/contracts/openzeppelin/ERC1820Implementer.json +26 -0
- package/contracts/openzeppelin/ERC1820Implementer.ts +90 -0
- package/contracts/openzeppelin/ERC1967Proxy.json +71 -0
- package/contracts/openzeppelin/ERC1967Proxy.ts +163 -0
- package/contracts/openzeppelin/ERC1967Upgrade.json +47 -0
- package/contracts/openzeppelin/ERC1967Upgrade.ts +163 -0
- package/contracts/openzeppelin/ERC20.json +288 -0
- package/contracts/openzeppelin/ERC20.ts +251 -0
- package/contracts/openzeppelin/ERC20Burnable.json +303 -0
- package/contracts/openzeppelin/ERC20Burnable.ts +273 -0
- package/contracts/openzeppelin/ERC20Capped.json +285 -0
- package/contracts/openzeppelin/ERC20Capped.ts +262 -0
- package/contracts/openzeppelin/ERC20FlashMint.json +349 -0
- package/contracts/openzeppelin/ERC20FlashMint.ts +284 -0
- package/contracts/openzeppelin/ERC20Pausable.json +311 -0
- package/contracts/openzeppelin/ERC20Pausable.ts +320 -0
- package/contracts/openzeppelin/ERC20Permit.json +347 -0
- package/contracts/openzeppelin/ERC20Permit.ts +284 -0
- package/contracts/openzeppelin/ERC20PresetFixedSupply.json +329 -0
- package/contracts/openzeppelin/ERC20PresetFixedSupply.ts +273 -0
- package/contracts/openzeppelin/ERC20PresetMinterPauser.json +663 -0
- package/contracts/openzeppelin/ERC20PresetMinterPauser.ts +583 -0
- package/contracts/openzeppelin/ERC20Snapshot.json +328 -0
- package/contracts/openzeppelin/ERC20Snapshot.ts +302 -0
- package/contracts/openzeppelin/ERC20Votes.json +584 -0
- package/contracts/openzeppelin/ERC20Votes.ts +430 -0
- package/contracts/openzeppelin/ERC20VotesComp.json +627 -0
- package/contracts/openzeppelin/ERC20VotesComp.ts +452 -0
- package/contracts/openzeppelin/ERC20Wrapper.json +333 -0
- package/contracts/openzeppelin/ERC20Wrapper.ts +284 -0
- package/contracts/openzeppelin/ERC2771Context.json +21 -0
- package/contracts/openzeppelin/ERC2771Context.ts +90 -0
- package/contracts/openzeppelin/ERC2981.json +50 -0
- package/contracts/openzeppelin/ERC2981.ts +101 -0
- package/contracts/openzeppelin/ERC4626.json +662 -0
- package/contracts/openzeppelin/ERC4626.ts +485 -0
- package/contracts/openzeppelin/ERC721.json +348 -0
- package/contracts/openzeppelin/ERC721.ts +295 -0
- package/contracts/openzeppelin/ERC721Burnable.json +345 -0
- package/contracts/openzeppelin/ERC721Burnable.ts +306 -0
- package/contracts/openzeppelin/ERC721Enumerable.json +388 -0
- package/contracts/openzeppelin/ERC721Enumerable.ts +328 -0
- package/contracts/openzeppelin/ERC721Holder.json +36 -0
- package/contracts/openzeppelin/ERC721Holder.ts +90 -0
- package/contracts/openzeppelin/ERC721Pausable.json +371 -0
- package/contracts/openzeppelin/ERC721Pausable.ts +364 -0
- package/contracts/openzeppelin/ERC721PresetMinterPauserAutoId.json +742 -0
- package/contracts/openzeppelin/ERC721PresetMinterPauserAutoId.ts +638 -0
- package/contracts/openzeppelin/ERC721Royalty.json +361 -0
- package/contracts/openzeppelin/ERC721Royalty.ts +306 -0
- package/contracts/openzeppelin/ERC721URIStorage.json +332 -0
- package/contracts/openzeppelin/ERC721URIStorage.ts +295 -0
- package/contracts/openzeppelin/ERC721Votes.json +546 -0
- package/contracts/openzeppelin/ERC721Votes.ts +441 -0
- package/contracts/openzeppelin/ERC777.json +578 -0
- package/contracts/openzeppelin/ERC777.ts +473 -0
- package/contracts/openzeppelin/ERC777PresetFixedSupply.json +588 -0
- package/contracts/openzeppelin/ERC777PresetFixedSupply.ts +473 -0
- package/contracts/openzeppelin/EnumerableMap.json +1 -0
- package/contracts/openzeppelin/EnumerableMap.ts +83 -0
- package/contracts/openzeppelin/EnumerableSet.json +1 -0
- package/contracts/openzeppelin/EnumerableSet.ts +83 -0
- package/contracts/openzeppelin/Escrow.json +137 -0
- package/contracts/openzeppelin/Escrow.ts +225 -0
- package/contracts/openzeppelin/Governor.json +866 -0
- package/contracts/openzeppelin/Governor.ts +525 -0
- package/contracts/openzeppelin/GovernorCompatibilityBravo.json +1181 -0
- package/contracts/openzeppelin/GovernorCompatibilityBravo.ts +654 -0
- package/contracts/openzeppelin/GovernorCountingSimple.json +895 -0
- package/contracts/openzeppelin/GovernorCountingSimple.ts +536 -0
- package/contracts/openzeppelin/GovernorPreventLateQuorum.json +930 -0
- package/contracts/openzeppelin/GovernorPreventLateQuorum.ts +605 -0
- package/contracts/openzeppelin/GovernorProposalThreshold.json +866 -0
- package/contracts/openzeppelin/GovernorProposalThreshold.ts +525 -0
- package/contracts/openzeppelin/GovernorSettings.json +962 -0
- package/contracts/openzeppelin/GovernorSettings.ts +645 -0
- package/contracts/openzeppelin/GovernorTimelockCompound.json +990 -0
- package/contracts/openzeppelin/GovernorTimelockCompound.ts +638 -0
- package/contracts/openzeppelin/GovernorTimelockControl.json +983 -0
- package/contracts/openzeppelin/GovernorTimelockControl.ts +627 -0
- package/contracts/openzeppelin/GovernorVotes.json +879 -0
- package/contracts/openzeppelin/GovernorVotes.ts +536 -0
- package/contracts/openzeppelin/GovernorVotesComp.json +879 -0
- package/contracts/openzeppelin/GovernorVotesComp.ts +536 -0
- package/contracts/openzeppelin/GovernorVotesQuorumFraction.json +937 -0
- package/contracts/openzeppelin/GovernorVotesQuorumFraction.ts +598 -0
- package/contracts/openzeppelin/IAMB.json +327 -0
- package/contracts/openzeppelin/IAMB.ts +331 -0
- package/contracts/openzeppelin/IAccessControl.json +174 -0
- package/contracts/openzeppelin/IAccessControl.ts +214 -0
- package/contracts/openzeppelin/IAccessControlEnumerable.json +217 -0
- package/contracts/openzeppelin/IAccessControlEnumerable.ts +236 -0
- package/contracts/openzeppelin/IArbSys.json +270 -0
- package/contracts/openzeppelin/IArbSys.ts +233 -0
- package/contracts/openzeppelin/IBeacon.json +15 -0
- package/contracts/openzeppelin/IBeacon.ts +90 -0
- package/contracts/openzeppelin/IBridge.json +296 -0
- package/contracts/openzeppelin/IBridge.ts +287 -0
- package/contracts/openzeppelin/ICompoundTimelock.json +415 -0
- package/contracts/openzeppelin/ICompoundTimelock.ts +389 -0
- package/contracts/openzeppelin/ICrossDomainMessenger.json +101 -0
- package/contracts/openzeppelin/ICrossDomainMessenger.ts +181 -0
- package/contracts/openzeppelin/IERC1155.json +295 -0
- package/contracts/openzeppelin/IERC1155.ts +265 -0
- package/contracts/openzeppelin/IERC1155MetadataURI.json +314 -0
- package/contracts/openzeppelin/IERC1155MetadataURI.ts +276 -0
- package/contracts/openzeppelin/IERC1155Receiver.json +99 -0
- package/contracts/openzeppelin/IERC1155Receiver.ts +112 -0
- package/contracts/openzeppelin/IERC1271.json +26 -0
- package/contracts/openzeppelin/IERC1271.ts +90 -0
- package/contracts/openzeppelin/IERC1363.json +373 -0
- package/contracts/openzeppelin/IERC1363.ts +252 -0
- package/contracts/openzeppelin/IERC1363Receiver.json +36 -0
- package/contracts/openzeppelin/IERC1363Receiver.ts +90 -0
- package/contracts/openzeppelin/IERC1363Spender.json +31 -0
- package/contracts/openzeppelin/IERC1363Spender.ts +90 -0
- package/contracts/openzeppelin/IERC165.json +21 -0
- package/contracts/openzeppelin/IERC165.ts +90 -0
- package/contracts/openzeppelin/IERC1820Implementer.json +26 -0
- package/contracts/openzeppelin/IERC1820Implementer.ts +90 -0
- package/contracts/openzeppelin/IERC1820Registry.json +215 -0
- package/contracts/openzeppelin/IERC1820Registry.ts +218 -0
- package/contracts/openzeppelin/IERC1822Proxiable.json +15 -0
- package/contracts/openzeppelin/IERC1822Proxiable.ts +90 -0
- package/contracts/openzeppelin/IERC20.json +185 -0
- package/contracts/openzeppelin/IERC20.ts +196 -0
- package/contracts/openzeppelin/IERC20Metadata.json +224 -0
- package/contracts/openzeppelin/IERC20Metadata.ts +229 -0
- package/contracts/openzeppelin/IERC20Permit.json +77 -0
- package/contracts/openzeppelin/IERC20Permit.ts +112 -0
- package/contracts/openzeppelin/IERC2612.json +77 -0
- package/contracts/openzeppelin/IERC2612.ts +112 -0
- package/contracts/openzeppelin/IERC2981.json +50 -0
- package/contracts/openzeppelin/IERC2981.ts +101 -0
- package/contracts/openzeppelin/IERC3156FlashBorrower.json +41 -0
- package/contracts/openzeppelin/IERC3156FlashBorrower.ts +90 -0
- package/contracts/openzeppelin/IERC3156FlashLender.json +79 -0
- package/contracts/openzeppelin/IERC3156FlashLender.ts +112 -0
- package/contracts/openzeppelin/IERC4626.json +614 -0
- package/contracts/openzeppelin/IERC4626.ts +463 -0
- package/contracts/openzeppelin/IERC721.json +287 -0
- package/contracts/openzeppelin/IERC721.ts +262 -0
- package/contracts/openzeppelin/IERC721Enumerable.json +343 -0
- package/contracts/openzeppelin/IERC721Enumerable.ts +295 -0
- package/contracts/openzeppelin/IERC721Metadata.json +332 -0
- package/contracts/openzeppelin/IERC721Metadata.ts +295 -0
- package/contracts/openzeppelin/IERC721Receiver.json +36 -0
- package/contracts/openzeppelin/IERC721Receiver.ts +90 -0
- package/contracts/openzeppelin/IERC777.json +393 -0
- package/contracts/openzeppelin/IERC777.ts +360 -0
- package/contracts/openzeppelin/IERC777Recipient.json +40 -0
- package/contracts/openzeppelin/IERC777Recipient.ts +90 -0
- package/contracts/openzeppelin/IERC777Sender.json +40 -0
- package/contracts/openzeppelin/IERC777Sender.ts +90 -0
- package/contracts/openzeppelin/IFxMessageProcessor.json +25 -0
- package/contracts/openzeppelin/IFxMessageProcessor.ts +90 -0
- package/contracts/openzeppelin/IGovernor.json +683 -0
- package/contracts/openzeppelin/IGovernor.ts +448 -0
- package/contracts/openzeppelin/IGovernorCompatibilityBravo.json +913 -0
- package/contracts/openzeppelin/IGovernorCompatibilityBravo.ts +522 -0
- package/contracts/openzeppelin/IGovernorTimelock.json +768 -0
- package/contracts/openzeppelin/IGovernorTimelock.ts +510 -0
- package/contracts/openzeppelin/IInbox.json +377 -0
- package/contracts/openzeppelin/IInbox.ts +273 -0
- package/contracts/openzeppelin/IMessageProvider.json +34 -0
- package/contracts/openzeppelin/IMessageProvider.ts +134 -0
- package/contracts/openzeppelin/IOutbox.json +179 -0
- package/contracts/openzeppelin/IOutbox.ts +218 -0
- package/contracts/openzeppelin/IVotes.json +184 -0
- package/contracts/openzeppelin/IVotes.ts +196 -0
- package/contracts/openzeppelin/Initializable.json +15 -0
- package/contracts/openzeppelin/Initializable.ts +105 -0
- package/contracts/openzeppelin/LibAMB.json +1 -0
- package/contracts/openzeppelin/LibAMB.ts +83 -0
- package/contracts/openzeppelin/LibArbitrumL1.json +1 -0
- package/contracts/openzeppelin/LibArbitrumL1.ts +83 -0
- package/contracts/openzeppelin/LibArbitrumL2.json +15 -0
- package/contracts/openzeppelin/LibArbitrumL2.ts +90 -0
- package/contracts/openzeppelin/LibOptimism.json +1 -0
- package/contracts/openzeppelin/LibOptimism.ts +83 -0
- package/contracts/openzeppelin/Math.json +1 -0
- package/contracts/openzeppelin/Math.ts +83 -0
- package/contracts/openzeppelin/MerkleProof.json +1 -0
- package/contracts/openzeppelin/MerkleProof.ts +83 -0
- package/contracts/openzeppelin/MinimalForwarder.json +143 -0
- package/contracts/openzeppelin/MinimalForwarder.ts +112 -0
- package/contracts/openzeppelin/Multicall.json +21 -0
- package/contracts/openzeppelin/Multicall.ts +90 -0
- package/contracts/openzeppelin/Ownable.json +54 -0
- package/contracts/openzeppelin/Ownable.ts +134 -0
- package/contracts/openzeppelin/Pausable.json +41 -0
- package/contracts/openzeppelin/Pausable.ts +141 -0
- package/contracts/openzeppelin/PaymentSplitter.json +304 -0
- package/contracts/openzeppelin/PaymentSplitter.ts +281 -0
- package/contracts/openzeppelin/Proxy.json +10 -0
- package/contracts/openzeppelin/Proxy.ts +83 -0
- package/contracts/openzeppelin/ProxyAdmin.json +151 -0
- package/contracts/openzeppelin/ProxyAdmin.ts +189 -0
- package/contracts/openzeppelin/PullPayment.json +34 -0
- package/contracts/openzeppelin/PullPayment.ts +101 -0
- package/contracts/openzeppelin/ReentrancyGuard.json +1 -0
- package/contracts/openzeppelin/ReentrancyGuard.ts +83 -0
- package/contracts/openzeppelin/RefundEscrow.json +226 -0
- package/contracts/openzeppelin/RefundEscrow.ts +349 -0
- package/contracts/openzeppelin/SafeCast.json +1 -0
- package/contracts/openzeppelin/SafeCast.ts +83 -0
- package/contracts/openzeppelin/SafeERC20.json +1 -0
- package/contracts/openzeppelin/SafeERC20.ts +83 -0
- package/contracts/openzeppelin/SafeMath.json +1 -0
- package/contracts/openzeppelin/SafeMath.ts +83 -0
- package/contracts/openzeppelin/SignatureChecker.json +1 -0
- package/contracts/openzeppelin/SignatureChecker.ts +83 -0
- package/contracts/openzeppelin/SignedMath.json +1 -0
- package/contracts/openzeppelin/SignedMath.ts +83 -0
- package/contracts/openzeppelin/SignedSafeMath.json +1 -0
- package/contracts/openzeppelin/SignedSafeMath.ts +83 -0
- package/contracts/openzeppelin/StorageSlot.json +1 -0
- package/contracts/openzeppelin/StorageSlot.ts +83 -0
- package/contracts/openzeppelin/Strings.json +1 -0
- package/contracts/openzeppelin/Strings.ts +83 -0
- package/contracts/openzeppelin/TimelockController.json +867 -0
- package/contracts/openzeppelin/TimelockController.ts +583 -0
- package/contracts/openzeppelin/Timers.json +1 -0
- package/contracts/openzeppelin/Timers.ts +83 -0
- package/contracts/openzeppelin/TokenTimelock.json +69 -0
- package/contracts/openzeppelin/TokenTimelock.ts +123 -0
- package/contracts/openzeppelin/TransparentUpgradeableProxy.json +146 -0
- package/contracts/openzeppelin/TransparentUpgradeableProxy.ts +214 -0
- package/contracts/openzeppelin/UUPSUpgradeable.json +91 -0
- package/contracts/openzeppelin/UUPSUpgradeable.ts +192 -0
- package/contracts/openzeppelin/UpgradeableBeacon.json +104 -0
- package/contracts/openzeppelin/UpgradeableBeacon.ts +185 -0
- package/contracts/openzeppelin/VestingWallet.json +193 -0
- package/contracts/openzeppelin/VestingWallet.ts +208 -0
- package/contracts/openzeppelin/Votes.json +216 -0
- package/contracts/openzeppelin/Votes.ts +218 -0
- package/data/evm/eventHashes.json +19314 -0
- package/data/evm/events.json +19314 -0
- package/data/evm/functionHashes.json +121138 -0
- package/data/evm/functions.json +121140 -0
- package/data/tokens/coingecko.json +137409 -0
- package/dist/contracts/gen/base/ERC20Base/ERC20Base.js +94 -0
- package/dist/contracts/gnosis/GnosisSafe.js +357 -0
- package/dist/src/BlockchainExplorer/BlockChainExplorerFactory.js +114 -20
- package/dist/src/BlockchainExplorer/BlockChainExplorerProvider.js +8 -0
- package/dist/src/BlockchainExplorer/Bscscan.js +1 -0
- package/dist/src/BlockchainExplorer/Etherscan.js +14 -4
- package/dist/src/BlockchainExplorer/Evmscan.js +9 -0
- package/dist/src/BlockchainExplorer/Polyscan.js +1 -0
- package/dist/src/ChainAccountProvider.js +89 -0
- package/dist/src/ChainAccountsService.js +20 -2
- package/dist/src/Config.js +76 -0
- package/dist/src/blocks/BlockDateResolver.js +9 -8
- package/dist/src/bridges/hop/HopBridge.js +5 -2
- package/dist/src/chains/PlatformFactory.js +2 -2
- package/dist/src/chains/arbitrum/ArbWeb3Client.js +5 -24
- package/dist/src/chains/arbitrum/TokensServiceArbitrum.js +18 -0
- package/dist/src/chains/boba/BobaWeb3Client.js +5 -33
- package/dist/src/chains/xdai/XDaiWeb3Client.js +6 -30
- package/dist/src/class/SubjectKind.js +9 -0
- package/dist/src/class/SubjectStream.js +104 -0
- package/dist/src/class/Subscription.js +13 -0
- package/dist/src/clients/BscWeb3Client.js +5 -24
- package/dist/src/clients/ClientEventsStream.js +62 -18
- package/dist/src/clients/ClientPool.js +115 -55
- package/dist/src/clients/EthWeb3Client.js +7 -22
- package/dist/src/clients/EvmWeb3Client.js +25 -0
- package/dist/src/clients/HardhatWeb3Client.js +19 -40
- package/dist/src/clients/PolyWeb3Client.js +5 -51
- package/dist/src/clients/Web3Client.js +355 -10
- package/dist/src/clients/Web3ClientFactory.js +15 -0
- package/dist/src/clients/debug/ClientDebugMethods.js +64 -0
- package/dist/src/clients/utils/ClientEndpoints.js +6 -0
- package/dist/src/clients/utils/TxFactory.js +7 -12
- package/dist/src/contracts/Contract.js +2 -1
- package/dist/src/contracts/ContractAbiProvider.js +58 -0
- package/dist/src/contracts/ContractBase.js +161 -26
- package/dist/src/contracts/ContractReader.js +78 -2
- package/dist/src/contracts/ContractStorageReaderBase.js +15 -0
- package/dist/src/contracts/ContractStream.js +21 -8
- package/dist/src/contracts/ContractWriter.js +47 -20
- package/dist/src/contracts/TxContract.js +6 -3
- package/dist/src/contracts/common/ERC20.js +1 -1
- package/dist/src/contracts/utils/AbiDeserializer.js +15 -5
- package/dist/src/contracts/utils/InputDataUtils.js +5 -2
- package/dist/src/env/BigIntSerializer.js +2 -1
- package/dist/src/evm/EVM.js +214 -0
- package/dist/src/evm/OpcodesWalker.js +137 -0
- package/dist/src/evm/Stack.js +57 -0
- package/dist/src/evm/interfaces/IJumps.js +2 -0
- package/dist/src/evm/interfaces/IMemory.js +2 -0
- package/dist/src/evm/interfaces/IOpcode.js +2 -0
- package/dist/src/evm/interfaces/IStorage.js +2 -0
- package/dist/src/evm/opcodes/add.js +50 -0
- package/dist/src/evm/opcodes/addmod.js +19 -0
- package/dist/src/evm/opcodes/address.js +17 -0
- package/dist/src/evm/opcodes/and.js +56 -0
- package/dist/src/evm/opcodes/balance.js +22 -0
- package/dist/src/evm/opcodes/blockhash.js +22 -0
- package/dist/src/evm/opcodes/byte.js +30 -0
- package/dist/src/evm/opcodes/call.js +48 -0
- package/dist/src/evm/opcodes/callcode.js +48 -0
- package/dist/src/evm/opcodes/calldatacopy.js +27 -0
- package/dist/src/evm/opcodes/calldataload.js +33 -0
- package/dist/src/evm/opcodes/calldatasize.js +16 -0
- package/dist/src/evm/opcodes/caller.js +17 -0
- package/dist/src/evm/opcodes/callvalue.js +16 -0
- package/dist/src/evm/opcodes/codecopy.js +31 -0
- package/dist/src/evm/opcodes/codesize.js +16 -0
- package/dist/src/evm/opcodes/coinbase.js +16 -0
- package/dist/src/evm/opcodes/create.js +35 -0
- package/dist/src/evm/opcodes/create2.js +34 -0
- package/dist/src/evm/opcodes/delegatecall.js +44 -0
- package/dist/src/evm/opcodes/difficulty.js +16 -0
- package/dist/src/evm/opcodes/div.js +33 -0
- package/dist/src/evm/opcodes/dup.js +6 -0
- package/dist/src/evm/opcodes/eq.js +69 -0
- package/dist/src/evm/opcodes/exp.js +30 -0
- package/dist/src/evm/opcodes/extcodecopy.js +35 -0
- package/dist/src/evm/opcodes/extcodehash.js +22 -0
- package/dist/src/evm/opcodes/extcodesize.js +22 -0
- package/dist/src/evm/opcodes/gas.js +16 -0
- package/dist/src/evm/opcodes/gaslimit.js +16 -0
- package/dist/src/evm/opcodes/gasprice.js +16 -0
- package/dist/src/evm/opcodes/gt.js +36 -0
- package/dist/src/evm/opcodes/invalid.js +18 -0
- package/dist/src/evm/opcodes/iszero.js +51 -0
- package/dist/src/evm/opcodes/jump.js +66 -0
- package/dist/src/evm/opcodes/jumpdest.js +5 -0
- package/dist/src/evm/opcodes/jumpi.js +298 -0
- package/dist/src/evm/opcodes/log.js +74 -0
- package/dist/src/evm/opcodes/lt.js +36 -0
- package/dist/src/evm/opcodes/mload.js +28 -0
- package/dist/src/evm/opcodes/mod.js +30 -0
- package/dist/src/evm/opcodes/msize.js +16 -0
- package/dist/src/evm/opcodes/mstore.js +30 -0
- package/dist/src/evm/opcodes/mul.js +34 -0
- package/dist/src/evm/opcodes/mulmod.js +19 -0
- package/dist/src/evm/opcodes/not.js +28 -0
- package/dist/src/evm/opcodes/number.js +16 -0
- package/dist/src/evm/opcodes/or.js +30 -0
- package/dist/src/evm/opcodes/origin.js +16 -0
- package/dist/src/evm/opcodes/pc.js +5 -0
- package/dist/src/evm/opcodes/pop.js +5 -0
- package/dist/src/evm/opcodes/push.js +6 -0
- package/dist/src/evm/opcodes/return.js +70 -0
- package/dist/src/evm/opcodes/returndatacopy.js +31 -0
- package/dist/src/evm/opcodes/returndatasize.js +16 -0
- package/dist/src/evm/opcodes/revert.js +57 -0
- package/dist/src/evm/opcodes/sar.js +30 -0
- package/dist/src/evm/opcodes/selfdestruct.js +23 -0
- package/dist/src/evm/opcodes/sha3.js +56 -0
- package/dist/src/evm/opcodes/shl.js +35 -0
- package/dist/src/evm/opcodes/shr.js +30 -0
- package/dist/src/evm/opcodes/signextend.js +19 -0
- package/dist/src/evm/opcodes/sload.js +140 -0
- package/dist/src/evm/opcodes/sstore.js +189 -0
- package/dist/src/evm/opcodes/staticcall.js +44 -0
- package/dist/src/evm/opcodes/stop.js +17 -0
- package/dist/src/evm/opcodes/sub.js +30 -0
- package/dist/src/evm/opcodes/swap.js +6 -0
- package/dist/src/evm/opcodes/timestamp.js +16 -0
- package/dist/src/evm/opcodes/xor.js +30 -0
- package/dist/src/evm/opcodes.js +192 -0
- package/dist/src/evm/tx.class.js +154 -0
- package/dist/src/evm/utils/BigNumber.js +14 -0
- package/dist/src/evm/utils/hex.js +44 -0
- package/dist/src/evm/utils/opcodes.js +217 -0
- package/dist/src/evm/utils/stringify.js +14 -0
- package/dist/src/evm/utils/stringifyEvents.js +38 -0
- package/dist/src/evm/utils/stringifyFunctions.js +70 -0
- package/dist/src/evm/utils/stringifyInstructions.js +44 -0
- package/dist/src/evm/utils/stringifyMappings.js +62 -0
- package/dist/src/evm/utils/stringifyStructs.js +16 -0
- package/dist/src/evm/utils/stringifyVariables.js +33 -0
- package/dist/src/gen/ContractStorageReaderTemplate.js +11 -0
- package/dist/src/gen/Generator.js +37 -16
- package/dist/src/gen/GeneratorFromAbi.js +225 -72
- package/dist/src/gen/GeneratorStorageReader.js +89 -0
- package/dist/src/gen/utils/$gen.js +14 -0
- package/dist/src/gen/utils/Str.js +47 -0
- package/dist/src/hardhat/HardhatProvider.js +177 -0
- package/dist/src/indexer/BlocksTxIndexer.js +19 -7
- package/dist/src/indexer/handlers/BlocksWalker.js +65 -54
- package/dist/src/loggers/LoggerService.js +8 -5
- package/dist/src/models/TAccount.js +2 -0
- package/dist/src/ns/NameService.js +3 -0
- package/dist/src/ns/utils/$ns.js +6 -3
- package/dist/src/safe/$gnosis.js +23 -0
- package/dist/src/safe/GnosisSafeFactory.js +27 -0
- package/dist/src/safe/GnosisSafeHandler.js +361 -0
- package/dist/src/safe/transport/FileServiceTransport.js +92 -0
- package/dist/src/safe/transport/GnosisServiceTransport.js +78 -0
- package/dist/src/safe/transport/ISafeServiceTransport.js +2 -0
- package/dist/src/safe/transport/InMemoryServiceTransport.js +56 -0
- package/dist/src/solidity/SlotsParser.js +594 -0
- package/dist/src/solidity/SlotsStorage.js +158 -0
- package/dist/src/solidity/storage/Accessor.js +126 -0
- package/dist/src/solidity/storage/SlotDynamicArray.js +17 -0
- package/dist/src/solidity/storage/SlotFixedArray.js +28 -0
- package/dist/src/solidity/storage/SlotsStorageHandler.js +10 -0
- package/dist/src/solidity/storage/SlotsStorageTransport.js +126 -0
- package/dist/src/solidity/storage/handlers/SlotDynamicArrayHandler.js +47 -0
- package/dist/src/solidity/storage/handlers/SlotFixedArrayHandler.js +50 -0
- package/dist/src/solidity/storage/handlers/SlotMappingHandler.js +42 -0
- package/dist/src/solidity/storage/handlers/SlotStringHandler.js +109 -0
- package/dist/src/solidity/storage/handlers/SlotStructHandler.js +45 -0
- package/dist/src/solidity/storage/handlers/SlotValueHandler.js +30 -0
- package/dist/src/solidity/utils/$str.js +38 -0
- package/dist/src/solidity/utils/$types.js +22 -0
- package/dist/src/structs/PackedRanges.js +8 -1
- package/dist/src/tokens/TokenDataProvider.js +251 -0
- package/dist/src/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js +3 -1
- package/dist/src/tokens/TokenExchanges/AmmV2ExchangeBase.js +4 -4
- package/dist/src/tokens/TokenExchanges/PancakeswapExchange.js +4 -7
- package/dist/src/tokens/TokenExchanges/SushiswapPolygonExchange.js +4 -5
- package/dist/src/tokens/TokenExchanges/UniswapExchange.js +4 -7
- package/dist/src/tokens/TokenOracles/AmmPriceV2Oracle.js +2 -4
- package/dist/src/tokens/TokenOracles/CoingeckoOracle.js +12 -0
- package/dist/src/tokens/TokenOracles/TokenPriceStore.js +1 -1
- package/dist/src/tokens/TokenProviders/TPChain.js +14 -7
- package/dist/src/tokens/TokenProviders/TPCoingecko.js +117 -0
- package/dist/src/tokens/TokenProviders/TPConfig.js +46 -0
- package/dist/src/tokens/TokenProviders/TPExplorer.js +35 -0
- package/dist/src/tokens/TokenService.js +5 -2
- package/dist/src/tokens/TokenTransferService.js +28 -18
- package/dist/src/tokens/TokensService.js +32 -177
- package/dist/src/tokens/TokensServiceFactory.js +13 -1
- package/dist/src/txs/TxDataBuilder.js +54 -22
- package/dist/src/txs/TxLogger.js +3 -3
- package/dist/src/txs/TxWriter.js +169 -37
- package/dist/src/txs/receipt/TxLogParser.js +11 -1
- package/dist/src/txs/receipt/TxLogsTransfer.js +14 -13
- package/dist/src/txs/receipt/TxTopicProvider.js +10 -6
- package/dist/src/txs/sig-transports/SigFileTransport.js +48 -0
- package/dist/src/utils/$abiParser.js +55 -20
- package/dist/src/utils/$abiType.js +184 -3
- package/dist/src/utils/$abiUtils.js +54 -5
- package/dist/src/utils/$account.js +30 -0
- package/dist/src/utils/$address.js +8 -0
- package/dist/src/utils/$bigint.js +52 -3
- package/dist/src/utils/$block.js +16 -0
- package/dist/src/utils/$bloom.js +42 -0
- package/dist/src/utils/$buffer.js +94 -0
- package/dist/src/utils/$cli.js +20 -0
- package/dist/src/utils/$color.js +171 -0
- package/dist/src/utils/$config.js +65 -5
- package/dist/src/utils/$const.js +4 -0
- package/dist/src/utils/$contract.js +20 -2
- package/dist/src/utils/$crypto.js +25 -0
- package/dist/src/utils/$csv.js +17 -27
- package/dist/src/utils/$date.js +129 -25
- package/dist/src/utils/$gas.js +15 -0
- package/dist/src/utils/$hex.js +77 -0
- package/dist/src/utils/$is.js +24 -21
- package/dist/src/utils/$logger.js +56 -3
- package/dist/src/utils/$machine.js +77 -0
- package/dist/src/utils/$number.js +24 -1
- package/dist/src/utils/$path.js +17 -0
- package/dist/src/utils/$promise.js +81 -0
- package/dist/src/utils/$require.js +15 -1
- package/dist/src/utils/$secret.js +29 -0
- package/dist/src/utils/$sign.js +96 -14
- package/dist/src/utils/$signRaw.js +48 -0
- package/dist/src/utils/$signSerializer.js +5 -4
- package/dist/src/utils/$txData.js +19 -0
- package/hardhat.config.js +21 -1
- package/package.json +28 -14
- package/readme.md +21 -4
- package/src/BlockchainExplorer/BlockChainExplorerFactory.ts +149 -39
- package/src/BlockchainExplorer/BlockChainExplorerProvider.ts +10 -0
- package/src/BlockchainExplorer/Bscscan.ts +1 -0
- package/src/BlockchainExplorer/Etherscan.ts +17 -5
- package/src/BlockchainExplorer/Evmscan.ts +8 -0
- package/src/BlockchainExplorer/IBlockChainExplorer.ts +3 -2
- package/src/BlockchainExplorer/Polyscan.ts +1 -0
- package/src/ChainAccountProvider.ts +84 -0
- package/src/ChainAccountsService.ts +21 -2
- package/src/Config.ts +85 -0
- package/src/blocks/BlockDateResolver.ts +10 -12
- package/src/bridges/hop/HopBridge.ts +9 -2
- package/src/bridges/hop/contracts/polygon/Dai_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Dai_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Dai_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Eth_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Eth_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Eth_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Matic_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Matic_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Matic_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdc_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdc_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdc_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdt_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdt_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Usdt_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Wbtc_l2AmmWrapperContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Wbtc_l2BridgeContract.ts +35 -35
- package/src/bridges/hop/contracts/polygon/Wbtc_l2SaddleSwapContract.ts +35 -35
- package/src/bridges/models/IBridge.ts +1 -1
- package/src/chains/PlatformFactory.ts +3 -2
- package/src/chains/arbitrum/ArbWeb3Client.ts +7 -22
- package/src/chains/arbitrum/TokensServiceArbitrum.ts +19 -0
- package/src/chains/boba/BobaWeb3Client.ts +5 -33
- package/src/chains/xdai/XDaiWeb3Client.ts +6 -32
- package/src/class/SubjectKind.ts +5 -0
- package/src/class/SubjectStream.ts +111 -0
- package/src/class/Subscription.ts +7 -0
- package/src/clients/BscWeb3Client.ts +5 -22
- package/src/clients/ClientEventsStream.ts +86 -19
- package/src/clients/ClientPool.ts +145 -61
- package/src/clients/EthWeb3Client.ts +8 -21
- package/src/clients/EvmWeb3Client.ts +26 -0
- package/src/clients/HardhatWeb3Client.ts +17 -39
- package/src/clients/PolyWeb3Client.ts +5 -54
- package/src/clients/Web3Client.ts +430 -32
- package/src/clients/Web3ClientFactory.ts +17 -1
- package/src/clients/debug/ClientDebugMethods.ts +75 -0
- package/src/clients/interfaces/IWeb3Client.ts +33 -5
- package/src/clients/interfaces/IWeb3EndpointOptions.ts +6 -0
- package/src/clients/utils/ClientEndpoints.ts +6 -0
- package/src/clients/utils/TxFactory.ts +13 -13
- package/src/contracts/Contract.ts +3 -2
- package/src/contracts/ContractAbiProvider.ts +68 -0
- package/src/contracts/ContractBase.ts +205 -36
- package/src/contracts/ContractReader.ts +116 -3
- package/src/contracts/ContractStorageReaderBase.ts +26 -0
- package/src/contracts/ContractStream.ts +24 -6
- package/src/contracts/ContractWriter.ts +58 -28
- package/src/contracts/TxContract.ts +7 -4
- package/src/contracts/common/ERC20.ts +1 -1
- package/src/contracts/utils/AbiDeserializer.ts +16 -7
- package/src/contracts/utils/InputDataUtils.ts +8 -6
- package/src/env/BigIntSerializer.ts +3 -1
- package/src/evm/EVM.ts +246 -0
- package/src/evm/OpcodesWalker.ts +149 -0
- package/src/evm/Stack.ts +58 -0
- package/src/evm/interfaces/IJumps.ts +3 -0
- package/src/evm/interfaces/IMemory.ts +3 -0
- package/src/evm/interfaces/IOpcode.ts +11 -0
- package/src/evm/interfaces/IStorage.ts +3 -0
- package/src/evm/opcodes/add.ts +49 -0
- package/src/evm/opcodes/addmod.ts +19 -0
- package/src/evm/opcodes/address.ts +22 -0
- package/src/evm/opcodes/and.ts +58 -0
- package/src/evm/opcodes/balance.ts +25 -0
- package/src/evm/opcodes/blockhash.ts +25 -0
- package/src/evm/opcodes/byte.ts +34 -0
- package/src/evm/opcodes/call.ts +69 -0
- package/src/evm/opcodes/callcode.ts +69 -0
- package/src/evm/opcodes/calldatacopy.ts +36 -0
- package/src/evm/opcodes/calldataload.ts +40 -0
- package/src/evm/opcodes/calldatasize.ts +21 -0
- package/src/evm/opcodes/caller.ts +22 -0
- package/src/evm/opcodes/callvalue.ts +21 -0
- package/src/evm/opcodes/codecopy.ts +37 -0
- package/src/evm/opcodes/codesize.ts +21 -0
- package/src/evm/opcodes/coinbase.ts +21 -0
- package/src/evm/opcodes/create.ts +42 -0
- package/src/evm/opcodes/create2.ts +41 -0
- package/src/evm/opcodes/delegatecall.ts +63 -0
- package/src/evm/opcodes/difficulty.ts +21 -0
- package/src/evm/opcodes/div.ts +35 -0
- package/src/evm/opcodes/dup.ts +7 -0
- package/src/evm/opcodes/eq.ts +92 -0
- package/src/evm/opcodes/exp.ts +34 -0
- package/src/evm/opcodes/extcodecopy.ts +42 -0
- package/src/evm/opcodes/extcodehash.ts +25 -0
- package/src/evm/opcodes/extcodesize.ts +25 -0
- package/src/evm/opcodes/gas.ts +21 -0
- package/src/evm/opcodes/gaslimit.ts +21 -0
- package/src/evm/opcodes/gasprice.ts +21 -0
- package/src/evm/opcodes/gt.ts +39 -0
- package/src/evm/opcodes/invalid.ts +24 -0
- package/src/evm/opcodes/iszero.ts +48 -0
- package/src/evm/opcodes/jump.ts +66 -0
- package/src/evm/opcodes/jumpdest.ts +6 -0
- package/src/evm/opcodes/jumpi.ts +367 -0
- package/src/evm/opcodes/log.ts +89 -0
- package/src/evm/opcodes/lt.ts +39 -0
- package/src/evm/opcodes/mload.ts +30 -0
- package/src/evm/opcodes/mod.ts +33 -0
- package/src/evm/opcodes/msize.ts +21 -0
- package/src/evm/opcodes/mstore.ts +33 -0
- package/src/evm/opcodes/mul.ts +38 -0
- package/src/evm/opcodes/mulmod.ts +19 -0
- package/src/evm/opcodes/not.ts +30 -0
- package/src/evm/opcodes/number.ts +21 -0
- package/src/evm/opcodes/or.ts +33 -0
- package/src/evm/opcodes/origin.ts +21 -0
- package/src/evm/opcodes/pc.ts +7 -0
- package/src/evm/opcodes/pop.ts +6 -0
- package/src/evm/opcodes/push.ts +8 -0
- package/src/evm/opcodes/return.ts +78 -0
- package/src/evm/opcodes/returndatacopy.ts +37 -0
- package/src/evm/opcodes/returndatasize.ts +21 -0
- package/src/evm/opcodes/revert.ts +64 -0
- package/src/evm/opcodes/sar.ts +33 -0
- package/src/evm/opcodes/selfdestruct.ts +26 -0
- package/src/evm/opcodes/sha3.ts +63 -0
- package/src/evm/opcodes/shl.ts +42 -0
- package/src/evm/opcodes/shr.ts +33 -0
- package/src/evm/opcodes/signextend.ts +25 -0
- package/src/evm/opcodes/sload.ts +190 -0
- package/src/evm/opcodes/sstore.ts +259 -0
- package/src/evm/opcodes/staticcall.ts +63 -0
- package/src/evm/opcodes/stop.ts +22 -0
- package/src/evm/opcodes/sub.ts +33 -0
- package/src/evm/opcodes/swap.ts +7 -0
- package/src/evm/opcodes/timestamp.ts +21 -0
- package/src/evm/opcodes/xor.ts +33 -0
- package/src/evm/opcodes.ts +207 -0
- package/src/evm/tx.class.ts +137 -0
- package/src/evm/utils/BigNumber.ts +9 -0
- package/src/evm/utils/hex.ts +37 -0
- package/src/evm/utils/opcodes.ts +213 -0
- package/src/evm/utils/stringify.ts +12 -0
- package/src/evm/utils/stringifyEvents.ts +37 -0
- package/src/evm/utils/stringifyFunctions.ts +41 -0
- package/src/evm/utils/stringifyInstructions.ts +38 -0
- package/src/evm/utils/stringifyMappings.ts +65 -0
- package/src/evm/utils/stringifyStructs.ts +16 -0
- package/src/evm/utils/stringifyVariables.ts +32 -0
- package/src/gen/ContractStorageReaderTemplate.ts +18 -0
- package/src/gen/ContractTemplate.ts +41 -7
- package/src/gen/Generator.ts +50 -19
- package/src/gen/GeneratorFromAbi.ts +239 -67
- package/src/gen/GeneratorStorageReader.ts +113 -0
- package/src/gen/utils/$gen.ts +11 -0
- package/src/gen/utils/Str.ts +40 -0
- package/src/handlers/TokenHandler.ts +1 -1
- package/src/hardhat/HardhatProvider.ts +207 -0
- package/src/indexer/BlocksTxIndexer.ts +36 -10
- package/src/indexer/handlers/BlocksWalker.ts +81 -62
- package/src/indexer/handlers/TxQueueLoader.ts +7 -7
- package/src/json/JsonObjectStore.ts +1 -1
- package/src/loggers/LoggerService.ts +9 -5
- package/src/loggers/TxLoggerService.ts +1 -1
- package/src/models/IToken.ts +9 -0
- package/src/models/TAccount.ts +30 -0
- package/src/models/TBufferLike.ts +2 -2
- package/src/models/TPlatform.ts +1 -1
- package/src/ns/NameService.ts +3 -0
- package/src/ns/utils/$ns.ts +3 -4
- package/src/safe/$gnosis.ts +20 -0
- package/src/safe/GnosisSafeFactory.ts +40 -0
- package/src/safe/GnosisSafeHandler.ts +432 -0
- package/src/safe/transport/FileServiceTransport.ts +115 -0
- package/src/safe/transport/GnosisServiceTransport.ts +83 -0
- package/src/safe/transport/ISafeServiceTransport.ts +26 -0
- package/src/safe/transport/InMemoryServiceTransport.ts +79 -0
- package/src/solidity/SlotsParser.ts +650 -0
- package/src/solidity/SlotsStorage.ts +177 -0
- package/src/solidity/storage/Accessor.spec.ts +45 -0
- package/src/solidity/storage/Accessor.ts +136 -0
- package/src/solidity/storage/SlotDynamicArray.ts +46 -0
- package/src/solidity/storage/SlotFixedArray.ts +31 -0
- package/src/solidity/storage/SlotsStorageHandler.ts +17 -0
- package/src/solidity/storage/SlotsStorageTransport.ts +152 -0
- package/src/solidity/storage/handlers/SlotDynamicArrayHandler.ts +52 -0
- package/src/solidity/storage/handlers/SlotFixedArrayHandler.ts +52 -0
- package/src/solidity/storage/handlers/SlotMappingHandler.ts +52 -0
- package/src/solidity/storage/handlers/SlotStringHandler.ts +130 -0
- package/src/solidity/storage/handlers/SlotStructHandler.ts +46 -0
- package/src/solidity/storage/handlers/SlotValueHandler.ts +36 -0
- package/src/solidity/utils/$str.ts +36 -0
- package/src/solidity/utils/$types.ts +16 -0
- package/src/structs/PackedRanges.ts +9 -3
- package/src/tokens/TokenDataProvider.ts +271 -0
- package/src/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.ts +3 -1
- package/src/tokens/TokenExchanges/AmmV2ExchangeBase.ts +4 -3
- package/src/tokens/TokenExchanges/OneInchExchange.ts +1 -1
- package/src/tokens/TokenExchanges/PancakeswapExchange.ts +5 -10
- package/src/tokens/TokenExchanges/SushiswapPolygonExchange.ts +8 -5
- package/src/tokens/TokenExchanges/UniswapExchange.ts +6 -9
- package/src/tokens/TokenOracles/AmmPriceV2Oracle.ts +5 -5
- package/src/tokens/TokenOracles/CoingeckoOracle.ts +13 -0
- package/src/tokens/TokenOracles/TokenPriceStore.ts +1 -1
- package/src/tokens/TokenPriceService.ts +0 -1
- package/src/tokens/TokenProviders/ITokenProvider.ts +1 -1
- package/src/tokens/TokenProviders/TPChain.ts +20 -8
- package/src/tokens/TokenProviders/TPCoingecko.ts +121 -0
- package/src/tokens/TokenProviders/TPConfig.ts +53 -0
- package/src/tokens/TokenProviders/TPExplorer.ts +41 -0
- package/src/tokens/TokenService.ts +6 -3
- package/src/tokens/TokenSwapService.ts +1 -1
- package/src/tokens/TokenTransferService.ts +40 -24
- package/src/tokens/TokensService.ts +34 -179
- package/src/tokens/TokensServiceFactory.ts +13 -1
- package/src/tokens/defi/ISwapService.ts +1 -1
- package/src/tokens/defi/paraswap/Paraswap.ts +2 -1
- package/src/txs/ITxConfig.ts +1 -1
- package/src/txs/TxDataBuilder.ts +78 -34
- package/src/txs/TxLogger.ts +4 -4
- package/src/txs/TxWriter.ts +245 -48
- package/src/txs/conditional/GasWatcherTx.ts +0 -1
- package/src/txs/receipt/ITxLogItem.ts +8 -5
- package/src/txs/receipt/TxLogParser.ts +13 -2
- package/src/txs/receipt/TxLogsTransfer.ts +15 -15
- package/src/txs/receipt/TxTopicInMemoryProvider.ts +1 -1
- package/src/txs/receipt/TxTopicProvider.ts +7 -7
- package/src/txs/sig-transports/SigFileTransport.ts +52 -0
- package/src/utils/$abiParser.spec.ts +90 -0
- package/src/utils/$abiParser.ts +60 -25
- package/src/utils/$abiType.ts +195 -5
- package/src/utils/$abiUtils.ts +57 -6
- package/src/utils/$account.ts +30 -0
- package/src/utils/$address.ts +5 -0
- package/src/utils/$bigint.ts +56 -3
- package/src/utils/$block.ts +14 -1
- package/src/utils/$bloom.ts +43 -0
- package/src/utils/$buffer.ts +114 -0
- package/src/utils/$cli.ts +16 -0
- package/src/utils/$color.ts +211 -0
- package/src/utils/$config.ts +70 -7
- package/src/utils/$const.ts +1 -0
- package/src/utils/$contract.ts +21 -3
- package/src/utils/$crypto.ts +33 -0
- package/src/utils/$csv.ts +23 -7
- package/src/utils/$date.ts +194 -40
- package/src/utils/$gas.ts +17 -0
- package/src/utils/$hex.ts +72 -0
- package/src/utils/$is.ts +24 -22
- package/src/utils/$logger.ts +60 -2
- package/src/utils/$machine.ts +85 -0
- package/src/utils/$number.ts +24 -1
- package/src/utils/$path.ts +17 -1
- package/src/utils/$promise.ts +101 -0
- package/src/utils/$require.ts +15 -1
- package/src/utils/$secret.ts +27 -0
- package/src/utils/$sign.ts +115 -16
- package/src/utils/$signRaw.ts +50 -0
- package/src/utils/$signSerializer.ts +8 -6
- package/src/utils/$txData.ts +16 -0
- package/src/utils/$wallet.ts +1 -1
- package/test/Batch.spec.ts +89 -0
- package/test/BlockChainExplorer.spec.ts +33 -0
- package/test/ChainAccount.spec.ts +1 -1
- package/test/client.spec.ts +10 -11
- package/test/config.js +8 -0
- package/test/config.spec.ts +31 -0
- package/test/ecrecover.spec.ts +49 -0
- package/test/fixtures/contracts/Counter.sol +25 -0
- package/test/fixtures/contracts/Ecrecover.sol +33 -0
- package/test/fixtures/contracts/Foo.sol +32 -0
- package/test/fixtures/contracts/Foo.ts +78 -0
- package/test/fixtures/contracts/FreeToken.sol +263 -0
- package/test/fixtures/explorer/0xfbD2aa7efA2B46Ce3c58D7ab0D92C176c71499C0.html +2788 -0
- package/test/fixtures/gnosis/GnosisSafe.sol +422 -0
- package/test/fixtures/gnosis/GnosisSafeL2.sol +86 -0
- package/test/fixtures/gnosis/accessors/SimulateTxAccessor.sol +52 -0
- package/test/fixtures/gnosis/base/Executor.sol +27 -0
- package/test/fixtures/gnosis/base/FallbackManager.sol +53 -0
- package/test/fixtures/gnosis/base/GuardManager.sol +62 -0
- package/test/fixtures/gnosis/base/ModuleManager.sol +133 -0
- package/test/fixtures/gnosis/base/OwnerManager.sol +149 -0
- package/test/fixtures/gnosis/common/Enum.sol +8 -0
- package/test/fixtures/gnosis/common/EtherPaymentFallback.sol +13 -0
- package/test/fixtures/gnosis/common/SecuredTokenTransfer.sol +35 -0
- package/test/fixtures/gnosis/common/SelfAuthorized.sol +16 -0
- package/test/fixtures/gnosis/common/SignatureDecoder.sol +36 -0
- package/test/fixtures/gnosis/common/Singleton.sol +11 -0
- package/test/fixtures/gnosis/common/StorageAccessible.sol +47 -0
- package/test/fixtures/gnosis/external/GnosisSafeMath.sol +54 -0
- package/test/fixtures/gnosis/interfaces/ERC1155TokenReceiver.sol +49 -0
- package/test/fixtures/gnosis/interfaces/ERC721TokenReceiver.sol +24 -0
- package/test/fixtures/gnosis/interfaces/ERC777TokensRecipient.sol +13 -0
- package/test/fixtures/gnosis/interfaces/IERC165.sol +15 -0
- package/test/fixtures/gnosis/interfaces/ISignatureValidator.sol +20 -0
- package/test/fixtures/gnosis/interfaces/ViewStorageAccessible.sol +11 -0
- package/test/fixtures/gnosis/libraries/CreateCall.sol +30 -0
- package/test/fixtures/gnosis/libraries/GnosisSafeStorage.sol +21 -0
- package/test/fixtures/gnosis/libraries/MultiSend.sol +66 -0
- package/test/fixtures/gnosis/libraries/MultiSendCallOnly.sol +61 -0
- package/test/fixtures/gnosis/libraries/SignMessageLib.sol +34 -0
- package/test/fixtures/gnosis/proxies/GnosisSafeProxy.sol +44 -0
- package/test/fixtures/gnosis/proxies/GnosisSafeProxyFactory.sol +107 -0
- package/test/fixtures/gnosis/proxies/IProxyCreationCallback.sol +12 -0
- package/test/fixtures/scan/WETH.sol +1533 -0
- package/test/fixtures/slots/FooStorage.sol +8 -0
- package/test/fixtures/slots/FooStorageBase.sol +6 -0
- package/test/fixtures/slots/Vault.sol +85 -0
- package/test/generate/class.spec.ts +144 -6
- package/test/generate/evm.spec.ts +64 -0
- package/test/generate/openzeppelin.spec.ts +18 -0
- package/test/generate/slotreader.spec.ts +34 -0
- package/test/hardhat/TestNode.ts +37 -9
- package/test/hardhat/deploy.spec.ts +22 -0
- package/test/indexer/BlocksWalker.spec.ts +51 -0
- package/test/ns.spec.ts +4 -0
- package/test/receipt.spec.ts +1 -4
- package/test/safe/tx.act.ts +194 -0
- package/test/solidity/SlotsParser.spec.ts +186 -0
- package/test/solidity/SlotsReader.spec.ts +168 -0
- package/test/solidity/Storage.spec.ts +328 -0
- package/test/structs/PackedRanges.spec.ts +56 -0
- package/test/subscriptions.spec.ts +127 -0
- package/test/token.spec.ts +11 -0
- package/test/utils/abi-types.spec.ts +31 -0
- package/test/utils/abi-utils.spec.ts +23 -0
- package/test/utils/bigint.spec.ts +0 -1
- package/test/utils/date.spec.ts +3 -2
- package/test/utils/logbloom.spec.ts +17 -0
- package/test/utils/number.spec.ts +14 -3
- package/test/utils/sign.spec.ts +43 -7
- package/src/ChainAccounts.ts +0 -72
- package/src/structs/PackedRanges.spec.ts +0 -38
|
@@ -15,14 +15,20 @@ const memd_1 = __importDefault(require("memd"));
|
|
|
15
15
|
const axios_1 = __importDefault(require("axios"));
|
|
16
16
|
const _logger_1 = require("@dequanto/utils/$logger");
|
|
17
17
|
const _promise_1 = require("@dequanto/utils/$promise");
|
|
18
|
+
const _address_1 = require("@dequanto/utils/$address");
|
|
19
|
+
const _require_1 = require("@dequanto/utils/$require");
|
|
20
|
+
const Web3ClientFactory_1 = require("@dequanto/clients/Web3ClientFactory");
|
|
21
|
+
const _config_1 = require("@dequanto/utils/$config");
|
|
18
22
|
var BlockChainExplorerFactory;
|
|
19
23
|
(function (BlockChainExplorerFactory) {
|
|
20
24
|
function create(opts) {
|
|
21
25
|
const client = new Client();
|
|
26
|
+
opts = ensureDefaults(opts);
|
|
22
27
|
return class {
|
|
23
|
-
constructor() {
|
|
28
|
+
constructor(platform) {
|
|
29
|
+
this.platform = platform;
|
|
24
30
|
this.localDb = opts.CONTRACTS;
|
|
25
|
-
this.config = opts.getConfig();
|
|
31
|
+
this.config = opts.getConfig(this.platform);
|
|
26
32
|
this.getContractAbi = memd_1.default.fn.memoize(this.getContractAbi, {
|
|
27
33
|
trackRef: true,
|
|
28
34
|
persistance: new memd_1.default.FsTransport({
|
|
@@ -47,13 +53,22 @@ var BlockChainExplorerFactory;
|
|
|
47
53
|
address = info.proxy;
|
|
48
54
|
}
|
|
49
55
|
let url = `${this.config.host}/api?module=contract&action=getabi&address=${address}&apikey=${this.config.key}`;
|
|
50
|
-
let abi
|
|
56
|
+
let abi;
|
|
57
|
+
try {
|
|
58
|
+
abi = await client.get(url);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
let addressByByteCode = await this.getSimilarContract(address);
|
|
62
|
+
if (addressByByteCode != null) {
|
|
63
|
+
_logger_1.$logger.log(`Found similar byte code address: ${addressByByteCode}`);
|
|
64
|
+
return this.getContractAbi(addressByByteCode);
|
|
65
|
+
}
|
|
66
|
+
throw err;
|
|
67
|
+
}
|
|
51
68
|
let abiJson = JSON.parse(abi);
|
|
52
69
|
if (params?.implementation) {
|
|
53
70
|
if (/0x.{64}/.test(params.implementation)) {
|
|
54
|
-
let web3 = opts.getWeb3();
|
|
55
|
-
let stat = await web3.getNodeInfos();
|
|
56
|
-
//-let x = (BigInt($contract.keccak256("eip1967.proxy.implementation")) - 1n).toString(16);
|
|
71
|
+
let web3 = opts.getWeb3(this.platform);
|
|
57
72
|
let uin256Hex = await web3.getStorageAt('0x5a58505a96d1dbf8df91cb21b54419fc36e93fde', `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`);
|
|
58
73
|
let hex = uin256Hex.replace(/0x0+/, '0x');
|
|
59
74
|
return this.getContractAbi(hex);
|
|
@@ -61,13 +76,18 @@ var BlockChainExplorerFactory;
|
|
|
61
76
|
throw new Error(`Implement ${params.implementation} support`);
|
|
62
77
|
}
|
|
63
78
|
if (isOpenZeppelinProxy(abiJson)) {
|
|
64
|
-
let web3 = opts.getWeb3();
|
|
65
|
-
|
|
66
|
-
let
|
|
79
|
+
let web3 = opts.getWeb3(this.platform);
|
|
80
|
+
// (BigInt($contract.keccak256("eip1967.proxy.implementation")) - 1n).toString(16);
|
|
81
|
+
let uint256Hex = await web3.getStorageAt(address, `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`);
|
|
82
|
+
if (_address_1.$address.isEmpty(uint256Hex)) {
|
|
83
|
+
// keccak-256 hash of "org.zeppelinos.proxy.implementation"
|
|
84
|
+
uint256Hex = await web3.getStorageAt(address, `0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3`);
|
|
85
|
+
}
|
|
86
|
+
let hex = uint256Hex.replace(/0x0+/, '0x');
|
|
67
87
|
return this.getContractAbi(hex);
|
|
68
88
|
}
|
|
69
89
|
if (hasImplementationSlot(abiJson)) {
|
|
70
|
-
let web3 = opts.getWeb3();
|
|
90
|
+
let web3 = opts.getWeb3(this.platform);
|
|
71
91
|
let uin256Hex = await web3.readContract({
|
|
72
92
|
address: address,
|
|
73
93
|
abi: abiJson,
|
|
@@ -78,7 +98,7 @@ var BlockChainExplorerFactory;
|
|
|
78
98
|
return this.getContractAbi(hex);
|
|
79
99
|
}
|
|
80
100
|
if (hasTargetSlot(abiJson)) {
|
|
81
|
-
let web3 = opts.getWeb3();
|
|
101
|
+
let web3 = opts.getWeb3(this.platform);
|
|
82
102
|
let uin256Hex = await web3.readContract({
|
|
83
103
|
address: address,
|
|
84
104
|
abi: abiJson,
|
|
@@ -98,8 +118,8 @@ var BlockChainExplorerFactory;
|
|
|
98
118
|
async getTransactions(addr, params) {
|
|
99
119
|
return this.loadTxs('txlist', addr, params);
|
|
100
120
|
}
|
|
101
|
-
async getTransactionsAll(addr) {
|
|
102
|
-
return this.loadTxsAll('txlist', addr);
|
|
121
|
+
async getTransactionsAll(addr, params) {
|
|
122
|
+
return this.loadTxsAll('txlist', addr, params);
|
|
103
123
|
}
|
|
104
124
|
async getInternalTransactions(addr, params) {
|
|
105
125
|
return this.loadTxs('txlistinternal', addr, params);
|
|
@@ -127,6 +147,22 @@ var BlockChainExplorerFactory;
|
|
|
127
147
|
});
|
|
128
148
|
return events;
|
|
129
149
|
}
|
|
150
|
+
async getSimilarContract(address) {
|
|
151
|
+
let url = `${this.config.www}/address/${address}#code`;
|
|
152
|
+
let html = await client.getHtml(url);
|
|
153
|
+
let rgx = /This contract matches/ig;
|
|
154
|
+
let match = rgx.exec(html);
|
|
155
|
+
if (match == null) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
let rgxAddress = /0x[a-f\d]{40}/g;
|
|
159
|
+
rgxAddress.lastIndex = match.index;
|
|
160
|
+
let matchAddress = rgxAddress.exec(html);
|
|
161
|
+
if (matchAddress == null) {
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
164
|
+
return matchAddress[0];
|
|
165
|
+
}
|
|
130
166
|
async loadTxs(type, address, params) {
|
|
131
167
|
let url = `${this.config.host}/api?module=account&action=${type}&address=${address}&sort=${params.sort ?? 'desc'}&apikey=${this.config.key}`;
|
|
132
168
|
if (params.fromBlockNumber != null) {
|
|
@@ -141,11 +177,11 @@ var BlockChainExplorerFactory;
|
|
|
141
177
|
let txs = await client.get(url);
|
|
142
178
|
return txs;
|
|
143
179
|
}
|
|
144
|
-
async loadTxsAll(type, address) {
|
|
180
|
+
async loadTxsAll(type, address, params) {
|
|
145
181
|
let page = 1;
|
|
146
182
|
let size = 1000;
|
|
147
183
|
let out = [];
|
|
148
|
-
let fromBlockNumber =
|
|
184
|
+
let fromBlockNumber = params?.fromBlockNumber;
|
|
149
185
|
while (true) {
|
|
150
186
|
let arr = await this.loadTxs(type, address, { fromBlockNumber, sort: 'asc' });
|
|
151
187
|
out.push(...arr);
|
|
@@ -165,25 +201,80 @@ var BlockChainExplorerFactory;
|
|
|
165
201
|
function isOpenZeppelinProxy(abi) {
|
|
166
202
|
let $interface = ['upgradeTo', 'implementation'];
|
|
167
203
|
return $interface.every(name => {
|
|
168
|
-
return abi
|
|
204
|
+
return hasMethod(abi, name);
|
|
169
205
|
});
|
|
170
206
|
}
|
|
171
207
|
function hasImplementationSlot(abi) {
|
|
172
|
-
let $
|
|
173
|
-
|
|
174
|
-
return abi
|
|
208
|
+
let $required = ['implementation'];
|
|
209
|
+
let hasRequired = $required.every(name => {
|
|
210
|
+
return hasMethod(abi, name);
|
|
175
211
|
});
|
|
212
|
+
if (hasRequired === false) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
let $some = ['proxyOwner', 'proxyType'];
|
|
216
|
+
let hasOneOf = $some.some(name => {
|
|
217
|
+
return hasMethod(abi, name);
|
|
218
|
+
});
|
|
219
|
+
if (hasOneOf === false) {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
return true;
|
|
176
223
|
}
|
|
177
224
|
function hasTargetSlot(abi) {
|
|
178
225
|
let $interface = ['upgrade', 'getTarget'];
|
|
179
226
|
return $interface.every(name => {
|
|
180
|
-
return abi
|
|
227
|
+
return hasMethod(abi, name);
|
|
181
228
|
});
|
|
182
229
|
}
|
|
230
|
+
function hasMethod(abi, name) {
|
|
231
|
+
return abi.some(item => item.type === 'function' && item.name === name);
|
|
232
|
+
}
|
|
233
|
+
function ensureDefaults(opts) {
|
|
234
|
+
opts ?? (opts = {});
|
|
235
|
+
let hasNull = opts.ABI_CACHE == null
|
|
236
|
+
|| opts.CONTRACTS == null
|
|
237
|
+
|| opts.getConfig == null
|
|
238
|
+
|| opts.getWeb3 == null;
|
|
239
|
+
if (hasNull === false) {
|
|
240
|
+
return opts;
|
|
241
|
+
}
|
|
242
|
+
let platform = opts.platform;
|
|
243
|
+
_require_1.$require.notNull(platform, `Generic Blockchain Explorer Config should contain platform name`);
|
|
244
|
+
opts.ABI_CACHE ?? (opts.ABI_CACHE = `./cache/${platform}/abis.json`);
|
|
245
|
+
opts.CONTRACTS ?? (opts.CONTRACTS = []);
|
|
246
|
+
opts.getWeb3 ?? (opts.getWeb3 = (_) => {
|
|
247
|
+
return Web3ClientFactory_1.Web3ClientFactory.get(platform);
|
|
248
|
+
});
|
|
249
|
+
opts.getConfig ?? (opts.getConfig = () => {
|
|
250
|
+
let config = _config_1.$config.get(`blockchainExplorer.${platform}`);
|
|
251
|
+
let mainnet = /(?<mainnet>\w+):/.exec(platform)?.groups?.mainnet;
|
|
252
|
+
if (mainnet != null) {
|
|
253
|
+
let mainnetConfig = _config_1.$config.get(`blockchainExplorer.${mainnet}`);
|
|
254
|
+
config = {
|
|
255
|
+
...(mainnetConfig ?? {}),
|
|
256
|
+
...(config ?? {})
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
return {
|
|
260
|
+
key: config?.key,
|
|
261
|
+
host: config?.host,
|
|
262
|
+
www: config?.www,
|
|
263
|
+
};
|
|
264
|
+
});
|
|
265
|
+
return opts;
|
|
266
|
+
}
|
|
183
267
|
class Client {
|
|
184
268
|
async get(url) {
|
|
185
269
|
return this.getInner(url);
|
|
186
270
|
}
|
|
271
|
+
async getHtml(url) {
|
|
272
|
+
let resp = await axios_1.default.get(url);
|
|
273
|
+
if (resp.status !== 200) {
|
|
274
|
+
throw new Error(`${url} not loaded with status ${resp.status}.`);
|
|
275
|
+
}
|
|
276
|
+
return resp.data;
|
|
277
|
+
}
|
|
187
278
|
async getPaged(url) {
|
|
188
279
|
let arr = [];
|
|
189
280
|
let page = 1;
|
|
@@ -225,3 +316,6 @@ class Client {
|
|
|
225
316
|
__decorate([
|
|
226
317
|
memd_1.default.deco.queued({ throttle: 1000 / 5 })
|
|
227
318
|
], Client.prototype, "get", null);
|
|
319
|
+
__decorate([
|
|
320
|
+
memd_1.default.deco.queued({ throttle: 1000 / 5 })
|
|
321
|
+
], Client.prototype, "getHtml", null);
|
|
@@ -10,6 +10,8 @@ const Bscscan_1 = require("./Bscscan");
|
|
|
10
10
|
const Etherscan_1 = require("./Etherscan");
|
|
11
11
|
const Polyscan_1 = require("./Polyscan");
|
|
12
12
|
const XDaiscan_1 = require("@dequanto/chains/xdai/XDaiscan");
|
|
13
|
+
const _config_1 = require("@dequanto/utils/$config");
|
|
14
|
+
const Evmscan_1 = require("./Evmscan");
|
|
13
15
|
var BlockChainExplorerProvider;
|
|
14
16
|
(function (BlockChainExplorerProvider) {
|
|
15
17
|
function get(platform) {
|
|
@@ -24,7 +26,13 @@ var BlockChainExplorerProvider;
|
|
|
24
26
|
return a_di_1.default.resolve(Arbiscan_1.Arbiscan);
|
|
25
27
|
case 'xdai':
|
|
26
28
|
return a_di_1.default.resolve(XDaiscan_1.XDaiscan);
|
|
29
|
+
case 'hardhat':
|
|
30
|
+
return null;
|
|
27
31
|
default:
|
|
32
|
+
let cfg = _config_1.$config.get(`blockchainExplorer.${platform}`);
|
|
33
|
+
if (cfg != null) {
|
|
34
|
+
return (0, Evmscan_1.Evmscan)({ platform });
|
|
35
|
+
}
|
|
28
36
|
throw new Error(`Unsupported platform ${platform} for block chain explorer`);
|
|
29
37
|
}
|
|
30
38
|
}
|
|
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Etherscan = void 0;
|
|
7
|
-
const
|
|
7
|
+
const a_di_1 = __importDefault(require("a-di"));
|
|
8
8
|
const _config_1 = require("@dequanto/utils/$config");
|
|
9
9
|
const EthWeb3Client_1 = require("@dequanto/clients/EthWeb3Client");
|
|
10
|
-
const
|
|
10
|
+
const BlockChainExplorerFactory_1 = require("./BlockChainExplorerFactory");
|
|
11
11
|
const contracts = _config_1.$config.get('contracts.eth', []);
|
|
12
12
|
class Etherscan extends BlockChainExplorerFactory_1.BlockChainExplorerFactory.create({
|
|
13
13
|
ABI_CACHE: `./cache/eth/abis.json`,
|
|
@@ -15,11 +15,21 @@ class Etherscan extends BlockChainExplorerFactory_1.BlockChainExplorerFactory.cr
|
|
|
15
15
|
getWeb3() {
|
|
16
16
|
return a_di_1.default.resolve(EthWeb3Client_1.EthWeb3Client);
|
|
17
17
|
},
|
|
18
|
-
getConfig() {
|
|
19
|
-
|
|
18
|
+
getConfig(platform) {
|
|
19
|
+
platform ?? (platform = 'eth');
|
|
20
|
+
let config = _config_1.$config.get(`blockchainExplorer.${platform}`);
|
|
21
|
+
let mainnet = /(?<mainnet>\w+):/.exec(platform)?.groups?.mainnet;
|
|
22
|
+
if (mainnet != null) {
|
|
23
|
+
let mainnetConfig = _config_1.$config.get(`blockchainExplorer.${mainnet}`);
|
|
24
|
+
config = {
|
|
25
|
+
...(mainnetConfig ?? {}),
|
|
26
|
+
...(config ?? {})
|
|
27
|
+
};
|
|
28
|
+
}
|
|
20
29
|
return {
|
|
21
30
|
key: config?.key,
|
|
22
31
|
host: config?.host,
|
|
32
|
+
www: config?.www,
|
|
23
33
|
};
|
|
24
34
|
}
|
|
25
35
|
}) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Evmscan = void 0;
|
|
4
|
+
const BlockChainExplorerFactory_1 = require("./BlockChainExplorerFactory");
|
|
5
|
+
function Evmscan(options) {
|
|
6
|
+
const ClientConstructor = BlockChainExplorerFactory_1.BlockChainExplorerFactory.create(options);
|
|
7
|
+
return new ClientConstructor();
|
|
8
|
+
}
|
|
9
|
+
exports.Evmscan = Evmscan;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ChainAccountProvider = void 0;
|
|
13
|
+
const memd_1 = __importDefault(require("memd"));
|
|
14
|
+
const _config_1 = require("./utils/$config");
|
|
15
|
+
const ethers_1 = require("ethers");
|
|
16
|
+
const _address_1 = require("./utils/$address");
|
|
17
|
+
const _crypto_1 = require("./utils/$crypto");
|
|
18
|
+
const _buffer_1 = require("./utils/$buffer");
|
|
19
|
+
var ChainAccountProvider;
|
|
20
|
+
(function (ChainAccountProvider) {
|
|
21
|
+
function get(platform, name) {
|
|
22
|
+
let accounts = AccountsConfigProvider.get();
|
|
23
|
+
let acc = accounts?.[platform]?.[name];
|
|
24
|
+
if (acc == null) {
|
|
25
|
+
throw new Error(`Account not resolved by name: ${name} in ${platform}`);
|
|
26
|
+
}
|
|
27
|
+
acc.name = name;
|
|
28
|
+
acc.platform = platform;
|
|
29
|
+
return acc;
|
|
30
|
+
}
|
|
31
|
+
ChainAccountProvider.get = get;
|
|
32
|
+
function tryGet(mix, platform) {
|
|
33
|
+
let all = this.getAll();
|
|
34
|
+
let accounts = all.filter(x => (_address_1.$address.eq(mix, x.address) || x.name == mix));
|
|
35
|
+
if (accounts.length === 0) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
let acc = accounts[0];
|
|
39
|
+
return {
|
|
40
|
+
...acc,
|
|
41
|
+
platform: platform ?? acc.platform
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
ChainAccountProvider.tryGet = tryGet;
|
|
45
|
+
function getAll() {
|
|
46
|
+
return AccountsConfigProvider.get();
|
|
47
|
+
}
|
|
48
|
+
ChainAccountProvider.getAll = getAll;
|
|
49
|
+
function getAddressFromKey(key) {
|
|
50
|
+
const bytes = _buffer_1.$buffer.fromHex(key);
|
|
51
|
+
const wallet = new ethers_1.Wallet(bytes);
|
|
52
|
+
return wallet.address;
|
|
53
|
+
}
|
|
54
|
+
ChainAccountProvider.getAddressFromKey = getAddressFromKey;
|
|
55
|
+
function generate(opts) {
|
|
56
|
+
const bytes = _crypto_1.$crypto.randomBytes(32);
|
|
57
|
+
const wallet = new ethers_1.Wallet(bytes);
|
|
58
|
+
return {
|
|
59
|
+
...(opts ?? {}),
|
|
60
|
+
address: wallet.address,
|
|
61
|
+
key: wallet.privateKey,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
ChainAccountProvider.generate = generate;
|
|
65
|
+
class AccountsConfigProvider {
|
|
66
|
+
static get() {
|
|
67
|
+
let accounts = _config_1.$config.get('accounts');
|
|
68
|
+
if (accounts == null) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
if (Array.isArray(accounts)) {
|
|
72
|
+
return accounts;
|
|
73
|
+
}
|
|
74
|
+
let out = [];
|
|
75
|
+
for (let platform in accounts) {
|
|
76
|
+
for (let name in accounts[platform]) {
|
|
77
|
+
let account = accounts[platform][name];
|
|
78
|
+
account.name = name;
|
|
79
|
+
account.platform = platform;
|
|
80
|
+
out.push(account);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
__decorate([
|
|
87
|
+
memd_1.default.deco.memoize()
|
|
88
|
+
], AccountsConfigProvider, "get", null);
|
|
89
|
+
})(ChainAccountProvider = exports.ChainAccountProvider || (exports.ChainAccountProvider = {}));
|
|
@@ -6,15 +6,33 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.ChainAccountsService = void 0;
|
|
7
7
|
const a_di_1 = __importDefault(require("a-di"));
|
|
8
8
|
const alot_1 = __importDefault(require("alot"));
|
|
9
|
-
const
|
|
9
|
+
const ChainAccountProvider_1 = require("./ChainAccountProvider");
|
|
10
10
|
const JsonArrayStore_1 = require("./json/JsonArrayStore");
|
|
11
|
+
const NameService_1 = require("./ns/NameService");
|
|
11
12
|
const _address_1 = require("./utils/$address");
|
|
13
|
+
const _is_1 = require("./utils/$is");
|
|
12
14
|
class ChainAccountsService {
|
|
13
15
|
constructor() {
|
|
14
16
|
this.store = a_di_1.default.resolve(Store);
|
|
15
|
-
this.config =
|
|
17
|
+
this.config = ChainAccountProvider_1.ChainAccountProvider;
|
|
16
18
|
}
|
|
17
19
|
async get(mix, platform) {
|
|
20
|
+
if (_is_1.$is.hexString(mix) && mix.length >= 64) {
|
|
21
|
+
return {
|
|
22
|
+
address: ChainAccountProvider_1.ChainAccountProvider.getAddressFromKey(mix),
|
|
23
|
+
key: mix
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (_address_1.$address.isValid(mix) === false) {
|
|
27
|
+
// Check NS
|
|
28
|
+
let ns = a_di_1.default.resolve(NameService_1.NameService);
|
|
29
|
+
if (ns.supports(mix)) {
|
|
30
|
+
let address = await ns.getAddress(mix);
|
|
31
|
+
if (address) {
|
|
32
|
+
mix = address;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
18
36
|
let acc = this.config.tryGet(mix, platform);
|
|
19
37
|
return acc ?? this.store.get(mix);
|
|
20
38
|
}
|
package/dist/src/Config.js
CHANGED
|
@@ -1,7 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.config = exports.Config = void 0;
|
|
13
|
+
const memd_1 = __importDefault(require("memd"));
|
|
14
|
+
const appcfg_1 = __importDefault(require("appcfg"));
|
|
15
|
+
const _secret_1 = require("./utils/$secret");
|
|
16
|
+
const _cli_1 = require("./utils/$cli");
|
|
17
|
+
const atma_utils_1 = require("atma-utils");
|
|
18
|
+
const atma_io_1 = require("atma-io");
|
|
4
19
|
class Config {
|
|
20
|
+
static async fetch(parameters) {
|
|
21
|
+
let unlockedAccountsKey = await _secret_1.$secret.getPin(parameters);
|
|
22
|
+
let configPathAccounts = _cli_1.$cli.getParamValue('config-accounts', parameters) ?? '%APPDATA%/.dequanto/accounts.json';
|
|
23
|
+
let configPathGlobal = _cli_1.$cli.getParamValue('config-global', parameters) ?? '%APPDATA%/.dequanto/config.yml';
|
|
24
|
+
let dequantoConfigs = 'dequanto/configs/';
|
|
25
|
+
let [
|
|
26
|
+
//- inApp,
|
|
27
|
+
inCwd, inNodeModules,] = await Promise.all([
|
|
28
|
+
//- Directory.existsAsync(env.applicationDir.combine(`./${dequantoConfigs}`).toString()),
|
|
29
|
+
atma_io_1.Directory.existsAsync(`./${dequantoConfigs}`),
|
|
30
|
+
atma_io_1.Directory.existsAsync(`./node_modules/${dequantoConfigs}`),
|
|
31
|
+
]);
|
|
32
|
+
let prfx = '%APP%/';
|
|
33
|
+
if (inNodeModules) {
|
|
34
|
+
prfx = './node_modules/';
|
|
35
|
+
}
|
|
36
|
+
if (inCwd) {
|
|
37
|
+
prfx = './';
|
|
38
|
+
}
|
|
39
|
+
let cfg = await appcfg_1.default.fetch([
|
|
40
|
+
{
|
|
41
|
+
path: `${prfx}${dequantoConfigs}dequanto.yml`,
|
|
42
|
+
optional: true,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
path: `${prfx}${dequantoConfigs}defi.yml`,
|
|
46
|
+
optional: true,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
path: configPathGlobal,
|
|
50
|
+
writable: true,
|
|
51
|
+
optional: true,
|
|
52
|
+
extendArrays: false,
|
|
53
|
+
},
|
|
54
|
+
unlockedAccountsKey ? {
|
|
55
|
+
name: 'accounts',
|
|
56
|
+
path: configPathAccounts,
|
|
57
|
+
writable: true,
|
|
58
|
+
optional: true,
|
|
59
|
+
secret: unlockedAccountsKey
|
|
60
|
+
} : null,
|
|
61
|
+
{
|
|
62
|
+
path: 'package.json',
|
|
63
|
+
getterProperty: 'dequanto',
|
|
64
|
+
optional: true,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
path: 'dequanto.yml',
|
|
68
|
+
optional: true
|
|
69
|
+
},
|
|
70
|
+
]);
|
|
71
|
+
(0, atma_utils_1.obj_extend)(exports.config, cfg.toJSON());
|
|
72
|
+
return cfg;
|
|
73
|
+
}
|
|
74
|
+
static async extend(json) {
|
|
75
|
+
let current = await Config.fetch();
|
|
76
|
+
await current.$write(json);
|
|
77
|
+
}
|
|
5
78
|
}
|
|
79
|
+
__decorate([
|
|
80
|
+
memd_1.default.deco.memoize()
|
|
81
|
+
], Config, "fetch", null);
|
|
6
82
|
exports.Config = Config;
|
|
7
83
|
exports.config = new Config();
|
|
@@ -10,18 +10,15 @@ class BlockDateResolver {
|
|
|
10
10
|
constructor(client) {
|
|
11
11
|
this.client = client;
|
|
12
12
|
this.AVG_INITIAL = {
|
|
13
|
-
eth:
|
|
14
|
-
bsc:
|
|
15
|
-
polygon:
|
|
13
|
+
eth: 12000,
|
|
14
|
+
bsc: 3000,
|
|
15
|
+
polygon: 3000,
|
|
16
16
|
};
|
|
17
17
|
this.known = [];
|
|
18
18
|
}
|
|
19
19
|
async getBlockNumberFor(date) {
|
|
20
20
|
this.q = date;
|
|
21
|
-
let avg = this.AVG_INITIAL[this.client.platform];
|
|
22
|
-
if (avg == null) {
|
|
23
|
-
throw new Error(`AVG Block Time not defined for ${this.client.platform}`);
|
|
24
|
-
}
|
|
21
|
+
let avg = this.AVG_INITIAL[this.client.platform] ?? this.AVG_INITIAL['eth'];
|
|
25
22
|
let now = new Date();
|
|
26
23
|
let topBlock = {
|
|
27
24
|
blockNumber: await this.client.getBlockNumberCached(),
|
|
@@ -69,6 +66,9 @@ class BlockDateResolver {
|
|
|
69
66
|
return null;
|
|
70
67
|
}
|
|
71
68
|
let blockNumber = anchor.blockNumber + diffCount;
|
|
69
|
+
if (blockNumber < 0) {
|
|
70
|
+
throw new Error(`Date Out of range: ${this.q.toISOString()}. Based on the AVG block time, the blockchain was not active on that date`);
|
|
71
|
+
}
|
|
72
72
|
let date = await this.getBlockDate(blockNumber);
|
|
73
73
|
let info = {
|
|
74
74
|
blockNumber: blockNumber,
|
|
@@ -78,6 +78,7 @@ class BlockDateResolver {
|
|
|
78
78
|
this.refineAvg();
|
|
79
79
|
return info;
|
|
80
80
|
}
|
|
81
|
+
/** Add a know block to set */
|
|
81
82
|
push(info) {
|
|
82
83
|
for (let i = 0; i < this.known.length; i++) {
|
|
83
84
|
let x = this.known[i];
|
|
@@ -110,7 +111,7 @@ class BlockDateResolver {
|
|
|
110
111
|
let diff = this.diffTimeAbs(b1.date, b2.date);
|
|
111
112
|
return Math.round(diff / Math.abs(b2.blockNumber - b1.blockNumber));
|
|
112
113
|
}
|
|
113
|
-
/**
|
|
114
|
+
/** With N>1 blocks we can better find out the AVG block time */
|
|
114
115
|
refineAvg() {
|
|
115
116
|
for (let i = 1; i < this.known.length; i++) {
|
|
116
117
|
let info = this.known[i];
|
|
@@ -18,11 +18,11 @@ const atma_utils_1 = require("atma-utils");
|
|
|
18
18
|
const Dai_l2AmmWrapperContract_1 = require("./contracts/polygon/Dai_l2AmmWrapperContract");
|
|
19
19
|
const HopAddresses_1 = require("./HopAddresses");
|
|
20
20
|
const Dai_l2BridgeContract_1 = require("./contracts/polygon/Dai_l2BridgeContract");
|
|
21
|
-
const _fn_1 = require("@dequanto/utils/$fn");
|
|
22
21
|
const PlatformFactory_1 = require("@dequanto/chains/PlatformFactory");
|
|
23
22
|
const _require_1 = require("@dequanto/utils/$require");
|
|
24
23
|
const Dai_l2SaddleSwapContract_1 = require("./contracts/polygon/Dai_l2SaddleSwapContract");
|
|
25
24
|
const _address_1 = require("@dequanto/utils/$address");
|
|
25
|
+
const _promise_1 = require("@dequanto/utils/$promise");
|
|
26
26
|
class HopBridge {
|
|
27
27
|
constructor() {
|
|
28
28
|
this.name = 'hop';
|
|
@@ -148,6 +148,8 @@ class HopBridge {
|
|
|
148
148
|
estimatedReceived: BigInt(sendData.estimatedReceived.toString()),
|
|
149
149
|
amountOut: BigInt(sendData.amountOut.toString())
|
|
150
150
|
};
|
|
151
|
+
// decrease awaitence
|
|
152
|
+
params.amountOut = _bigint_1.$bigint.multWithFloat(params.amountOut, .98);
|
|
151
153
|
let txWriter = await depositContract
|
|
152
154
|
.$config({
|
|
153
155
|
gasLimit: 300000,
|
|
@@ -173,13 +175,14 @@ class HopBridge {
|
|
|
173
175
|
result.txTransferId.resolve(event.transferId);
|
|
174
176
|
}
|
|
175
177
|
catch (error) {
|
|
178
|
+
console.log(`HopBridge transfer ${error.message}`);
|
|
176
179
|
result.txTransferId.reject(error);
|
|
177
180
|
}
|
|
178
181
|
}());
|
|
179
182
|
return result;
|
|
180
183
|
}
|
|
181
184
|
async waitForTransfer(transferId, symbol, toPlatform, toAccount) {
|
|
182
|
-
let r = await
|
|
185
|
+
let r = await _promise_1.$promise.waitForObject(async () => {
|
|
183
186
|
let val = await this.status(transferId, symbol, toPlatform);
|
|
184
187
|
console.log(`${_date_1.$date.format(new Date(), 'HH:mm')} Checked for bridge transfer completion: ${val}`);
|
|
185
188
|
if (val) {
|
|
@@ -18,8 +18,8 @@ const TokensServiceFactory_1 = require("@dequanto/tokens/TokensServiceFactory");
|
|
|
18
18
|
const TokenTransferService_1 = require("@dequanto/tokens/TokenTransferService");
|
|
19
19
|
const memd_1 = __importDefault(require("memd"));
|
|
20
20
|
class PlatformFactory {
|
|
21
|
-
async get(platform) {
|
|
22
|
-
let client = Web3ClientFactory_1.Web3ClientFactory.get(platform);
|
|
21
|
+
async get(platform, opts) {
|
|
22
|
+
let client = Web3ClientFactory_1.Web3ClientFactory.get(platform, opts);
|
|
23
23
|
let tokens = TokensServiceFactory_1.TokensServiceFactory.get(platform);
|
|
24
24
|
let explorer = BlockChainExplorerProvider_1.BlockChainExplorerProvider.get(platform);
|
|
25
25
|
let accounts = new ChainAccountsService_1.ChainAccountsService();
|
|
@@ -1,39 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.ArbWeb3Client = void 0;
|
|
7
4
|
const _config_1 = require("@dequanto/utils/$config");
|
|
8
|
-
const tx_1 = require("@ethereumjs/tx");
|
|
9
|
-
const common_1 = __importDefault(require("@ethereumjs/common"));
|
|
10
5
|
const Web3Client_1 = require("@dequanto/clients/Web3Client");
|
|
11
6
|
const ClientEndpoints_1 = require("@dequanto/clients/utils/ClientEndpoints");
|
|
12
7
|
class ArbWeb3Client extends Web3Client_1.Web3Client {
|
|
13
8
|
constructor(opts) {
|
|
14
|
-
super(
|
|
9
|
+
super({
|
|
10
|
+
...(opts ?? {}),
|
|
11
|
+
endpoints: ClientEndpoints_1.ClientEndpoints.filterEndpoints(_config_1.$config.get('web3.arbitrum.endpoints'), opts)
|
|
12
|
+
});
|
|
15
13
|
this.platform = 'arbitrum';
|
|
16
|
-
this.chainId = 42161;
|
|
14
|
+
this.chainId = this.options.chainId ?? 42161;
|
|
17
15
|
this.chainToken = 'ETH';
|
|
18
16
|
this.TIMEOUT = 15 * 60 * 1000;
|
|
19
17
|
this.defaultGasLimit = 2000000;
|
|
20
18
|
}
|
|
21
|
-
sign(txData, privateKey) {
|
|
22
|
-
const key = Buffer.from(privateKey, 'hex');
|
|
23
|
-
const common = new common_1.default({
|
|
24
|
-
chain: 42161,
|
|
25
|
-
customChains: [{
|
|
26
|
-
chainId: 42161,
|
|
27
|
-
networkId: 42161,
|
|
28
|
-
url: 'https://arb1.arbitrum.io/rpc',
|
|
29
|
-
name: 'aeth',
|
|
30
|
-
comment: '',
|
|
31
|
-
hardforks: [{ name: 'mainnet' }]
|
|
32
|
-
}]
|
|
33
|
-
});
|
|
34
|
-
const tx = tx_1.Transaction.fromTxData(txData, { common });
|
|
35
|
-
const signedTx = tx.sign(key);
|
|
36
|
-
return signedTx.serialize();
|
|
37
|
-
}
|
|
38
19
|
}
|
|
39
20
|
exports.ArbWeb3Client = ArbWeb3Client;
|