@across-protocol/sdk 3.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/LICENSE +661 -0
- package/README.md +116 -0
- package/dist/cjs/apiClient/abstractClient.d.ts +13 -0
- package/dist/cjs/apiClient/abstractClient.js +17 -0
- package/dist/cjs/apiClient/abstractClient.js.map +1 -0
- package/dist/cjs/apiClient/index.d.ts +2 -0
- package/dist/cjs/apiClient/index.js +11 -0
- package/dist/cjs/apiClient/index.js.map +1 -0
- package/dist/cjs/apiClient/mockedClient.d.ts +11 -0
- package/dist/cjs/apiClient/mockedClient.js +60 -0
- package/dist/cjs/apiClient/mockedClient.js.map +1 -0
- package/dist/cjs/apiClient/productionClient.d.ts +10 -0
- package/dist/cjs/apiClient/productionClient.js +110 -0
- package/dist/cjs/apiClient/productionClient.js.map +1 -0
- package/dist/cjs/apiClient/types.d.ts +44 -0
- package/dist/cjs/apiClient/types.js +3 -0
- package/dist/cjs/apiClient/types.js.map +1 -0
- package/dist/cjs/caching/Arweave/ArweaveClient.d.ts +20 -0
- package/dist/cjs/caching/Arweave/ArweaveClient.js +218 -0
- package/dist/cjs/caching/Arweave/ArweaveClient.js.map +1 -0
- package/dist/cjs/caching/Arweave/index.d.ts +1 -0
- package/dist/cjs/caching/Arweave/index.js +5 -0
- package/dist/cjs/caching/Arweave/index.js.map +1 -0
- package/dist/cjs/caching/IPFS/PinataIPFSClient.d.ts +11 -0
- package/dist/cjs/caching/IPFS/PinataIPFSClient.js +67 -0
- package/dist/cjs/caching/IPFS/PinataIPFSClient.js.map +1 -0
- package/dist/cjs/caching/IPFS/index.d.ts +1 -0
- package/dist/cjs/caching/IPFS/index.js +5 -0
- package/dist/cjs/caching/IPFS/index.js.map +1 -0
- package/dist/cjs/caching/index.d.ts +2 -0
- package/dist/cjs/caching/index.js +6 -0
- package/dist/cjs/caching/index.js.map +1 -0
- package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +66 -0
- package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +377 -0
- package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -0
- package/dist/cjs/clients/AcrossConfigStoreClient/index.d.ts +1 -0
- package/dist/cjs/clients/AcrossConfigStoreClient/index.js +5 -0
- package/dist/cjs/clients/AcrossConfigStoreClient/index.js.map +1 -0
- package/dist/cjs/clients/BaseAbstractClient.d.ts +22 -0
- package/dist/cjs/clients/BaseAbstractClient.js +76 -0
- package/dist/cjs/clients/BaseAbstractClient.js.map +1 -0
- package/dist/cjs/clients/HubPoolClient.d.ts +111 -0
- package/dist/cjs/clients/HubPoolClient.js +758 -0
- package/dist/cjs/clients/HubPoolClient.js.map +1 -0
- package/dist/cjs/clients/SpokePoolClient.d.ts +117 -0
- package/dist/cjs/clients/SpokePoolClient.js +553 -0
- package/dist/cjs/clients/SpokePoolClient.js.map +1 -0
- package/dist/cjs/clients/index.d.ts +4 -0
- package/dist/cjs/clients/index.js +14 -0
- package/dist/cjs/clients/index.js.map +1 -0
- package/dist/cjs/clients/mocks/MockConfigStoreClient.d.ts +20 -0
- package/dist/cjs/clients/mocks/MockConfigStoreClient.js +121 -0
- package/dist/cjs/clients/mocks/MockConfigStoreClient.js.map +1 -0
- package/dist/cjs/clients/mocks/MockEvents.d.ts +27 -0
- package/dist/cjs/clients/mocks/MockEvents.js +117 -0
- package/dist/cjs/clients/mocks/MockEvents.js.map +1 -0
- package/dist/cjs/clients/mocks/MockHubPoolClient.d.ts +35 -0
- package/dist/cjs/clients/mocks/MockHubPoolClient.js +222 -0
- package/dist/cjs/clients/mocks/MockHubPoolClient.js.map +1 -0
- package/dist/cjs/clients/mocks/MockSpokePoolClient.d.ts +38 -0
- package/dist/cjs/clients/mocks/MockSpokePoolClient.js +319 -0
- package/dist/cjs/clients/mocks/MockSpokePoolClient.js.map +1 -0
- package/dist/cjs/clients/mocks/index.d.ts +3 -0
- package/dist/cjs/clients/mocks/index.js +7 -0
- package/dist/cjs/clients/mocks/index.js.map +1 -0
- package/dist/cjs/coingecko/Coingecko.d.ts +40 -0
- package/dist/cjs/coingecko/Coingecko.js +277 -0
- package/dist/cjs/coingecko/Coingecko.js.map +1 -0
- package/dist/cjs/coingecko/index.d.ts +1 -0
- package/dist/cjs/coingecko/index.js +5 -0
- package/dist/cjs/coingecko/index.js.map +1 -0
- package/dist/cjs/constants.d.ts +18 -0
- package/dist/cjs/constants.js +27 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/contracts/acrossConfigStore.d.ts +57 -0
- package/dist/cjs/contracts/acrossConfigStore.js +65 -0
- package/dist/cjs/contracts/acrossConfigStore.js.map +1 -0
- package/dist/cjs/contracts/hubPool.d.ts +17 -0
- package/dist/cjs/contracts/hubPool.js +61 -0
- package/dist/cjs/contracts/hubPool.js.map +1 -0
- package/dist/cjs/contracts/index.d.ts +2 -0
- package/dist/cjs/contracts/index.js +7 -0
- package/dist/cjs/contracts/index.js.map +1 -0
- package/dist/cjs/contracts/utils.d.ts +15 -0
- package/dist/cjs/contracts/utils.js +40 -0
- package/dist/cjs/contracts/utils.js.map +1 -0
- package/dist/cjs/gasPriceOracle/adapters/arbitrum.d.ts +3 -0
- package/dist/cjs/gasPriceOracle/adapters/arbitrum.js +25 -0
- package/dist/cjs/gasPriceOracle/adapters/arbitrum.js.map +1 -0
- package/dist/cjs/gasPriceOracle/adapters/ethereum.d.ts +4 -0
- package/dist/cjs/gasPriceOracle/adapters/ethereum.js +46 -0
- package/dist/cjs/gasPriceOracle/adapters/ethereum.js.map +1 -0
- package/dist/cjs/gasPriceOracle/adapters/index.d.ts +3 -0
- package/dist/cjs/gasPriceOracle/adapters/index.js +7 -0
- package/dist/cjs/gasPriceOracle/adapters/index.js.map +1 -0
- package/dist/cjs/gasPriceOracle/adapters/polygon.d.ts +3 -0
- package/dist/cjs/gasPriceOracle/adapters/polygon.js +77 -0
- package/dist/cjs/gasPriceOracle/adapters/polygon.js.map +1 -0
- package/dist/cjs/gasPriceOracle/index.d.ts +2 -0
- package/dist/cjs/gasPriceOracle/index.js +6 -0
- package/dist/cjs/gasPriceOracle/index.js.map +1 -0
- package/dist/cjs/gasPriceOracle/oracle.d.ts +3 -0
- package/dist/cjs/gasPriceOracle/oracle.js +45 -0
- package/dist/cjs/gasPriceOracle/oracle.js.map +1 -0
- package/dist/cjs/gasPriceOracle/types.d.ts +8 -0
- package/dist/cjs/gasPriceOracle/types.js +3 -0
- package/dist/cjs/gasPriceOracle/types.js.map +1 -0
- package/dist/cjs/gasPriceOracle/util.d.ts +2 -0
- package/dist/cjs/gasPriceOracle/util.js +8 -0
- package/dist/cjs/gasPriceOracle/util.js.map +1 -0
- package/dist/cjs/index.d.ts +15 -0
- package/dist/cjs/index.js +20 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/interfaces/Bridge.d.ts +9 -0
- package/dist/cjs/interfaces/Bridge.js +3 -0
- package/dist/cjs/interfaces/Bridge.js.map +1 -0
- package/dist/cjs/interfaces/CachingMechanism.d.ts +5 -0
- package/dist/cjs/interfaces/CachingMechanism.js +3 -0
- package/dist/cjs/interfaces/CachingMechanism.js.map +1 -0
- package/dist/cjs/interfaces/Common.d.ts +10 -0
- package/dist/cjs/interfaces/Common.js +3 -0
- package/dist/cjs/interfaces/Common.js.map +1 -0
- package/dist/cjs/interfaces/ConfigStore.d.ts +81 -0
- package/dist/cjs/interfaces/ConfigStore.js +3 -0
- package/dist/cjs/interfaces/ConfigStore.js.map +1 -0
- package/dist/cjs/interfaces/Error.d.ts +5 -0
- package/dist/cjs/interfaces/Error.js +3 -0
- package/dist/cjs/interfaces/Error.js.map +1 -0
- package/dist/cjs/interfaces/HubPool.d.ts +98 -0
- package/dist/cjs/interfaces/HubPool.js +3 -0
- package/dist/cjs/interfaces/HubPool.js.map +1 -0
- package/dist/cjs/interfaces/SpokePool.d.ts +103 -0
- package/dist/cjs/interfaces/SpokePool.js +16 -0
- package/dist/cjs/interfaces/SpokePool.js.map +1 -0
- package/dist/cjs/interfaces/TypedData.d.ts +19 -0
- package/dist/cjs/interfaces/TypedData.js +3 -0
- package/dist/cjs/interfaces/TypedData.js.map +1 -0
- package/dist/cjs/interfaces/index.d.ts +8 -0
- package/dist/cjs/interfaces/index.js +12 -0
- package/dist/cjs/interfaces/index.js.map +1 -0
- package/dist/cjs/lpFeeCalculator/index.d.ts +1 -0
- package/dist/cjs/lpFeeCalculator/index.js +5 -0
- package/dist/cjs/lpFeeCalculator/index.js.map +1 -0
- package/dist/cjs/lpFeeCalculator/lpFeeCalculator.d.ts +19 -0
- package/dist/cjs/lpFeeCalculator/lpFeeCalculator.js +79 -0
- package/dist/cjs/lpFeeCalculator/lpFeeCalculator.js.map +1 -0
- package/dist/cjs/lpFeeCalculator/rateModel.d.ts +28 -0
- package/dist/cjs/lpFeeCalculator/rateModel.js +103 -0
- package/dist/cjs/lpFeeCalculator/rateModel.js.map +1 -0
- package/dist/cjs/merkleDistributor/MerkleDistributor.d.ts +8 -0
- package/dist/cjs/merkleDistributor/MerkleDistributor.js +25 -0
- package/dist/cjs/merkleDistributor/MerkleDistributor.js.map +1 -0
- package/dist/cjs/merkleDistributor/index.d.ts +2 -0
- package/dist/cjs/merkleDistributor/index.js +6 -0
- package/dist/cjs/merkleDistributor/index.js.map +1 -0
- package/dist/cjs/merkleDistributor/model/Distribution.d.ts +17 -0
- package/dist/cjs/merkleDistributor/model/Distribution.js +3 -0
- package/dist/cjs/merkleDistributor/model/Distribution.js.map +1 -0
- package/dist/cjs/merkleDistributor/model/index.d.ts +1 -0
- package/dist/cjs/merkleDistributor/model/index.js +5 -0
- package/dist/cjs/merkleDistributor/model/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/pool/TransactionManager.d.ts +12 -0
- package/dist/cjs/pool/TransactionManager.js +121 -0
- package/dist/cjs/pool/TransactionManager.js.map +1 -0
- package/dist/cjs/pool/index.d.ts +1 -0
- package/dist/cjs/pool/index.js +5 -0
- package/dist/cjs/pool/index.js.map +1 -0
- package/dist/cjs/pool/poolClient.d.ts +232 -0
- package/dist/cjs/pool/poolClient.js +869 -0
- package/dist/cjs/pool/poolClient.js.map +1 -0
- package/dist/cjs/priceClient/adapters/acrossApi.d.ts +13 -0
- package/dist/cjs/priceClient/adapters/acrossApi.js +48 -0
- package/dist/cjs/priceClient/adapters/acrossApi.js.map +1 -0
- package/dist/cjs/priceClient/adapters/baseAdapter.d.ts +17 -0
- package/dist/cjs/priceClient/adapters/baseAdapter.js +81 -0
- package/dist/cjs/priceClient/adapters/baseAdapter.js.map +1 -0
- package/dist/cjs/priceClient/adapters/coingecko.d.ts +14 -0
- package/dist/cjs/priceClient/adapters/coingecko.js +75 -0
- package/dist/cjs/priceClient/adapters/coingecko.js.map +1 -0
- package/dist/cjs/priceClient/adapters/defiLlama.d.ts +17 -0
- package/dist/cjs/priceClient/adapters/defiLlama.js +95 -0
- package/dist/cjs/priceClient/adapters/defiLlama.js.map +1 -0
- package/dist/cjs/priceClient/adapters/index.d.ts +3 -0
- package/dist/cjs/priceClient/adapters/index.js +8 -0
- package/dist/cjs/priceClient/adapters/index.js.map +1 -0
- package/dist/cjs/priceClient/index.d.ts +2 -0
- package/dist/cjs/priceClient/index.js +7 -0
- package/dist/cjs/priceClient/index.js.map +1 -0
- package/dist/cjs/priceClient/priceClient.d.ts +32 -0
- package/dist/cjs/priceClient/priceClient.js +197 -0
- package/dist/cjs/priceClient/priceClient.js.map +1 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +29 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +62 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +151 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +35 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.js.map +1 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/index.d.ts +3 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/index.js +7 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/index.js.map +1 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/polygon.d.ts +152 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/polygon.js +43 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/polygon.js.map +1 -0
- package/dist/cjs/relayFeeCalculator/index.d.ts +2 -0
- package/dist/cjs/relayFeeCalculator/index.js +6 -0
- package/dist/cjs/relayFeeCalculator/index.js.map +1 -0
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +231 -0
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js +224 -0
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js.map +1 -0
- package/dist/cjs/typechain.d.ts +17 -0
- package/dist/cjs/typechain.js +20 -0
- package/dist/cjs/typechain.js.map +1 -0
- package/dist/cjs/typeguards/error.d.ts +3 -0
- package/dist/cjs/typeguards/error.js +11 -0
- package/dist/cjs/typeguards/error.js.map +1 -0
- package/dist/cjs/typeguards/index.d.ts +1 -0
- package/dist/cjs/typeguards/index.js +5 -0
- package/dist/cjs/typeguards/index.js.map +1 -0
- package/dist/cjs/utils/AddressUtils.d.ts +2 -0
- package/dist/cjs/utils/AddressUtils.js +24 -0
- package/dist/cjs/utils/AddressUtils.js.map +1 -0
- package/dist/cjs/utils/ArrayUtils.d.ts +12 -0
- package/dist/cjs/utils/ArrayUtils.js +125 -0
- package/dist/cjs/utils/ArrayUtils.js.map +1 -0
- package/dist/cjs/utils/BigNumberUtils.d.ts +8 -0
- package/dist/cjs/utils/BigNumberUtils.js +26 -0
- package/dist/cjs/utils/BigNumberUtils.js.map +1 -0
- package/dist/cjs/utils/BlockExplorerUtils.d.ts +3 -0
- package/dist/cjs/utils/BlockExplorerUtils.js +52 -0
- package/dist/cjs/utils/BlockExplorerUtils.js.map +1 -0
- package/dist/cjs/utils/BlockUtils.d.ts +28 -0
- package/dist/cjs/utils/BlockUtils.js +251 -0
- package/dist/cjs/utils/BlockUtils.js.map +1 -0
- package/dist/cjs/utils/BundleUtils.d.ts +5 -0
- package/dist/cjs/utils/BundleUtils.js +62 -0
- package/dist/cjs/utils/BundleUtils.js.map +1 -0
- package/dist/cjs/utils/CachingUtils.d.ts +5 -0
- package/dist/cjs/utils/CachingUtils.js +59 -0
- package/dist/cjs/utils/CachingUtils.js.map +1 -0
- package/dist/cjs/utils/DeploymentUtils.d.ts +1 -0
- package/dist/cjs/utils/DeploymentUtils.js +8 -0
- package/dist/cjs/utils/DeploymentUtils.js.map +1 -0
- package/dist/cjs/utils/DepositUtils.d.ts +19 -0
- package/dist/cjs/utils/DepositUtils.js +107 -0
- package/dist/cjs/utils/DepositUtils.js.map +1 -0
- package/dist/cjs/utils/EventUtils.d.ts +18 -0
- package/dist/cjs/utils/EventUtils.js +169 -0
- package/dist/cjs/utils/EventUtils.js.map +1 -0
- package/dist/cjs/utils/FlowUtils.d.ts +7 -0
- package/dist/cjs/utils/FlowUtils.js +42 -0
- package/dist/cjs/utils/FlowUtils.js.map +1 -0
- package/dist/cjs/utils/FormattingUtils.d.ts +15 -0
- package/dist/cjs/utils/FormattingUtils.js +107 -0
- package/dist/cjs/utils/FormattingUtils.js.map +1 -0
- package/dist/cjs/utils/IPFSUtils.d.ts +4 -0
- package/dist/cjs/utils/IPFSUtils.js +48 -0
- package/dist/cjs/utils/IPFSUtils.js.map +1 -0
- package/dist/cjs/utils/JSONUtils.d.ts +4 -0
- package/dist/cjs/utils/JSONUtils.js +53 -0
- package/dist/cjs/utils/JSONUtils.js.map +1 -0
- package/dist/cjs/utils/LogUtils.d.ts +14 -0
- package/dist/cjs/utils/LogUtils.js +18 -0
- package/dist/cjs/utils/LogUtils.js.map +1 -0
- package/dist/cjs/utils/Multicall.d.ts +13 -0
- package/dist/cjs/utils/Multicall.js +73 -0
- package/dist/cjs/utils/Multicall.js.map +1 -0
- package/dist/cjs/utils/NetworkUtils.d.ts +10 -0
- package/dist/cjs/utils/NetworkUtils.js +70 -0
- package/dist/cjs/utils/NetworkUtils.js.map +1 -0
- package/dist/cjs/utils/NumberUtils.d.ts +2 -0
- package/dist/cjs/utils/NumberUtils.js +12 -0
- package/dist/cjs/utils/NumberUtils.js.map +1 -0
- package/dist/cjs/utils/ObjectUtils.d.ts +5 -0
- package/dist/cjs/utils/ObjectUtils.js +65 -0
- package/dist/cjs/utils/ObjectUtils.js.map +1 -0
- package/dist/cjs/utils/ReviverUtils.d.ts +3 -0
- package/dist/cjs/utils/ReviverUtils.js +23 -0
- package/dist/cjs/utils/ReviverUtils.js.map +1 -0
- package/dist/cjs/utils/SpokeUtils.d.ts +16 -0
- package/dist/cjs/utils/SpokeUtils.js +299 -0
- package/dist/cjs/utils/SpokeUtils.js.map +1 -0
- package/dist/cjs/utils/TimeUtils.d.ts +1 -0
- package/dist/cjs/utils/TimeUtils.js +8 -0
- package/dist/cjs/utils/TimeUtils.js.map +1 -0
- package/dist/cjs/utils/TokenUtils.d.ts +303 -0
- package/dist/cjs/utils/TokenUtils.js +74 -0
- package/dist/cjs/utils/TokenUtils.js.map +1 -0
- package/dist/cjs/utils/TypeGuards.d.ts +3 -0
- package/dist/cjs/utils/TypeGuards.js +16 -0
- package/dist/cjs/utils/TypeGuards.js.map +1 -0
- package/dist/cjs/utils/TypeUtils.d.ts +5 -0
- package/dist/cjs/utils/TypeUtils.js +3 -0
- package/dist/cjs/utils/TypeUtils.js.map +1 -0
- package/dist/cjs/utils/V3Utils.d.ts +4 -0
- package/dist/cjs/utils/V3Utils.js +15 -0
- package/dist/cjs/utils/V3Utils.js.map +1 -0
- package/dist/cjs/utils/ValidatorUtils.d.ts +2 -0
- package/dist/cjs/utils/ValidatorUtils.js +39 -0
- package/dist/cjs/utils/ValidatorUtils.js.map +1 -0
- package/dist/cjs/utils/abi/contracts/Multicall3.json +440 -0
- package/dist/cjs/utils/abi/index.d.ts +3 -0
- package/dist/cjs/utils/abi/index.js +31 -0
- package/dist/cjs/utils/abi/index.js.map +1 -0
- package/dist/cjs/utils/common.d.ts +79 -0
- package/dist/cjs/utils/common.js +220 -0
- package/dist/cjs/utils/common.js.map +1 -0
- package/dist/cjs/utils/index.d.ts +29 -0
- package/dist/cjs/utils/index.js +33 -0
- package/dist/cjs/utils/index.js.map +1 -0
- package/dist/esm/apiClient/abstractClient.d.ts +66 -0
- package/dist/esm/apiClient/abstractClient.js +31 -0
- package/dist/esm/apiClient/abstractClient.js.map +1 -0
- package/dist/esm/apiClient/index.d.ts +2 -0
- package/dist/esm/apiClient/index.js +3 -0
- package/dist/esm/apiClient/index.js.map +1 -0
- package/dist/esm/apiClient/mockedClient.d.ts +24 -0
- package/dist/esm/apiClient/mockedClient.js +69 -0
- package/dist/esm/apiClient/mockedClient.js.map +1 -0
- package/dist/esm/apiClient/productionClient.d.ts +16 -0
- package/dist/esm/apiClient/productionClient.js +114 -0
- package/dist/esm/apiClient/productionClient.js.map +1 -0
- package/dist/esm/apiClient/types.d.ts +44 -0
- package/dist/esm/apiClient/types.js +2 -0
- package/dist/esm/apiClient/types.js.map +1 -0
- package/dist/esm/caching/Arweave/ArweaveClient.d.ts +61 -0
- package/dist/esm/caching/Arweave/ArweaveClient.js +265 -0
- package/dist/esm/caching/Arweave/ArweaveClient.js.map +1 -0
- package/dist/esm/caching/Arweave/index.d.ts +1 -0
- package/dist/esm/caching/Arweave/index.js +2 -0
- package/dist/esm/caching/Arweave/index.js.map +1 -0
- package/dist/esm/caching/IPFS/PinataIPFSClient.d.ts +37 -0
- package/dist/esm/caching/IPFS/PinataIPFSClient.js +81 -0
- package/dist/esm/caching/IPFS/PinataIPFSClient.js.map +1 -0
- package/dist/esm/caching/IPFS/index.d.ts +1 -0
- package/dist/esm/caching/IPFS/index.js +2 -0
- package/dist/esm/caching/IPFS/index.js.map +1 -0
- package/dist/esm/caching/index.d.ts +2 -0
- package/dist/esm/caching/index.js +3 -0
- package/dist/esm/caching/index.js.map +1 -0
- package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +108 -0
- package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +467 -0
- package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -0
- package/dist/esm/clients/AcrossConfigStoreClient/index.d.ts +1 -0
- package/dist/esm/clients/AcrossConfigStoreClient/index.js +2 -0
- package/dist/esm/clients/AcrossConfigStoreClient/index.js.map +1 -0
- package/dist/esm/clients/BaseAbstractClient.d.ts +51 -0
- package/dist/esm/clients/BaseAbstractClient.js +101 -0
- package/dist/esm/clients/BaseAbstractClient.js.map +1 -0
- package/dist/esm/clients/HubPoolClient.d.ts +134 -0
- package/dist/esm/clients/HubPoolClient.js +862 -0
- package/dist/esm/clients/HubPoolClient.js.map +1 -0
- package/dist/esm/clients/SpokePoolClient.d.ts +318 -0
- package/dist/esm/clients/SpokePoolClient.js +780 -0
- package/dist/esm/clients/SpokePoolClient.js.map +1 -0
- package/dist/esm/clients/index.d.ts +4 -0
- package/dist/esm/clients/index.js +6 -0
- package/dist/esm/clients/index.js.map +1 -0
- package/dist/esm/clients/mocks/MockConfigStoreClient.d.ts +20 -0
- package/dist/esm/clients/mocks/MockConfigStoreClient.js +122 -0
- package/dist/esm/clients/mocks/MockConfigStoreClient.js.map +1 -0
- package/dist/esm/clients/mocks/MockEvents.d.ts +34 -0
- package/dist/esm/clients/mocks/MockEvents.js +126 -0
- package/dist/esm/clients/mocks/MockEvents.js.map +1 -0
- package/dist/esm/clients/mocks/MockHubPoolClient.d.ts +35 -0
- package/dist/esm/clients/mocks/MockHubPoolClient.js +223 -0
- package/dist/esm/clients/mocks/MockHubPoolClient.js.map +1 -0
- package/dist/esm/clients/mocks/MockSpokePoolClient.d.ts +38 -0
- package/dist/esm/clients/mocks/MockSpokePoolClient.js +322 -0
- package/dist/esm/clients/mocks/MockSpokePoolClient.js.map +1 -0
- package/dist/esm/clients/mocks/index.d.ts +3 -0
- package/dist/esm/clients/mocks/index.js +4 -0
- package/dist/esm/clients/mocks/index.js.map +1 -0
- package/dist/esm/coingecko/Coingecko.d.ts +40 -0
- package/dist/esm/coingecko/Coingecko.js +283 -0
- package/dist/esm/coingecko/Coingecko.js.map +1 -0
- package/dist/esm/coingecko/index.d.ts +1 -0
- package/dist/esm/coingecko/index.js +2 -0
- package/dist/esm/coingecko/index.js.map +1 -0
- package/dist/esm/constants.d.ts +29 -0
- package/dist/esm/constants.js +34 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/contracts/acrossConfigStore.d.ts +57 -0
- package/dist/esm/contracts/acrossConfigStore.js +62 -0
- package/dist/esm/contracts/acrossConfigStore.js.map +1 -0
- package/dist/esm/contracts/hubPool.d.ts +17 -0
- package/dist/esm/contracts/hubPool.js +55 -0
- package/dist/esm/contracts/hubPool.js.map +1 -0
- package/dist/esm/contracts/index.d.ts +2 -0
- package/dist/esm/contracts/index.js +5 -0
- package/dist/esm/contracts/index.js.map +1 -0
- package/dist/esm/contracts/utils.d.ts +23 -0
- package/dist/esm/contracts/utils.js +38 -0
- package/dist/esm/contracts/utils.js.map +1 -0
- package/dist/esm/gasPriceOracle/adapters/arbitrum.d.ts +3 -0
- package/dist/esm/gasPriceOracle/adapters/arbitrum.js +25 -0
- package/dist/esm/gasPriceOracle/adapters/arbitrum.js.map +1 -0
- package/dist/esm/gasPriceOracle/adapters/ethereum.d.ts +4 -0
- package/dist/esm/gasPriceOracle/adapters/ethereum.js +41 -0
- package/dist/esm/gasPriceOracle/adapters/ethereum.js.map +1 -0
- package/dist/esm/gasPriceOracle/adapters/index.d.ts +3 -0
- package/dist/esm/gasPriceOracle/adapters/index.js +4 -0
- package/dist/esm/gasPriceOracle/adapters/index.js.map +1 -0
- package/dist/esm/gasPriceOracle/adapters/polygon.d.ts +3 -0
- package/dist/esm/gasPriceOracle/adapters/polygon.js +78 -0
- package/dist/esm/gasPriceOracle/adapters/polygon.js.map +1 -0
- package/dist/esm/gasPriceOracle/index.d.ts +2 -0
- package/dist/esm/gasPriceOracle/index.js +2 -0
- package/dist/esm/gasPriceOracle/index.js.map +1 -0
- package/dist/esm/gasPriceOracle/oracle.d.ts +10 -0
- package/dist/esm/gasPriceOracle/oracle.js +48 -0
- package/dist/esm/gasPriceOracle/oracle.js.map +1 -0
- package/dist/esm/gasPriceOracle/types.d.ts +8 -0
- package/dist/esm/gasPriceOracle/types.js +2 -0
- package/dist/esm/gasPriceOracle/types.js.map +1 -0
- package/dist/esm/gasPriceOracle/util.d.ts +2 -0
- package/dist/esm/gasPriceOracle/util.js +4 -0
- package/dist/esm/gasPriceOracle/util.js.map +1 -0
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.js +31 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/interfaces/Bridge.d.ts +9 -0
- package/dist/esm/interfaces/Bridge.js +2 -0
- package/dist/esm/interfaces/Bridge.js.map +1 -0
- package/dist/esm/interfaces/CachingMechanism.d.ts +26 -0
- package/dist/esm/interfaces/CachingMechanism.js +2 -0
- package/dist/esm/interfaces/CachingMechanism.js.map +1 -0
- package/dist/esm/interfaces/Common.d.ts +10 -0
- package/dist/esm/interfaces/Common.js +2 -0
- package/dist/esm/interfaces/Common.js.map +1 -0
- package/dist/esm/interfaces/ConfigStore.d.ts +157 -0
- package/dist/esm/interfaces/ConfigStore.js +2 -0
- package/dist/esm/interfaces/ConfigStore.js.map +1 -0
- package/dist/esm/interfaces/Error.d.ts +5 -0
- package/dist/esm/interfaces/Error.js +2 -0
- package/dist/esm/interfaces/Error.js.map +1 -0
- package/dist/esm/interfaces/HubPool.d.ts +98 -0
- package/dist/esm/interfaces/HubPool.js +2 -0
- package/dist/esm/interfaces/HubPool.js.map +1 -0
- package/dist/esm/interfaces/SpokePool.d.ts +103 -0
- package/dist/esm/interfaces/SpokePool.js +13 -0
- package/dist/esm/interfaces/SpokePool.js.map +1 -0
- package/dist/esm/interfaces/TypedData.d.ts +19 -0
- package/dist/esm/interfaces/TypedData.js +2 -0
- package/dist/esm/interfaces/TypedData.js.map +1 -0
- package/dist/esm/interfaces/index.d.ts +8 -0
- package/dist/esm/interfaces/index.js +9 -0
- package/dist/esm/interfaces/index.js.map +1 -0
- package/dist/esm/lpFeeCalculator/index.d.ts +1 -0
- package/dist/esm/lpFeeCalculator/index.js +2 -0
- package/dist/esm/lpFeeCalculator/index.js.map +1 -0
- package/dist/esm/lpFeeCalculator/lpFeeCalculator.d.ts +66 -0
- package/dist/esm/lpFeeCalculator/lpFeeCalculator.js +129 -0
- package/dist/esm/lpFeeCalculator/lpFeeCalculator.js.map +1 -0
- package/dist/esm/lpFeeCalculator/rateModel.d.ts +45 -0
- package/dist/esm/lpFeeCalculator/rateModel.js +138 -0
- package/dist/esm/lpFeeCalculator/rateModel.js.map +1 -0
- package/dist/esm/merkleDistributor/MerkleDistributor.d.ts +20 -0
- package/dist/esm/merkleDistributor/MerkleDistributor.js +34 -0
- package/dist/esm/merkleDistributor/MerkleDistributor.js.map +1 -0
- package/dist/esm/merkleDistributor/index.d.ts +2 -0
- package/dist/esm/merkleDistributor/index.js +3 -0
- package/dist/esm/merkleDistributor/index.js.map +1 -0
- package/dist/esm/merkleDistributor/model/Distribution.d.ts +17 -0
- package/dist/esm/merkleDistributor/model/Distribution.js +2 -0
- package/dist/esm/merkleDistributor/model/Distribution.js.map +1 -0
- package/dist/esm/merkleDistributor/model/index.d.ts +1 -0
- package/dist/esm/merkleDistributor/model/index.js +2 -0
- package/dist/esm/merkleDistributor/model/index.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/pool/TransactionManager.d.ts +12 -0
- package/dist/esm/pool/TransactionManager.js +122 -0
- package/dist/esm/pool/TransactionManager.js.map +1 -0
- package/dist/esm/pool/index.d.ts +1 -0
- package/dist/esm/pool/index.js +2 -0
- package/dist/esm/pool/index.js.map +1 -0
- package/dist/esm/pool/poolClient.d.ts +242 -0
- package/dist/esm/pool/poolClient.js +899 -0
- package/dist/esm/pool/poolClient.js.map +1 -0
- package/dist/esm/priceClient/adapters/acrossApi.d.ts +14 -0
- package/dist/esm/priceClient/adapters/acrossApi.js +49 -0
- package/dist/esm/priceClient/adapters/acrossApi.js.map +1 -0
- package/dist/esm/priceClient/adapters/baseAdapter.d.ts +17 -0
- package/dist/esm/priceClient/adapters/baseAdapter.js +78 -0
- package/dist/esm/priceClient/adapters/baseAdapter.js.map +1 -0
- package/dist/esm/priceClient/adapters/coingecko.d.ts +14 -0
- package/dist/esm/priceClient/adapters/coingecko.js +73 -0
- package/dist/esm/priceClient/adapters/coingecko.js.map +1 -0
- package/dist/esm/priceClient/adapters/defiLlama.d.ts +17 -0
- package/dist/esm/priceClient/adapters/defiLlama.js +93 -0
- package/dist/esm/priceClient/adapters/defiLlama.js.map +1 -0
- package/dist/esm/priceClient/adapters/index.d.ts +3 -0
- package/dist/esm/priceClient/adapters/index.js +7 -0
- package/dist/esm/priceClient/adapters/index.js.map +1 -0
- package/dist/esm/priceClient/index.d.ts +2 -0
- package/dist/esm/priceClient/index.js +4 -0
- package/dist/esm/priceClient/index.js.map +1 -0
- package/dist/esm/priceClient/priceClient.d.ts +32 -0
- package/dist/esm/priceClient/priceClient.js +206 -0
- package/dist/esm/priceClient/priceClient.js.map +1 -0
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +61 -0
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +91 -0
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -0
- package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +151 -0
- package/dist/esm/relayFeeCalculator/chain-queries/factory.js +38 -0
- package/dist/esm/relayFeeCalculator/chain-queries/factory.js.map +1 -0
- package/dist/esm/relayFeeCalculator/chain-queries/index.d.ts +3 -0
- package/dist/esm/relayFeeCalculator/chain-queries/index.js +4 -0
- package/dist/esm/relayFeeCalculator/chain-queries/index.js.map +1 -0
- package/dist/esm/relayFeeCalculator/chain-queries/polygon.d.ts +152 -0
- package/dist/esm/relayFeeCalculator/chain-queries/polygon.js +40 -0
- package/dist/esm/relayFeeCalculator/chain-queries/polygon.js.map +1 -0
- package/dist/esm/relayFeeCalculator/index.d.ts +2 -0
- package/dist/esm/relayFeeCalculator/index.js +3 -0
- package/dist/esm/relayFeeCalculator/index.js.map +1 -0
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +282 -0
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.js +298 -0
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.js.map +1 -0
- package/dist/esm/typechain.d.ts +22 -0
- package/dist/esm/typechain.js +9 -0
- package/dist/esm/typechain.js.map +1 -0
- package/dist/esm/typeguards/error.d.ts +3 -0
- package/dist/esm/typeguards/error.js +6 -0
- package/dist/esm/typeguards/error.js.map +1 -0
- package/dist/esm/typeguards/index.d.ts +1 -0
- package/dist/esm/typeguards/index.js +2 -0
- package/dist/esm/typeguards/index.js.map +1 -0
- package/dist/esm/utils/AddressUtils.d.ts +8 -0
- package/dist/esm/utils/AddressUtils.js +28 -0
- package/dist/esm/utils/AddressUtils.js.map +1 -0
- package/dist/esm/utils/ArrayUtils.d.ts +98 -0
- package/dist/esm/utils/ArrayUtils.js +196 -0
- package/dist/esm/utils/ArrayUtils.js.map +1 -0
- package/dist/esm/utils/BigNumberUtils.d.ts +31 -0
- package/dist/esm/utils/BigNumberUtils.js +52 -0
- package/dist/esm/utils/BigNumberUtils.js.map +1 -0
- package/dist/esm/utils/BlockExplorerUtils.d.ts +21 -0
- package/dist/esm/utils/BlockExplorerUtils.js +91 -0
- package/dist/esm/utils/BlockExplorerUtils.js.map +1 -0
- package/dist/esm/utils/BlockUtils.d.ts +46 -0
- package/dist/esm/utils/BlockUtils.js +294 -0
- package/dist/esm/utils/BlockUtils.js.map +1 -0
- package/dist/esm/utils/BundleUtils.d.ts +29 -0
- package/dist/esm/utils/BundleUtils.js +89 -0
- package/dist/esm/utils/BundleUtils.js.map +1 -0
- package/dist/esm/utils/CachingUtils.d.ts +17 -0
- package/dist/esm/utils/CachingUtils.js +66 -0
- package/dist/esm/utils/CachingUtils.js.map +1 -0
- package/dist/esm/utils/DeploymentUtils.d.ts +1 -0
- package/dist/esm/utils/DeploymentUtils.js +2 -0
- package/dist/esm/utils/DeploymentUtils.js.map +1 -0
- package/dist/esm/utils/DepositUtils.d.ts +46 -0
- package/dist/esm/utils/DepositUtils.js +138 -0
- package/dist/esm/utils/DepositUtils.js.map +1 -0
- package/dist/esm/utils/EventUtils.d.ts +32 -0
- package/dist/esm/utils/EventUtils.js +194 -0
- package/dist/esm/utils/EventUtils.js.map +1 -0
- package/dist/esm/utils/FlowUtils.d.ts +8 -0
- package/dist/esm/utils/FlowUtils.js +39 -0
- package/dist/esm/utils/FlowUtils.js.map +1 -0
- package/dist/esm/utils/FormattingUtils.d.ts +61 -0
- package/dist/esm/utils/FormattingUtils.js +167 -0
- package/dist/esm/utils/FormattingUtils.js.map +1 -0
- package/dist/esm/utils/IPFSUtils.d.ts +24 -0
- package/dist/esm/utils/IPFSUtils.js +65 -0
- package/dist/esm/utils/IPFSUtils.js.map +1 -0
- package/dist/esm/utils/JSONUtils.d.ts +31 -0
- package/dist/esm/utils/JSONUtils.js +82 -0
- package/dist/esm/utils/JSONUtils.js.map +1 -0
- package/dist/esm/utils/LogUtils.d.ts +20 -0
- package/dist/esm/utils/LogUtils.js +19 -0
- package/dist/esm/utils/LogUtils.js.map +1 -0
- package/dist/esm/utils/Multicall.d.ts +13 -0
- package/dist/esm/utils/Multicall.js +70 -0
- package/dist/esm/utils/Multicall.js.map +1 -0
- package/dist/esm/utils/NetworkUtils.d.ts +60 -0
- package/dist/esm/utils/NetworkUtils.js +109 -0
- package/dist/esm/utils/NetworkUtils.js.map +1 -0
- package/dist/esm/utils/NumberUtils.d.ts +12 -0
- package/dist/esm/utils/NumberUtils.js +17 -0
- package/dist/esm/utils/NumberUtils.js.map +1 -0
- package/dist/esm/utils/ObjectUtils.d.ts +10 -0
- package/dist/esm/utils/ObjectUtils.js +72 -0
- package/dist/esm/utils/ObjectUtils.js.map +1 -0
- package/dist/esm/utils/ReviverUtils.d.ts +15 -0
- package/dist/esm/utils/ReviverUtils.js +33 -0
- package/dist/esm/utils/ReviverUtils.js.map +1 -0
- package/dist/esm/utils/SpokeUtils.d.ts +64 -0
- package/dist/esm/utils/SpokeUtils.js +370 -0
- package/dist/esm/utils/SpokeUtils.js.map +1 -0
- package/dist/esm/utils/TimeUtils.d.ts +5 -0
- package/dist/esm/utils/TimeUtils.js +8 -0
- package/dist/esm/utils/TimeUtils.js.map +1 -0
- package/dist/esm/utils/TokenUtils.d.ts +325 -0
- package/dist/esm/utils/TokenUtils.js +88 -0
- package/dist/esm/utils/TokenUtils.js.map +1 -0
- package/dist/esm/utils/TypeGuards.d.ts +3 -0
- package/dist/esm/utils/TypeGuards.js +10 -0
- package/dist/esm/utils/TypeGuards.js.map +1 -0
- package/dist/esm/utils/TypeUtils.d.ts +5 -0
- package/dist/esm/utils/TypeUtils.js +2 -0
- package/dist/esm/utils/TypeUtils.js.map +1 -0
- package/dist/esm/utils/V3Utils.d.ts +4 -0
- package/dist/esm/utils/V3Utils.js +10 -0
- package/dist/esm/utils/V3Utils.js.map +1 -0
- package/dist/esm/utils/ValidatorUtils.d.ts +2 -0
- package/dist/esm/utils/ValidatorUtils.js +35 -0
- package/dist/esm/utils/ValidatorUtils.js.map +1 -0
- package/dist/esm/utils/abi/contracts/Multicall3.json +440 -0
- package/dist/esm/utils/abi/index.d.ts +18 -0
- package/dist/esm/utils/abi/index.js +41 -0
- package/dist/esm/utils/abi/index.js.map +1 -0
- package/dist/esm/utils/common.d.ts +204 -0
- package/dist/esm/utils/common.js +325 -0
- package/dist/esm/utils/common.js.map +1 -0
- package/dist/esm/utils/index.d.ts +29 -0
- package/dist/esm/utils/index.js +30 -0
- package/dist/esm/utils/index.js.map +1 -0
- package/dist/types/apiClient/abstractClient.d.ts +67 -0
- package/dist/types/apiClient/abstractClient.d.ts.map +1 -0
- package/dist/types/apiClient/index.d.ts +3 -0
- package/dist/types/apiClient/index.d.ts.map +1 -0
- package/dist/types/apiClient/mockedClient.d.ts +25 -0
- package/dist/types/apiClient/mockedClient.d.ts.map +1 -0
- package/dist/types/apiClient/productionClient.d.ts +17 -0
- package/dist/types/apiClient/productionClient.d.ts.map +1 -0
- package/dist/types/apiClient/types.d.ts +45 -0
- package/dist/types/apiClient/types.d.ts.map +1 -0
- package/dist/types/caching/Arweave/ArweaveClient.d.ts +62 -0
- package/dist/types/caching/Arweave/ArweaveClient.d.ts.map +1 -0
- package/dist/types/caching/Arweave/index.d.ts +2 -0
- package/dist/types/caching/Arweave/index.d.ts.map +1 -0
- package/dist/types/caching/IPFS/PinataIPFSClient.d.ts +38 -0
- package/dist/types/caching/IPFS/PinataIPFSClient.d.ts.map +1 -0
- package/dist/types/caching/IPFS/index.d.ts +2 -0
- package/dist/types/caching/IPFS/index.d.ts.map +1 -0
- package/dist/types/caching/index.d.ts +3 -0
- package/dist/types/caching/index.d.ts.map +1 -0
- package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +109 -0
- package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts.map +1 -0
- package/dist/types/clients/AcrossConfigStoreClient/index.d.ts +2 -0
- package/dist/types/clients/AcrossConfigStoreClient/index.d.ts.map +1 -0
- package/dist/types/clients/BaseAbstractClient.d.ts +52 -0
- package/dist/types/clients/BaseAbstractClient.d.ts.map +1 -0
- package/dist/types/clients/HubPoolClient.d.ts +135 -0
- package/dist/types/clients/HubPoolClient.d.ts.map +1 -0
- package/dist/types/clients/SpokePoolClient.d.ts +319 -0
- package/dist/types/clients/SpokePoolClient.d.ts.map +1 -0
- package/dist/types/clients/index.d.ts +5 -0
- package/dist/types/clients/index.d.ts.map +1 -0
- package/dist/types/clients/mocks/MockConfigStoreClient.d.ts +21 -0
- package/dist/types/clients/mocks/MockConfigStoreClient.d.ts.map +1 -0
- package/dist/types/clients/mocks/MockEvents.d.ts +35 -0
- package/dist/types/clients/mocks/MockEvents.d.ts.map +1 -0
- package/dist/types/clients/mocks/MockHubPoolClient.d.ts +36 -0
- package/dist/types/clients/mocks/MockHubPoolClient.d.ts.map +1 -0
- package/dist/types/clients/mocks/MockSpokePoolClient.d.ts +39 -0
- package/dist/types/clients/mocks/MockSpokePoolClient.d.ts.map +1 -0
- package/dist/types/clients/mocks/index.d.ts +4 -0
- package/dist/types/clients/mocks/index.d.ts.map +1 -0
- package/dist/types/coingecko/Coingecko.d.ts +41 -0
- package/dist/types/coingecko/Coingecko.d.ts.map +1 -0
- package/dist/types/coingecko/index.d.ts +2 -0
- package/dist/types/coingecko/index.d.ts.map +1 -0
- package/dist/types/constants.d.ts +30 -0
- package/dist/types/constants.d.ts.map +1 -0
- package/dist/types/contracts/acrossConfigStore.d.ts +58 -0
- package/dist/types/contracts/acrossConfigStore.d.ts.map +1 -0
- package/dist/types/contracts/hubPool.d.ts +18 -0
- package/dist/types/contracts/hubPool.d.ts.map +1 -0
- package/dist/types/contracts/index.d.ts +3 -0
- package/dist/types/contracts/index.d.ts.map +1 -0
- package/dist/types/contracts/utils.d.ts +24 -0
- package/dist/types/contracts/utils.d.ts.map +1 -0
- package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts +4 -0
- package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts.map +1 -0
- package/dist/types/gasPriceOracle/adapters/ethereum.d.ts +5 -0
- package/dist/types/gasPriceOracle/adapters/ethereum.d.ts.map +1 -0
- package/dist/types/gasPriceOracle/adapters/index.d.ts +4 -0
- package/dist/types/gasPriceOracle/adapters/index.d.ts.map +1 -0
- package/dist/types/gasPriceOracle/adapters/polygon.d.ts +4 -0
- package/dist/types/gasPriceOracle/adapters/polygon.d.ts.map +1 -0
- package/dist/types/gasPriceOracle/index.d.ts +3 -0
- package/dist/types/gasPriceOracle/index.d.ts.map +1 -0
- package/dist/types/gasPriceOracle/oracle.d.ts +11 -0
- package/dist/types/gasPriceOracle/oracle.d.ts.map +1 -0
- package/dist/types/gasPriceOracle/types.d.ts +9 -0
- package/dist/types/gasPriceOracle/types.d.ts.map +1 -0
- package/dist/types/gasPriceOracle/util.d.ts +3 -0
- package/dist/types/gasPriceOracle/util.d.ts.map +1 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/interfaces/Bridge.d.ts +10 -0
- package/dist/types/interfaces/Bridge.d.ts.map +1 -0
- package/dist/types/interfaces/CachingMechanism.d.ts +27 -0
- package/dist/types/interfaces/CachingMechanism.d.ts.map +1 -0
- package/dist/types/interfaces/Common.d.ts +11 -0
- package/dist/types/interfaces/Common.d.ts.map +1 -0
- package/dist/types/interfaces/ConfigStore.d.ts +158 -0
- package/dist/types/interfaces/ConfigStore.d.ts.map +1 -0
- package/dist/types/interfaces/Error.d.ts +6 -0
- package/dist/types/interfaces/Error.d.ts.map +1 -0
- package/dist/types/interfaces/HubPool.d.ts +99 -0
- package/dist/types/interfaces/HubPool.d.ts.map +1 -0
- package/dist/types/interfaces/SpokePool.d.ts +104 -0
- package/dist/types/interfaces/SpokePool.d.ts.map +1 -0
- package/dist/types/interfaces/TypedData.d.ts +20 -0
- package/dist/types/interfaces/TypedData.d.ts.map +1 -0
- package/dist/types/interfaces/index.d.ts +9 -0
- package/dist/types/interfaces/index.d.ts.map +1 -0
- package/dist/types/lpFeeCalculator/index.d.ts +2 -0
- package/dist/types/lpFeeCalculator/index.d.ts.map +1 -0
- package/dist/types/lpFeeCalculator/lpFeeCalculator.d.ts +67 -0
- package/dist/types/lpFeeCalculator/lpFeeCalculator.d.ts.map +1 -0
- package/dist/types/lpFeeCalculator/rateModel.d.ts +46 -0
- package/dist/types/lpFeeCalculator/rateModel.d.ts.map +1 -0
- package/dist/types/merkleDistributor/MerkleDistributor.d.ts +21 -0
- package/dist/types/merkleDistributor/MerkleDistributor.d.ts.map +1 -0
- package/dist/types/merkleDistributor/index.d.ts +3 -0
- package/dist/types/merkleDistributor/index.d.ts.map +1 -0
- package/dist/types/merkleDistributor/model/Distribution.d.ts +18 -0
- package/dist/types/merkleDistributor/model/Distribution.d.ts.map +1 -0
- package/dist/types/merkleDistributor/model/index.d.ts +2 -0
- package/dist/types/merkleDistributor/model/index.d.ts.map +1 -0
- package/dist/types/pool/TransactionManager.d.ts +13 -0
- package/dist/types/pool/TransactionManager.d.ts.map +1 -0
- package/dist/types/pool/index.d.ts +2 -0
- package/dist/types/pool/index.d.ts.map +1 -0
- package/dist/types/pool/poolClient.d.ts +243 -0
- package/dist/types/pool/poolClient.d.ts.map +1 -0
- package/dist/types/priceClient/adapters/acrossApi.d.ts +15 -0
- package/dist/types/priceClient/adapters/acrossApi.d.ts.map +1 -0
- package/dist/types/priceClient/adapters/baseAdapter.d.ts +18 -0
- package/dist/types/priceClient/adapters/baseAdapter.d.ts.map +1 -0
- package/dist/types/priceClient/adapters/coingecko.d.ts +15 -0
- package/dist/types/priceClient/adapters/coingecko.d.ts.map +1 -0
- package/dist/types/priceClient/adapters/defiLlama.d.ts +18 -0
- package/dist/types/priceClient/adapters/defiLlama.d.ts.map +1 -0
- package/dist/types/priceClient/adapters/index.d.ts +4 -0
- package/dist/types/priceClient/adapters/index.d.ts.map +1 -0
- package/dist/types/priceClient/index.d.ts +3 -0
- package/dist/types/priceClient/index.d.ts.map +1 -0
- package/dist/types/priceClient/priceClient.d.ts +33 -0
- package/dist/types/priceClient/priceClient.d.ts.map +1 -0
- package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts +62 -0
- package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts.map +1 -0
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +152 -0
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -0
- package/dist/types/relayFeeCalculator/chain-queries/index.d.ts +4 -0
- package/dist/types/relayFeeCalculator/chain-queries/index.d.ts.map +1 -0
- package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts +153 -0
- package/dist/types/relayFeeCalculator/chain-queries/polygon.d.ts.map +1 -0
- package/dist/types/relayFeeCalculator/index.d.ts +3 -0
- package/dist/types/relayFeeCalculator/index.d.ts.map +1 -0
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +283 -0
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -0
- package/dist/types/typechain.d.ts +23 -0
- package/dist/types/typechain.d.ts.map +1 -0
- package/dist/types/typeguards/error.d.ts +4 -0
- package/dist/types/typeguards/error.d.ts.map +1 -0
- package/dist/types/typeguards/index.d.ts +2 -0
- package/dist/types/typeguards/index.d.ts.map +1 -0
- package/dist/types/utils/AddressUtils.d.ts +9 -0
- package/dist/types/utils/AddressUtils.d.ts.map +1 -0
- package/dist/types/utils/ArrayUtils.d.ts +99 -0
- package/dist/types/utils/ArrayUtils.d.ts.map +1 -0
- package/dist/types/utils/BigNumberUtils.d.ts +32 -0
- package/dist/types/utils/BigNumberUtils.d.ts.map +1 -0
- package/dist/types/utils/BlockExplorerUtils.d.ts +22 -0
- package/dist/types/utils/BlockExplorerUtils.d.ts.map +1 -0
- package/dist/types/utils/BlockUtils.d.ts +47 -0
- package/dist/types/utils/BlockUtils.d.ts.map +1 -0
- package/dist/types/utils/BundleUtils.d.ts +30 -0
- package/dist/types/utils/BundleUtils.d.ts.map +1 -0
- package/dist/types/utils/CachingUtils.d.ts +18 -0
- package/dist/types/utils/CachingUtils.d.ts.map +1 -0
- package/dist/types/utils/DeploymentUtils.d.ts +2 -0
- package/dist/types/utils/DeploymentUtils.d.ts.map +1 -0
- package/dist/types/utils/DepositUtils.d.ts +47 -0
- package/dist/types/utils/DepositUtils.d.ts.map +1 -0
- package/dist/types/utils/EventUtils.d.ts +33 -0
- package/dist/types/utils/EventUtils.d.ts.map +1 -0
- package/dist/types/utils/FlowUtils.d.ts +9 -0
- package/dist/types/utils/FlowUtils.d.ts.map +1 -0
- package/dist/types/utils/FormattingUtils.d.ts +62 -0
- package/dist/types/utils/FormattingUtils.d.ts.map +1 -0
- package/dist/types/utils/IPFSUtils.d.ts +25 -0
- package/dist/types/utils/IPFSUtils.d.ts.map +1 -0
- package/dist/types/utils/JSONUtils.d.ts +32 -0
- package/dist/types/utils/JSONUtils.d.ts.map +1 -0
- package/dist/types/utils/LogUtils.d.ts +21 -0
- package/dist/types/utils/LogUtils.d.ts.map +1 -0
- package/dist/types/utils/Multicall.d.ts +14 -0
- package/dist/types/utils/Multicall.d.ts.map +1 -0
- package/dist/types/utils/NetworkUtils.d.ts +61 -0
- package/dist/types/utils/NetworkUtils.d.ts.map +1 -0
- package/dist/types/utils/NumberUtils.d.ts +13 -0
- package/dist/types/utils/NumberUtils.d.ts.map +1 -0
- package/dist/types/utils/ObjectUtils.d.ts +11 -0
- package/dist/types/utils/ObjectUtils.d.ts.map +1 -0
- package/dist/types/utils/ReviverUtils.d.ts +16 -0
- package/dist/types/utils/ReviverUtils.d.ts.map +1 -0
- package/dist/types/utils/SpokeUtils.d.ts +65 -0
- package/dist/types/utils/SpokeUtils.d.ts.map +1 -0
- package/dist/types/utils/TimeUtils.d.ts +6 -0
- package/dist/types/utils/TimeUtils.d.ts.map +1 -0
- package/dist/types/utils/TokenUtils.d.ts +326 -0
- package/dist/types/utils/TokenUtils.d.ts.map +1 -0
- package/dist/types/utils/TypeGuards.d.ts +4 -0
- package/dist/types/utils/TypeGuards.d.ts.map +1 -0
- package/dist/types/utils/TypeUtils.d.ts +6 -0
- package/dist/types/utils/TypeUtils.d.ts.map +1 -0
- package/dist/types/utils/V3Utils.d.ts +5 -0
- package/dist/types/utils/V3Utils.d.ts.map +1 -0
- package/dist/types/utils/ValidatorUtils.d.ts +3 -0
- package/dist/types/utils/ValidatorUtils.d.ts.map +1 -0
- package/dist/types/utils/abi/index.d.ts +19 -0
- package/dist/types/utils/abi/index.d.ts.map +1 -0
- package/dist/types/utils/common.d.ts +205 -0
- package/dist/types/utils/common.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +30 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/package.json +144 -0
- package/src/apiClient/abstractClient.ts +95 -0
- package/src/apiClient/index.ts +2 -0
- package/src/apiClient/mockedClient.ts +90 -0
- package/src/apiClient/productionClient.ts +98 -0
- package/src/apiClient/types.ts +49 -0
- package/src/caching/Arweave/ArweaveClient.ts +238 -0
- package/src/caching/Arweave/index.ts +1 -0
- package/src/caching/IPFS/PinataIPFSClient.ts +92 -0
- package/src/caching/IPFS/index.ts +1 -0
- package/src/caching/index.ts +2 -0
- package/src/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.ts +526 -0
- package/src/clients/AcrossConfigStoreClient/index.ts +1 -0
- package/src/clients/BaseAbstractClient.ts +94 -0
- package/src/clients/HubPoolClient.ts +1010 -0
- package/src/clients/SpokePoolClient.ts +894 -0
- package/src/clients/index.ts +9 -0
- package/src/clients/mocks/MockConfigStoreClient.ts +129 -0
- package/src/clients/mocks/MockEvents.ts +156 -0
- package/src/clients/mocks/MockHubPoolClient.ts +257 -0
- package/src/clients/mocks/MockSpokePoolClient.ts +341 -0
- package/src/clients/mocks/index.ts +3 -0
- package/src/coingecko/Coingecko.ts +277 -0
- package/src/coingecko/index.ts +1 -0
- package/src/constants.ts +53 -0
- package/src/contracts/acrossConfigStore.ts +49 -0
- package/src/contracts/hubPool.ts +90 -0
- package/src/contracts/index.ts +2 -0
- package/src/contracts/utils.ts +56 -0
- package/src/gasPriceOracle/adapters/arbitrum.ts +21 -0
- package/src/gasPriceOracle/adapters/ethereum.ts +27 -0
- package/src/gasPriceOracle/adapters/index.ts +3 -0
- package/src/gasPriceOracle/adapters/polygon.ts +77 -0
- package/src/gasPriceOracle/index.ts +2 -0
- package/src/gasPriceOracle/oracle.ts +42 -0
- package/src/gasPriceOracle/types.ts +10 -0
- package/src/gasPriceOracle/util.ts +5 -0
- package/src/index.ts +15 -0
- package/src/interfaces/Bridge.ts +10 -0
- package/src/interfaces/CachingMechanism.ts +37 -0
- package/src/interfaces/Common.ts +12 -0
- package/src/interfaces/ConfigStore.ts +173 -0
- package/src/interfaces/Error.ts +5 -0
- package/src/interfaces/HubPool.ts +118 -0
- package/src/interfaces/SpokePool.ts +119 -0
- package/src/interfaces/TypedData.ts +21 -0
- package/src/interfaces/index.ts +8 -0
- package/src/lpFeeCalculator/README.md +27 -0
- package/src/lpFeeCalculator/index.ts +1 -0
- package/src/lpFeeCalculator/lpFeeCalculator.ts +169 -0
- package/src/lpFeeCalculator/rateModel.ts +183 -0
- package/src/merkleDistributor/MerkleDistributor.ts +37 -0
- package/src/merkleDistributor/README.md +30 -0
- package/src/merkleDistributor/index.ts +2 -0
- package/src/merkleDistributor/model/Distribution.ts +17 -0
- package/src/merkleDistributor/model/index.ts +1 -0
- package/src/pool/TransactionManager.ts +73 -0
- package/src/pool/index.ts +1 -0
- package/src/pool/poolClient.ts +840 -0
- package/src/priceClient/README.md +36 -0
- package/src/priceClient/adapters/acrossApi.ts +44 -0
- package/src/priceClient/adapters/baseAdapter.ts +65 -0
- package/src/priceClient/adapters/coingecko.ts +67 -0
- package/src/priceClient/adapters/defiLlama.ts +96 -0
- package/src/priceClient/adapters/index.ts +3 -0
- package/src/priceClient/index.ts +2 -0
- package/src/priceClient/priceClient.ts +192 -0
- package/src/relayFeeCalculator/README.md +34 -0
- package/src/relayFeeCalculator/chain-queries/baseQuery.ts +98 -0
- package/src/relayFeeCalculator/chain-queries/factory.ts +58 -0
- package/src/relayFeeCalculator/chain-queries/index.ts +3 -0
- package/src/relayFeeCalculator/chain-queries/polygon.ts +45 -0
- package/src/relayFeeCalculator/index.ts +2 -0
- package/src/relayFeeCalculator/relayFeeCalculator.ts +410 -0
- package/src/typechain.ts +46 -0
- package/src/typeguards/error.ts +7 -0
- package/src/typeguards/index.ts +1 -0
- package/src/utils/AddressUtils.ts +18 -0
- package/src/utils/ArrayUtils.ts +170 -0
- package/src/utils/BigNumberUtils.ts +58 -0
- package/src/utils/BlockExplorerUtils.ts +91 -0
- package/src/utils/BlockUtils.ts +265 -0
- package/src/utils/BundleUtils.ts +109 -0
- package/src/utils/CachingUtils.ts +56 -0
- package/src/utils/DeploymentUtils.ts +5 -0
- package/src/utils/DepositUtils.ts +144 -0
- package/src/utils/EventUtils.ts +227 -0
- package/src/utils/FlowUtils.ts +48 -0
- package/src/utils/FormattingUtils.ts +186 -0
- package/src/utils/IPFSUtils.ts +48 -0
- package/src/utils/JSONUtils.ts +85 -0
- package/src/utils/LogUtils.ts +38 -0
- package/src/utils/Multicall.ts +64 -0
- package/src/utils/NetworkUtils.ts +117 -0
- package/src/utils/NumberUtils.ts +17 -0
- package/src/utils/ObjectUtils.ts +77 -0
- package/src/utils/ReviverUtils.ts +31 -0
- package/src/utils/SpokeUtils.ts +372 -0
- package/src/utils/TimeUtils.ts +7 -0
- package/src/utils/TokenUtils.ts +94 -0
- package/src/utils/TypeGuards.ts +15 -0
- package/src/utils/TypeUtils.ts +9 -0
- package/src/utils/V3Utils.ts +12 -0
- package/src/utils/ValidatorUtils.ts +38 -0
- package/src/utils/abi/contracts/Multicall3.json +440 -0
- package/src/utils/abi/index.ts +33 -0
- package/src/utils/common.ts +392 -0
- package/src/utils/index.ts +29 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import assert from "assert";
|
|
2
|
+
import { BigNumber, BytesLike, Contract, PopulatedTransaction, providers, utils as ethersUtils } from "ethers";
|
|
3
|
+
import { CHAIN_IDs, ZERO_ADDRESS } from "../constants";
|
|
4
|
+
import { Deposit, Fill, FillStatus, RelayData, SlowFillRequest } from "../interfaces";
|
|
5
|
+
import { SpokePoolClient } from "../clients";
|
|
6
|
+
import { chunk } from "./ArrayUtils";
|
|
7
|
+
import { toBN } from "./BigNumberUtils";
|
|
8
|
+
import { isDefined } from "./TypeGuards";
|
|
9
|
+
import { getNetworkName } from "./NetworkUtils";
|
|
10
|
+
|
|
11
|
+
type BlockTag = providers.BlockTag;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param spokePool SpokePool Contract instance.
|
|
15
|
+
* @param deposit V3Deopsit instance.
|
|
16
|
+
* @param repaymentChainId Optional repaymentChainId (defaults to destinationChainId).
|
|
17
|
+
* @returns An Ethers UnsignedTransaction instance.
|
|
18
|
+
*/
|
|
19
|
+
export function populateV3Relay(
|
|
20
|
+
spokePool: Contract,
|
|
21
|
+
deposit: Deposit,
|
|
22
|
+
relayer: string,
|
|
23
|
+
repaymentChainId = deposit.destinationChainId
|
|
24
|
+
): Promise<PopulatedTransaction> {
|
|
25
|
+
const v3RelayData: RelayData = {
|
|
26
|
+
depositor: deposit.depositor,
|
|
27
|
+
recipient: deposit.recipient,
|
|
28
|
+
exclusiveRelayer: deposit.exclusiveRelayer,
|
|
29
|
+
inputToken: deposit.inputToken,
|
|
30
|
+
outputToken: deposit.outputToken,
|
|
31
|
+
inputAmount: deposit.inputAmount,
|
|
32
|
+
outputAmount: deposit.outputAmount,
|
|
33
|
+
originChainId: deposit.originChainId,
|
|
34
|
+
depositId: deposit.depositId,
|
|
35
|
+
fillDeadline: deposit.fillDeadline,
|
|
36
|
+
exclusivityDeadline: deposit.exclusivityDeadline,
|
|
37
|
+
message: deposit.message,
|
|
38
|
+
};
|
|
39
|
+
if (isDefined(deposit.speedUpSignature)) {
|
|
40
|
+
assert(isDefined(deposit.updatedRecipient) && deposit.updatedRecipient !== ZERO_ADDRESS);
|
|
41
|
+
assert(isDefined(deposit.updatedOutputAmount));
|
|
42
|
+
assert(isDefined(deposit.updatedMessage));
|
|
43
|
+
return spokePool.populateTransaction.fillV3RelayWithUpdatedDeposit(
|
|
44
|
+
v3RelayData,
|
|
45
|
+
repaymentChainId,
|
|
46
|
+
deposit.updatedOutputAmount,
|
|
47
|
+
deposit.updatedRecipient,
|
|
48
|
+
deposit.updatedMessage,
|
|
49
|
+
deposit.speedUpSignature,
|
|
50
|
+
{ from: relayer }
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return spokePool.populateTransaction.fillV3Relay(v3RelayData, repaymentChainId, { from: relayer });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Find the block range that contains the deposit ID. This is a binary search that searches for the block range
|
|
59
|
+
* that contains the deposit ID.
|
|
60
|
+
* @param targetDepositId The target deposit ID to search for.
|
|
61
|
+
* @param initLow The initial lower bound of the block range to search.
|
|
62
|
+
* @param initHigh The initial upper bound of the block range to search.
|
|
63
|
+
* @param maxSearches The maximum number of searches to perform. This is used to prevent infinite loops.
|
|
64
|
+
* @returns The block range that contains the deposit ID.
|
|
65
|
+
* @note // We want to find the block range that satisfies these conditions:
|
|
66
|
+
* // - the low block has deposit count <= targetDepositId
|
|
67
|
+
* // - the high block has a deposit count > targetDepositId.
|
|
68
|
+
* // This way the caller can search for a FundsDeposited event between [low, high] that will always
|
|
69
|
+
* // contain the event emitted when deposit ID was incremented to targetDepositId + 1. This is the same transaction
|
|
70
|
+
* // where the deposit with deposit ID = targetDepositId was created.
|
|
71
|
+
*/
|
|
72
|
+
export async function getBlockRangeForDepositId(
|
|
73
|
+
targetDepositId: number,
|
|
74
|
+
initLow: number,
|
|
75
|
+
initHigh: number,
|
|
76
|
+
maxSearches: number,
|
|
77
|
+
spokePool: SpokePoolClient
|
|
78
|
+
): Promise<{
|
|
79
|
+
low: number;
|
|
80
|
+
high: number;
|
|
81
|
+
}> {
|
|
82
|
+
// Resolve the deployment block number.
|
|
83
|
+
const deploymentBlock = spokePool.deploymentBlock;
|
|
84
|
+
|
|
85
|
+
// Set the initial high block to the most recent block number or the initial high block, whichever is smaller.
|
|
86
|
+
initHigh = Math.min(initHigh, spokePool.latestBlockSearched);
|
|
87
|
+
|
|
88
|
+
// We will now set a list of sanity checks to ensure that the binary search will not fail
|
|
89
|
+
// due to invalid input parameters.
|
|
90
|
+
// If any of these sanity checks fail, then we will throw an error.
|
|
91
|
+
(
|
|
92
|
+
[
|
|
93
|
+
// Sanity check to ensure that the spoke pool client is updated
|
|
94
|
+
[spokePool.isUpdated, "Spoke pool client is not updated"],
|
|
95
|
+
// Sanity check to ensure that initHigh is greater than or equal to initLow.
|
|
96
|
+
[initLow <= initHigh, "Binary search failed because low > high"],
|
|
97
|
+
// Sanity check to ensure that init Low is greater than or equal to zero.
|
|
98
|
+
[initLow >= deploymentBlock, "Binary search failed because low must be >= deploymentBlock"],
|
|
99
|
+
// Sanity check to ensure that maxSearches is greater than zero.
|
|
100
|
+
[maxSearches > 0, "maxSearches must be > 0"],
|
|
101
|
+
// Sanity check to ensure that deploymentBlock is greater than or equal to zero.
|
|
102
|
+
[deploymentBlock >= 0, "deploymentBlock must be >= 0"],
|
|
103
|
+
] as [boolean, string][]
|
|
104
|
+
).forEach(([condition, errorMessage]) => {
|
|
105
|
+
// If the condition is false, then we will throw an error.
|
|
106
|
+
if (!condition) {
|
|
107
|
+
throw new Error(errorMessage);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Define a mapping of block numbers to number of deposits at that block. This saves repeated lookups.
|
|
112
|
+
const queriedIds: Record<number, number> = {};
|
|
113
|
+
|
|
114
|
+
// Define a llambda function to get the deposit ID at a block number. This function will first check the
|
|
115
|
+
// queriedIds cache to see if the deposit ID at the block number has already been queried. If not, it will
|
|
116
|
+
// make an eth_call request to get the deposit ID at the block number. It will then cache the deposit ID
|
|
117
|
+
// in the queriedIds cache.
|
|
118
|
+
const _getDepositIdAtBlock = async (blockNumber: number): Promise<number> => {
|
|
119
|
+
queriedIds[blockNumber] ??= await spokePool._getDepositIdAtBlock(blockNumber);
|
|
120
|
+
return queriedIds[blockNumber];
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// Get the the deposit ID at the low block, and the deposit ID at the high block in parallel.
|
|
124
|
+
const [highestDepositIdInRange, lowestDepositIdInRange] = await Promise.all([
|
|
125
|
+
_getDepositIdAtBlock(initHigh),
|
|
126
|
+
_getDepositIdAtBlock(Math.max(deploymentBlock, initLow - 1)),
|
|
127
|
+
]);
|
|
128
|
+
|
|
129
|
+
// If the deposit ID at the initial high block is less than the target deposit ID, then we know that
|
|
130
|
+
// the target deposit ID must be greater than the initial high block, so we can throw an error.
|
|
131
|
+
if (highestDepositIdInRange <= targetDepositId) {
|
|
132
|
+
// initLow = 5: Deposits Num: 10
|
|
133
|
+
// // targetId = 11 <- fail (triggers this error) // 10 <= 11
|
|
134
|
+
// // targetId = 10 <- fail (triggers this error) // 10 <= 10
|
|
135
|
+
// // targetId = 09 <- pass (does not trigger this error) // 10 <= 09
|
|
136
|
+
throw new Error(
|
|
137
|
+
`Target depositId is greater than the initial high block (${targetDepositId} > ${highestDepositIdInRange})`
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// If the deposit ID at the initial low block is greater than the target deposit ID, then we know that
|
|
142
|
+
// the target deposit ID must be less than the initial low block, so we can throw an error.
|
|
143
|
+
if (lowestDepositIdInRange > targetDepositId) {
|
|
144
|
+
// initLow = 5: Deposits Num: 10
|
|
145
|
+
// initLow-1 = 4: Deposits Num: 2
|
|
146
|
+
// // targetId = 1 <- fail (triggers this error)
|
|
147
|
+
// // targetId = 2 <- pass (does not trigger this error)
|
|
148
|
+
// // targetId = 3 <- pass (does not trigger this error)
|
|
149
|
+
throw new Error(
|
|
150
|
+
`Target depositId is less than the initial low block (${targetDepositId} > ${lowestDepositIdInRange})`
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Define the low and high block numbers for the binary search.
|
|
155
|
+
let low = initLow;
|
|
156
|
+
let high = initHigh;
|
|
157
|
+
|
|
158
|
+
// Define the number of searches performed so far.
|
|
159
|
+
let searches = 0;
|
|
160
|
+
|
|
161
|
+
do {
|
|
162
|
+
// Resolve the mid point of the block range.
|
|
163
|
+
const mid = Math.floor((low + high) / 2);
|
|
164
|
+
|
|
165
|
+
// Get the deposit ID at the mid point.
|
|
166
|
+
const midDepositId = await _getDepositIdAtBlock(mid);
|
|
167
|
+
|
|
168
|
+
// Let's define the latest ID of the current midpoint block.
|
|
169
|
+
const accountedIdByMidBlock = midDepositId - 1;
|
|
170
|
+
|
|
171
|
+
// If our target deposit ID is less than the smallest range of our
|
|
172
|
+
// midpoint deposit ID range, then we know that the target deposit ID
|
|
173
|
+
// must be in the lower half of the block range.
|
|
174
|
+
if (targetDepositId <= accountedIdByMidBlock) {
|
|
175
|
+
high = mid;
|
|
176
|
+
}
|
|
177
|
+
// If our target deposit ID is greater than the largest range of our
|
|
178
|
+
// midpoint deposit ID range, then we know that the target deposit ID
|
|
179
|
+
// must be in the upper half of the block range.
|
|
180
|
+
else {
|
|
181
|
+
low = mid + 1;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// We want to iterate until we've either found the block range or we've
|
|
185
|
+
// exceeded the maximum number of searches.
|
|
186
|
+
} while (++searches <= maxSearches && low < high);
|
|
187
|
+
|
|
188
|
+
// Sanity check to ensure that our low was not greater than our high.
|
|
189
|
+
if (low > high) {
|
|
190
|
+
throw new Error(`Binary search failed (${low} > ${high}). SHOULD NEVER HAPPEN (but here we are)`);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// We've either found the block range or we've exceeded the maximum number of searches.
|
|
194
|
+
// In either case, the block range is [low, high] so we can return it.
|
|
195
|
+
return { low, high };
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Finds the deposit id at a specific block number.
|
|
200
|
+
* @param blockTag The block number to search for the deposit ID at.
|
|
201
|
+
* @returns The deposit ID.
|
|
202
|
+
*/
|
|
203
|
+
export async function getDepositIdAtBlock(contract: Contract, blockTag: number): Promise<number> {
|
|
204
|
+
const depositIdAtBlock = await contract.numberOfDeposits({ blockTag });
|
|
205
|
+
// Sanity check to ensure that the deposit ID is an integer and is greater than or equal to zero.
|
|
206
|
+
if (!Number.isInteger(depositIdAtBlock) || depositIdAtBlock < 0) {
|
|
207
|
+
throw new Error("Invalid deposit count");
|
|
208
|
+
}
|
|
209
|
+
return depositIdAtBlock;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Compute the RelayData hash for a fill. This can be used to determine the fill status.
|
|
214
|
+
* @param relayData RelayData information that is used to complete a fill.
|
|
215
|
+
* @param destinationChainId Supplementary destination chain ID required by V3 hashes.
|
|
216
|
+
* @returns The corresponding RelayData hash.
|
|
217
|
+
*/
|
|
218
|
+
export function getRelayDataHash(relayData: RelayData, destinationChainId: number): string {
|
|
219
|
+
return ethersUtils.keccak256(
|
|
220
|
+
ethersUtils.defaultAbiCoder.encode(
|
|
221
|
+
[
|
|
222
|
+
"tuple(" +
|
|
223
|
+
"address depositor," +
|
|
224
|
+
"address recipient," +
|
|
225
|
+
"address exclusiveRelayer," +
|
|
226
|
+
"address inputToken," +
|
|
227
|
+
"address outputToken," +
|
|
228
|
+
"uint256 inputAmount," +
|
|
229
|
+
"uint256 outputAmount," +
|
|
230
|
+
"uint256 originChainId," +
|
|
231
|
+
"uint32 depositId," +
|
|
232
|
+
"uint32 fillDeadline," +
|
|
233
|
+
"uint32 exclusivityDeadline," +
|
|
234
|
+
"bytes message" +
|
|
235
|
+
")",
|
|
236
|
+
"uint256 destinationChainId",
|
|
237
|
+
],
|
|
238
|
+
[relayData, destinationChainId]
|
|
239
|
+
)
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export function getRelayHashFromEvent(e: Deposit | Fill | SlowFillRequest): string {
|
|
244
|
+
return getRelayDataHash(e, e.destinationChainId);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Find the amount filled for a deposit at a particular block.
|
|
249
|
+
* @param spokePool SpokePool contract instance.
|
|
250
|
+
* @param relayData Deposit information that is used to complete a fill.
|
|
251
|
+
* @param blockTag Block tag (numeric or "latest") to query at.
|
|
252
|
+
* @returns The amount filled for the specified deposit at the requested block (or latest).
|
|
253
|
+
*/
|
|
254
|
+
export async function relayFillStatus(
|
|
255
|
+
spokePool: Contract,
|
|
256
|
+
relayData: RelayData,
|
|
257
|
+
blockTag?: number | "latest",
|
|
258
|
+
destinationChainId?: number
|
|
259
|
+
): Promise<FillStatus> {
|
|
260
|
+
destinationChainId ??= await spokePool.chainId();
|
|
261
|
+
const hash = getRelayDataHash(relayData, destinationChainId!);
|
|
262
|
+
const _fillStatus = await spokePool.fillStatuses(hash, { blockTag });
|
|
263
|
+
const fillStatus = Number(_fillStatus);
|
|
264
|
+
|
|
265
|
+
if (![FillStatus.Unfilled, FillStatus.RequestedSlowFill, FillStatus.Filled].includes(fillStatus)) {
|
|
266
|
+
const { originChainId, depositId } = relayData;
|
|
267
|
+
throw new Error(`relayFillStatus: Unexpected fillStatus for ${originChainId} deposit ${depositId} (${fillStatus})`);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return fillStatus;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export async function fillStatusArray(
|
|
274
|
+
spokePool: Contract,
|
|
275
|
+
relayData: RelayData[],
|
|
276
|
+
blockTag: BlockTag = "latest"
|
|
277
|
+
): Promise<(FillStatus | undefined)[]> {
|
|
278
|
+
const fillStatuses = "fillStatuses";
|
|
279
|
+
const destinationChainId = await spokePool.chainId();
|
|
280
|
+
|
|
281
|
+
const queries = relayData.map((relayData) => {
|
|
282
|
+
const hash = getRelayDataHash(relayData, destinationChainId);
|
|
283
|
+
return spokePool.interface.encodeFunctionData(fillStatuses, [hash]);
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
// Chunk the hashes into appropriate sizes to avoid death by rpc.
|
|
287
|
+
const chunkSize = 250;
|
|
288
|
+
const chunkedQueries = chunk(queries, chunkSize);
|
|
289
|
+
|
|
290
|
+
const multicalls = await Promise.all(
|
|
291
|
+
chunkedQueries.map((queries) => spokePool.callStatic.multicall(queries, { blockTag }))
|
|
292
|
+
);
|
|
293
|
+
const status = multicalls
|
|
294
|
+
.map((multicall: BytesLike[]) =>
|
|
295
|
+
multicall.map((result) => spokePool.interface.decodeFunctionResult(fillStatuses, result)[0])
|
|
296
|
+
)
|
|
297
|
+
.flat();
|
|
298
|
+
|
|
299
|
+
const bnUnfilled = toBN(FillStatus.Unfilled);
|
|
300
|
+
const bnFilled = toBN(FillStatus.Filled);
|
|
301
|
+
|
|
302
|
+
return status.map((status: unknown) => {
|
|
303
|
+
return BigNumber.isBigNumber(status) && status.gte(bnUnfilled) && status.lte(bnFilled)
|
|
304
|
+
? status.toNumber()
|
|
305
|
+
: undefined;
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Find the block at which a fill was completed.
|
|
311
|
+
* @todo After SpokePool upgrade, this function can be simplified to use the FillStatus enum.
|
|
312
|
+
* @param spokePool SpokePool contract instance.
|
|
313
|
+
* @param relayData Deposit information that is used to complete a fill.
|
|
314
|
+
* @param lowBlockNumber The lower bound of the search. Must be bounded by SpokePool deployment.
|
|
315
|
+
* @param highBlocknumber Optional upper bound for the search.
|
|
316
|
+
* @returns The block number at which the relay was completed, or undefined.
|
|
317
|
+
*/
|
|
318
|
+
export async function findFillBlock(
|
|
319
|
+
spokePool: Contract,
|
|
320
|
+
relayData: RelayData,
|
|
321
|
+
lowBlockNumber: number,
|
|
322
|
+
highBlockNumber?: number
|
|
323
|
+
): Promise<number | undefined> {
|
|
324
|
+
const { provider } = spokePool;
|
|
325
|
+
highBlockNumber ??= await provider.getBlockNumber();
|
|
326
|
+
assert(highBlockNumber > lowBlockNumber, `Block numbers out of range (${lowBlockNumber} > ${highBlockNumber})`);
|
|
327
|
+
|
|
328
|
+
// In production the chainId returned from the provider matches 1:1 with the actual chainId. Querying the provider
|
|
329
|
+
// object saves an RPC query becasue the chainId is cached by StaticJsonRpcProvider instances. In hre, the SpokePool
|
|
330
|
+
// may be configured with a different chainId than what is returned by the provider.
|
|
331
|
+
// @todo Sub out actual chain IDs w/ CHAIN_IDs constants
|
|
332
|
+
const destinationChainId = Object.values(CHAIN_IDs).includes(relayData.originChainId)
|
|
333
|
+
? (await provider.getNetwork()).chainId
|
|
334
|
+
: Number(await spokePool.chainId());
|
|
335
|
+
assert(
|
|
336
|
+
relayData.originChainId !== destinationChainId,
|
|
337
|
+
`Origin & destination chain IDs must not be equal (${destinationChainId})`
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
// Make sure the relay war completed within the block range supplied by the caller.
|
|
341
|
+
const [initialFillStatus, finalFillStatus] = (
|
|
342
|
+
await Promise.all([
|
|
343
|
+
relayFillStatus(spokePool, relayData, lowBlockNumber, destinationChainId),
|
|
344
|
+
relayFillStatus(spokePool, relayData, highBlockNumber, destinationChainId),
|
|
345
|
+
])
|
|
346
|
+
).map(Number);
|
|
347
|
+
|
|
348
|
+
if (finalFillStatus !== FillStatus.Filled) {
|
|
349
|
+
return undefined; // Wasn't filled within the specified block range.
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Was filled earlier than the specified lowBlock. This is an error by the caller.
|
|
353
|
+
if (initialFillStatus === FillStatus.Filled) {
|
|
354
|
+
const { depositId, originChainId } = relayData;
|
|
355
|
+
const [srcChain, dstChain] = [getNetworkName(originChainId), getNetworkName(destinationChainId)];
|
|
356
|
+
throw new Error(`${srcChain} deposit ${depositId} filled on ${dstChain} before block ${lowBlockNumber}`);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Find the leftmost block where filledAmount equals the deposit amount.
|
|
360
|
+
do {
|
|
361
|
+
const midBlockNumber = Math.floor((highBlockNumber + lowBlockNumber) / 2);
|
|
362
|
+
const fillStatus = await relayFillStatus(spokePool, relayData, midBlockNumber, destinationChainId);
|
|
363
|
+
|
|
364
|
+
if (fillStatus === FillStatus.Filled) {
|
|
365
|
+
highBlockNumber = midBlockNumber;
|
|
366
|
+
} else {
|
|
367
|
+
lowBlockNumber = midBlockNumber + 1;
|
|
368
|
+
}
|
|
369
|
+
} while (lowBlockNumber < highBlockNumber);
|
|
370
|
+
|
|
371
|
+
return lowBlockNumber;
|
|
372
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { BlockTag } from "@ethersproject/abstract-provider";
|
|
2
|
+
import { BigNumber, Contract, providers, Signer } from "ethers";
|
|
3
|
+
import * as constants from "../constants";
|
|
4
|
+
import { L1Token } from "../interfaces";
|
|
5
|
+
import { ERC20__factory } from "../typechain";
|
|
6
|
+
import { getNetworkName } from "./NetworkUtils";
|
|
7
|
+
import { isDefined } from "./TypeGuards";
|
|
8
|
+
const { TOKEN_SYMBOLS_MAP, CHAIN_IDs } = constants;
|
|
9
|
+
|
|
10
|
+
type SignerOrProvider = providers.Provider | Signer;
|
|
11
|
+
|
|
12
|
+
export async function fetchTokenInfo(address: string, signerOrProvider: SignerOrProvider): Promise<L1Token> {
|
|
13
|
+
const token = new Contract(address, ERC20__factory.abi, signerOrProvider);
|
|
14
|
+
const [symbol, decimals] = await Promise.all([token.symbol(), token.decimals()]);
|
|
15
|
+
return { address, symbol, decimals };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const getL2TokenAddresses = (
|
|
19
|
+
l1TokenAddress: string,
|
|
20
|
+
l1ChainId = CHAIN_IDs.MAINNET
|
|
21
|
+
): { [chainId: number]: string } | undefined => {
|
|
22
|
+
return Object.values(TOKEN_SYMBOLS_MAP).find((details) => {
|
|
23
|
+
return details.addresses[l1ChainId] === l1TokenAddress;
|
|
24
|
+
})?.addresses;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Resolve a token symbol to an L1Token description on a particular chain ID.
|
|
29
|
+
* @notice Not to be confused with the HubPool's internal view on the supported origin/destination token for a chain.
|
|
30
|
+
* @param symbol Symbol to query.
|
|
31
|
+
* @param chainId Chain ID to query on.
|
|
32
|
+
* @returns Symbol, decimals and contract address on the requested chain.
|
|
33
|
+
*/
|
|
34
|
+
export function resolveSymbolOnChain(chainId: number, symbol: string): L1Token {
|
|
35
|
+
// @dev Suppress tsc complaints by casting symbol to the expected type.
|
|
36
|
+
const token = TOKEN_SYMBOLS_MAP[symbol as keyof typeof TOKEN_SYMBOLS_MAP];
|
|
37
|
+
if (!isDefined(token) || !isDefined(token.addresses[chainId])) {
|
|
38
|
+
const network = getNetworkName(chainId);
|
|
39
|
+
throw new Error(`Unable to find token ${symbol} on ${network} (chain ID ${chainId}`);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const { decimals, addresses } = token;
|
|
43
|
+
const address = addresses[chainId];
|
|
44
|
+
|
|
45
|
+
return { symbol, decimals, address };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Returns the contract address for a given token symbol and chainId.
|
|
50
|
+
* @param symbol A case-insensitive token symbol.
|
|
51
|
+
* @param chainId The chainId to resolve the contract address for.
|
|
52
|
+
* @param tokenMapping A parameter to determine where to source token information. Defaults to the constants variant.
|
|
53
|
+
* @returns The contract address for the given token symbol and chainId, or undefined if the token symbol is not supported.
|
|
54
|
+
*/
|
|
55
|
+
export const resolveContractFromSymbol = (
|
|
56
|
+
symbol: string,
|
|
57
|
+
chainId: string,
|
|
58
|
+
tokenMapping = TOKEN_SYMBOLS_MAP
|
|
59
|
+
): string | undefined => {
|
|
60
|
+
return Object.values(tokenMapping).find((details) => {
|
|
61
|
+
return details.symbol.toLowerCase() === symbol.toLowerCase();
|
|
62
|
+
})?.addresses[Number(chainId)];
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export function getTokenInformationFromAddress(address: string, tokenMapping = TOKEN_SYMBOLS_MAP): L1Token | undefined {
|
|
66
|
+
const details = Object.values(tokenMapping).find((details) => {
|
|
67
|
+
return Object.values(details.addresses).some((t) => t.toLowerCase() === address.toLowerCase());
|
|
68
|
+
});
|
|
69
|
+
return isDefined(details)
|
|
70
|
+
? {
|
|
71
|
+
decimals: details.decimals,
|
|
72
|
+
symbol: details.symbol,
|
|
73
|
+
address,
|
|
74
|
+
}
|
|
75
|
+
: undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Retrieves the ERC20 balance for a given address and token address.
|
|
80
|
+
* @param address The address to retrieve the balance for.
|
|
81
|
+
* @param tokenAddress The token address
|
|
82
|
+
* @param signerOrProvider A valid ethers.js Signer or Provider object.
|
|
83
|
+
* @param blockTag The block tag to retrieve the balance at.
|
|
84
|
+
* @returns The balance of the given address for the given token address.
|
|
85
|
+
*/
|
|
86
|
+
export function getTokenBalance(
|
|
87
|
+
address: string,
|
|
88
|
+
tokenAddress: string,
|
|
89
|
+
signerOrProvider: SignerOrProvider,
|
|
90
|
+
blockTag: BlockTag = "latest"
|
|
91
|
+
): Promise<BigNumber> {
|
|
92
|
+
const token = ERC20__factory.connect(tokenAddress, signerOrProvider);
|
|
93
|
+
return token.balanceOf(address, { blockTag });
|
|
94
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function isPromiseFulfilled<T>(
|
|
2
|
+
promiseSettledResult: PromiseSettledResult<T>
|
|
3
|
+
): promiseSettledResult is PromiseFulfilledResult<T> {
|
|
4
|
+
return promiseSettledResult.status === "fulfilled";
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function isPromiseRejected<T>(
|
|
8
|
+
promiseSettledResult: PromiseSettledResult<T>
|
|
9
|
+
): promiseSettledResult is PromiseRejectedResult {
|
|
10
|
+
return promiseSettledResult.status === "rejected";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function isDefined<T>(input: T | null | undefined): input is T {
|
|
14
|
+
return input !== null && input !== undefined;
|
|
15
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SpokePoolClient } from "../clients";
|
|
2
|
+
|
|
3
|
+
export type MakeOptional<Type, Key extends keyof Type> = Omit<Type, Key> & Partial<Pick<Type, Key>>;
|
|
4
|
+
|
|
5
|
+
export type AnyObject = Record<string, unknown>;
|
|
6
|
+
|
|
7
|
+
export type SpokePoolClients = Record<number, SpokePoolClient>;
|
|
8
|
+
|
|
9
|
+
export type Reviver = (key: string, value: unknown) => unknown;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Fill, FillType, SlowFillLeaf } from "../interfaces";
|
|
2
|
+
import { BN } from "./BigNumberUtils";
|
|
3
|
+
import { fixedPointAdjustment } from "./common";
|
|
4
|
+
|
|
5
|
+
export function isSlowFill(fill: Fill): boolean {
|
|
6
|
+
return fill.relayExecutionInfo.fillType === FillType.SlowFill;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function getSlowFillLeafLpFeePct(leaf: SlowFillLeaf): BN {
|
|
10
|
+
const { relayData, updatedOutputAmount } = leaf;
|
|
11
|
+
return relayData.inputAmount.sub(updatedOutputAmount).mul(fixedPointAdjustment).div(relayData.inputAmount);
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BigNumber, ethers } from "ethers";
|
|
2
|
+
import { object, min as Min, define, optional, string, integer } from "superstruct";
|
|
3
|
+
import { DepositWithBlock } from "../interfaces";
|
|
4
|
+
|
|
5
|
+
const AddressValidator = define<string>("AddressValidator", (v) => ethers.utils.isAddress(String(v)));
|
|
6
|
+
const HexValidator = define<string>("HexValidator", (v) => ethers.utils.isHexString(String(v)));
|
|
7
|
+
const BigNumberValidator = define<BigNumber>("BigNumberValidator", (v) => ethers.BigNumber.isBigNumber(v));
|
|
8
|
+
|
|
9
|
+
const V3DepositSchema = object({
|
|
10
|
+
depositId: Min(integer(), 0),
|
|
11
|
+
depositor: AddressValidator,
|
|
12
|
+
recipient: AddressValidator,
|
|
13
|
+
inputToken: AddressValidator,
|
|
14
|
+
inputAmount: BigNumberValidator,
|
|
15
|
+
originChainId: Min(integer(), 0),
|
|
16
|
+
destinationChainId: Min(integer(), 0),
|
|
17
|
+
quoteTimestamp: Min(integer(), 0),
|
|
18
|
+
fillDeadline: Min(integer(), 0),
|
|
19
|
+
exclusivityDeadline: Min(integer(), 0),
|
|
20
|
+
exclusiveRelayer: AddressValidator,
|
|
21
|
+
realizedLpFeePct: optional(BigNumberValidator),
|
|
22
|
+
outputToken: AddressValidator,
|
|
23
|
+
outputAmount: BigNumberValidator,
|
|
24
|
+
message: string(),
|
|
25
|
+
speedUpSignature: optional(HexValidator),
|
|
26
|
+
updatedOutputAmount: optional(BigNumberValidator),
|
|
27
|
+
updatedRecipient: optional(string()),
|
|
28
|
+
updatedMessage: optional(string()),
|
|
29
|
+
blockNumber: Min(integer(), 0),
|
|
30
|
+
transactionIndex: Min(integer(), 0),
|
|
31
|
+
logIndex: Min(integer(), 0),
|
|
32
|
+
quoteBlockNumber: Min(integer(), 0),
|
|
33
|
+
transactionHash: HexValidator,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
export function isDepositFormedCorrectly(deposit: unknown): deposit is DepositWithBlock {
|
|
37
|
+
return V3DepositSchema.is(deposit);
|
|
38
|
+
}
|