@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,204 @@
|
|
|
1
|
+
import { L2Provider } from "@eth-optimism/sdk/dist/interfaces/l2-provider";
|
|
2
|
+
import Decimal from "decimal.js";
|
|
3
|
+
import { BigNumber, PopulatedTransaction, providers } from "ethers";
|
|
4
|
+
import { TypedMessage } from "../interfaces/TypedData";
|
|
5
|
+
import { BigNumberish, BN } from "./BigNumberUtils";
|
|
6
|
+
export type Decimalish = string | number | Decimal;
|
|
7
|
+
export declare const AddressZero = "0x0000000000000000000000000000000000000000";
|
|
8
|
+
export declare const MAX_BIG_INT: BigNumber;
|
|
9
|
+
/**
|
|
10
|
+
* toBNWei.
|
|
11
|
+
*
|
|
12
|
+
* @param {BigNumberish} num
|
|
13
|
+
* @param {number} decimals
|
|
14
|
+
* @returns {BN}
|
|
15
|
+
*/
|
|
16
|
+
export declare const toBNWei: (num: BigNumberish, decimals?: number) => BN;
|
|
17
|
+
/**
|
|
18
|
+
* fromWei.
|
|
19
|
+
*
|
|
20
|
+
* @param {BigNumberish} num
|
|
21
|
+
* @param {number} decimals
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
export declare const fromWei: (num: BigNumberish, decimals?: number) => string;
|
|
25
|
+
/**
|
|
26
|
+
* min.
|
|
27
|
+
*
|
|
28
|
+
* @param {BigNumberish} a
|
|
29
|
+
* @param {BigNumberish} b
|
|
30
|
+
* @returns {BN}
|
|
31
|
+
*/
|
|
32
|
+
export declare function min(a: BigNumberish, b: BigNumberish): BN;
|
|
33
|
+
/**
|
|
34
|
+
* max.
|
|
35
|
+
*
|
|
36
|
+
* @param {BigNumberish} a
|
|
37
|
+
* @param {BigNumberish} b
|
|
38
|
+
* @returns {BN}
|
|
39
|
+
*/
|
|
40
|
+
export declare function max(a: BigNumberish, b: BigNumberish): BN;
|
|
41
|
+
export declare const fixedPointAdjustment: BigNumber;
|
|
42
|
+
/**
|
|
43
|
+
* Convert an amount of native gas token into a token given price and token decimals.
|
|
44
|
+
*
|
|
45
|
+
* @param {BigNumberish} fromAmount - Amount of native gas token to convert.
|
|
46
|
+
* @param {string | number} [ price=1 ] - The price as native gas token per token, ie how much native gas token can 1 token buy.
|
|
47
|
+
* @param {} [ toDecimals=18 ] - Number of decimals for the token currency.
|
|
48
|
+
* @param {} [ nativeDecimals=18 ] - Number of decimals for the native token currency.
|
|
49
|
+
* @returns {string} The number of tokens denominated in token decimals in the smallest unit (wei).
|
|
50
|
+
*/
|
|
51
|
+
export declare function nativeToToken(fromAmount: BigNumberish, price?: string | number, toDecimals?: number, nativeDecimals?: number): string;
|
|
52
|
+
/**
|
|
53
|
+
* Convert a gas amount and gas price to wei.
|
|
54
|
+
*
|
|
55
|
+
* @param {number} gas - gas amount.
|
|
56
|
+
* @param {BigNumberish} gasPrice - gas price in gwei.
|
|
57
|
+
* @returns {BigNumber} - total fees in wei.
|
|
58
|
+
*/
|
|
59
|
+
export declare const gasCost: (gas: BigNumberish, gasPrice: BigNumberish) => BigNumber;
|
|
60
|
+
/**
|
|
61
|
+
* getGasFees. Low level pure function call to calculate gas fees.
|
|
62
|
+
*
|
|
63
|
+
* @param {number} gas - The gast cost for transfer, use constants defined in file.
|
|
64
|
+
* @param {BigNumberish} gasPrice - Estimated gas price in wei.
|
|
65
|
+
* @param {string | number} [price = 1] - The price of the token in native gas token, how much native gas token can 1 token buy.
|
|
66
|
+
* @param {number} [decimals=18] - Number of decimals of token.
|
|
67
|
+
* @returns {string} - The value of fees native to the token provided, in its smallest unit.
|
|
68
|
+
*/
|
|
69
|
+
export declare function calculateGasFees(gas: number, gasPrice: BigNumberish, price?: string | number, decimals?: number): string;
|
|
70
|
+
/**
|
|
71
|
+
* percent.
|
|
72
|
+
*
|
|
73
|
+
* @param {BigNumberish} numerator
|
|
74
|
+
* @param {BigNumberish} denominator
|
|
75
|
+
* @returns {BN}
|
|
76
|
+
*/
|
|
77
|
+
export declare function percent(numerator: BigNumberish, denominator: BigNumberish): BN;
|
|
78
|
+
/**
|
|
79
|
+
* calcContinuousCompoundInterest. From https://www.calculatorsoup.com/calculators/financial/compound-interest-calculator.php?given_data=find_r&A=2&P=1&n=0&t=1&given_data_last=find_r&action=solve
|
|
80
|
+
* Returns a yearly interest rate if start/end amount had been continuously compounded over the period elapsed. Multiply result by 100 for a %.
|
|
81
|
+
*
|
|
82
|
+
* @param {string} startAmount
|
|
83
|
+
* @param {string} endAmount
|
|
84
|
+
* @param {string} periodsElapsed
|
|
85
|
+
* @param {string} periodsPerYear
|
|
86
|
+
*/
|
|
87
|
+
export declare const calcContinuousCompoundInterest: (startAmount: Decimalish, endAmount: Decimalish, periodsElapsed: Decimalish, periodsPerYear: Decimalish) => string;
|
|
88
|
+
/**
|
|
89
|
+
* calcPeriodicCompoundInterest. Taken from https://www.calculatorsoup.com/calculators/financial/compound-interest-calculator.php?given_data=find_r&A=2&P=1&n=365&t=1&given_data_last=find_r&action=solve
|
|
90
|
+
* This will return a periodically compounded interest rate for 1 year. Multiply result by 100 for a %.
|
|
91
|
+
*
|
|
92
|
+
* @param {string} startAmount - Starting amount or price
|
|
93
|
+
* @param {string} endAmount - Ending amount or price
|
|
94
|
+
* @param {string} periodsElapsed - How many periods elapsed for the start and end amount.
|
|
95
|
+
* @param {string} periodsPerYear - How many periods in 1 year.
|
|
96
|
+
*/
|
|
97
|
+
export declare const calcPeriodicCompoundInterest: (startAmount: Decimalish, endAmount: Decimalish, periodsElapsed: Decimalish, periodsPerYear: Decimalish) => string;
|
|
98
|
+
/**
|
|
99
|
+
* calcApr. Simple apr calculation based on extrapolating the difference for a short period over a year.
|
|
100
|
+
*
|
|
101
|
+
* @param {Decimalish} startAmount - Starting amount or price
|
|
102
|
+
* @param {Decimalish} endAmount - Ending amount or price
|
|
103
|
+
* @param {Decimalish} periodsElapsed - periods elapsed from start to end
|
|
104
|
+
* @param {Decimalish} periodsPerYear - periods per year
|
|
105
|
+
*/
|
|
106
|
+
export declare const calcApr: (startAmount: Decimalish, endAmount: Decimalish, periodsElapsed: Decimalish, periodsPerYear: Decimalish) => string;
|
|
107
|
+
/**
|
|
108
|
+
* Takes two values and returns a list of number intervals
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```js
|
|
112
|
+
* getSamplesBetween(1, 9, 3) //returns [[1, 3], [4, 7], [8, 9]]
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export declare const getSamplesBetween: (min: number, max: number, size: number) => number[][];
|
|
116
|
+
/**
|
|
117
|
+
* A promise that resolves after a specified number of seconds
|
|
118
|
+
* @param seconds The number of seconds to wait
|
|
119
|
+
*/
|
|
120
|
+
export declare function delay(seconds: number): Promise<unknown>;
|
|
121
|
+
/**
|
|
122
|
+
* Attempt to retry a function call a number of times with a delay between each attempt
|
|
123
|
+
* @param call The function to call
|
|
124
|
+
* @param times The number of times to retry
|
|
125
|
+
* @param delayS The number of seconds to delay between each attempt
|
|
126
|
+
* @returns The result of the function call.
|
|
127
|
+
*/
|
|
128
|
+
export declare function retry<T>(call: () => Promise<T>, times: number, delayS: number): Promise<T>;
|
|
129
|
+
export type TransactionCostEstimate = {
|
|
130
|
+
nativeGasCost: BigNumber;
|
|
131
|
+
tokenGasCost: BigNumber;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Estimates the total gas cost required to submit an unsigned (populated) transaction on-chain.
|
|
135
|
+
* @param unsignedTx The unsigned transaction that this function will estimate.
|
|
136
|
+
* @param senderAddress The address that the transaction will be submitted from.
|
|
137
|
+
* @param provider A valid ethers provider - will be used to reason the gas price.
|
|
138
|
+
* @param gasMarkup Markup on the estimated gas cost. For example, 0.2 will increase this resulting value 1.2x.
|
|
139
|
+
* @param gasPrice A manually provided gas price - if set, this function will not resolve the current gas price.
|
|
140
|
+
* @returns Estimated cost in units of gas and the underlying gas token (gasPrice * estimatedGasUnits).
|
|
141
|
+
*/
|
|
142
|
+
export declare function estimateTotalGasRequiredByUnsignedTransaction(unsignedTx: PopulatedTransaction, senderAddress: string, provider: providers.Provider | L2Provider<providers.Provider>, gasMarkup: number, gasPrice?: BigNumberish): Promise<TransactionCostEstimate>;
|
|
143
|
+
export type UpdateDepositDetailsMessageType = {
|
|
144
|
+
UpdateDepositDetails: [
|
|
145
|
+
{
|
|
146
|
+
name: "depositId";
|
|
147
|
+
type: "uint32";
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "originChainId";
|
|
151
|
+
type: "uint256";
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "updatedRelayerFeePct";
|
|
155
|
+
type: "int64";
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: "updatedRecipient";
|
|
159
|
+
type: "address";
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "updatedMessage";
|
|
163
|
+
type: "bytes";
|
|
164
|
+
}
|
|
165
|
+
];
|
|
166
|
+
};
|
|
167
|
+
export type UpdateV3DepositDetailsMessageType = {
|
|
168
|
+
UpdateDepositDetails: [
|
|
169
|
+
{
|
|
170
|
+
name: "depositId";
|
|
171
|
+
type: "uint32";
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "originChainId";
|
|
175
|
+
type: "uint256";
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: "updatedOutputAmount";
|
|
179
|
+
type: "uint256";
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: "updatedRecipient";
|
|
183
|
+
type: "address";
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "updatedMessage";
|
|
187
|
+
type: "bytes";
|
|
188
|
+
}
|
|
189
|
+
];
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Utility function to get EIP-712 compliant typed data that can be signed with the JSON-RPC method
|
|
193
|
+
* `eth_signedTypedDataV4` in MetaMask (https://docs.metamask.io/guide/signing-data.html). The resulting signature
|
|
194
|
+
* can then be used to call the method `speedUpDeposit` of a `SpokePool.sol` contract.
|
|
195
|
+
* @param depositId The deposit ID to speed up.
|
|
196
|
+
* @param originChainId The chain ID of the origin chain.
|
|
197
|
+
* @param updatedRelayerFeePct The new relayer fee percentage.
|
|
198
|
+
* @param updatedRecipient The new recipient address.
|
|
199
|
+
* @param updatedMessage The new message that should be provided to the recipient.
|
|
200
|
+
* @return EIP-712 compliant typed data.
|
|
201
|
+
*/
|
|
202
|
+
export declare function getUpdateDepositTypedData(depositId: number, originChainId: number, updatedRelayerFeePct: BigNumber, updatedRecipient: string, updatedMessage: string): TypedMessage<UpdateDepositDetailsMessageType>;
|
|
203
|
+
export declare function getUpdateV3DepositTypedData(depositId: number, originChainId: number, updatedOutputAmount: BigNumber, updatedRecipient: string, updatedMessage: string): TypedMessage<UpdateV3DepositDetailsMessageType>;
|
|
204
|
+
export declare function randomAddress(): string;
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { __awaiter, __generator } from "tslib";
|
|
2
|
+
import { isL2Provider as isOptimismL2Provider } from "@eth-optimism/sdk/dist/l2-provider";
|
|
3
|
+
import assert from "assert";
|
|
4
|
+
import Decimal from "decimal.js";
|
|
5
|
+
import { BigNumber, ethers, VoidSigner } from "ethers";
|
|
6
|
+
import { getGasPriceEstimate } from "../gasPriceOracle";
|
|
7
|
+
import { toBN } from "./BigNumberUtils";
|
|
8
|
+
import { ConvertDecimals } from "./FormattingUtils";
|
|
9
|
+
import { chainIsOPStack } from "./NetworkUtils";
|
|
10
|
+
export var AddressZero = ethers.constants.AddressZero;
|
|
11
|
+
export var MAX_BIG_INT = BigNumber.from(Number.MAX_SAFE_INTEGER.toString());
|
|
12
|
+
/**
|
|
13
|
+
* toBNWei.
|
|
14
|
+
*
|
|
15
|
+
* @param {BigNumberish} num
|
|
16
|
+
* @param {number} decimals
|
|
17
|
+
* @returns {BN}
|
|
18
|
+
*/
|
|
19
|
+
export var toBNWei = function (num, decimals) { return ethers.utils.parseUnits(num.toString(), decimals); };
|
|
20
|
+
/**
|
|
21
|
+
* fromWei.
|
|
22
|
+
*
|
|
23
|
+
* @param {BigNumberish} num
|
|
24
|
+
* @param {number} decimals
|
|
25
|
+
* @returns {string}
|
|
26
|
+
*/
|
|
27
|
+
export var fromWei = function (num, decimals) {
|
|
28
|
+
return ethers.utils.formatUnits(num.toString(), decimals);
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* min.
|
|
32
|
+
*
|
|
33
|
+
* @param {BigNumberish} a
|
|
34
|
+
* @param {BigNumberish} b
|
|
35
|
+
* @returns {BN}
|
|
36
|
+
*/
|
|
37
|
+
export function min(a, b) {
|
|
38
|
+
var bna = toBN(a);
|
|
39
|
+
var bnb = toBN(b);
|
|
40
|
+
return bna.lte(bnb) ? bna : bnb;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* max.
|
|
44
|
+
*
|
|
45
|
+
* @param {BigNumberish} a
|
|
46
|
+
* @param {BigNumberish} b
|
|
47
|
+
* @returns {BN}
|
|
48
|
+
*/
|
|
49
|
+
export function max(a, b) {
|
|
50
|
+
var bna = toBN(a);
|
|
51
|
+
var bnb = toBN(b);
|
|
52
|
+
return bna.gte(bnb) ? bna : bnb;
|
|
53
|
+
}
|
|
54
|
+
export var fixedPointAdjustment = toBNWei("1");
|
|
55
|
+
/**
|
|
56
|
+
* Convert an amount of native gas token into a token given price and token decimals.
|
|
57
|
+
*
|
|
58
|
+
* @param {BigNumberish} fromAmount - Amount of native gas token to convert.
|
|
59
|
+
* @param {string | number} [ price=1 ] - The price as native gas token per token, ie how much native gas token can 1 token buy.
|
|
60
|
+
* @param {} [ toDecimals=18 ] - Number of decimals for the token currency.
|
|
61
|
+
* @param {} [ nativeDecimals=18 ] - Number of decimals for the native token currency.
|
|
62
|
+
* @returns {string} The number of tokens denominated in token decimals in the smallest unit (wei).
|
|
63
|
+
*/
|
|
64
|
+
export function nativeToToken(fromAmount, price, toDecimals, nativeDecimals) {
|
|
65
|
+
if (price === void 0) { price = 1; }
|
|
66
|
+
if (toDecimals === void 0) { toDecimals = 18; }
|
|
67
|
+
if (nativeDecimals === void 0) { nativeDecimals = 18; }
|
|
68
|
+
var priceWei = toBNWei(price);
|
|
69
|
+
var toAmount = toBNWei(fromAmount).div(priceWei);
|
|
70
|
+
return ConvertDecimals(nativeDecimals, toDecimals)(toAmount).toString();
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Convert a gas amount and gas price to wei.
|
|
74
|
+
*
|
|
75
|
+
* @param {number} gas - gas amount.
|
|
76
|
+
* @param {BigNumberish} gasPrice - gas price in gwei.
|
|
77
|
+
* @returns {BigNumber} - total fees in wei.
|
|
78
|
+
*/
|
|
79
|
+
export var gasCost = function (gas, gasPrice) {
|
|
80
|
+
return BigNumber.from(gas).mul(gasPrice);
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* getGasFees. Low level pure function call to calculate gas fees.
|
|
84
|
+
*
|
|
85
|
+
* @param {number} gas - The gast cost for transfer, use constants defined in file.
|
|
86
|
+
* @param {BigNumberish} gasPrice - Estimated gas price in wei.
|
|
87
|
+
* @param {string | number} [price = 1] - The price of the token in native gas token, how much native gas token can 1 token buy.
|
|
88
|
+
* @param {number} [decimals=18] - Number of decimals of token.
|
|
89
|
+
* @returns {string} - The value of fees native to the token provided, in its smallest unit.
|
|
90
|
+
*/
|
|
91
|
+
export function calculateGasFees(gas, gasPrice, price, decimals) {
|
|
92
|
+
if (price === void 0) { price = 1; }
|
|
93
|
+
if (decimals === void 0) { decimals = 18; }
|
|
94
|
+
var amountNative = gasCost(gas, gasPrice);
|
|
95
|
+
return nativeToToken(amountNative, price, decimals);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* percent.
|
|
99
|
+
*
|
|
100
|
+
* @param {BigNumberish} numerator
|
|
101
|
+
* @param {BigNumberish} denominator
|
|
102
|
+
* @returns {BN}
|
|
103
|
+
*/
|
|
104
|
+
export function percent(numerator, denominator) {
|
|
105
|
+
return fixedPointAdjustment.mul(numerator).div(denominator);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* calcContinuousCompoundInterest. From https://www.calculatorsoup.com/calculators/financial/compound-interest-calculator.php?given_data=find_r&A=2&P=1&n=0&t=1&given_data_last=find_r&action=solve
|
|
109
|
+
* Returns a yearly interest rate if start/end amount had been continuously compounded over the period elapsed. Multiply result by 100 for a %.
|
|
110
|
+
*
|
|
111
|
+
* @param {string} startAmount
|
|
112
|
+
* @param {string} endAmount
|
|
113
|
+
* @param {string} periodsElapsed
|
|
114
|
+
* @param {string} periodsPerYear
|
|
115
|
+
*/
|
|
116
|
+
export var calcContinuousCompoundInterest = function (startAmount, endAmount, periodsElapsed, periodsPerYear) {
|
|
117
|
+
var years = new Decimal(periodsPerYear).div(periodsElapsed);
|
|
118
|
+
return new Decimal(endAmount).div(startAmount).ln().div(years).toString();
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* calcPeriodicCompoundInterest. Taken from https://www.calculatorsoup.com/calculators/financial/compound-interest-calculator.php?given_data=find_r&A=2&P=1&n=365&t=1&given_data_last=find_r&action=solve
|
|
122
|
+
* This will return a periodically compounded interest rate for 1 year. Multiply result by 100 for a %.
|
|
123
|
+
*
|
|
124
|
+
* @param {string} startAmount - Starting amount or price
|
|
125
|
+
* @param {string} endAmount - Ending amount or price
|
|
126
|
+
* @param {string} periodsElapsed - How many periods elapsed for the start and end amount.
|
|
127
|
+
* @param {string} periodsPerYear - How many periods in 1 year.
|
|
128
|
+
*/
|
|
129
|
+
export var calcPeriodicCompoundInterest = function (startAmount, endAmount, periodsElapsed, periodsPerYear) {
|
|
130
|
+
var n = new Decimal(periodsPerYear);
|
|
131
|
+
var A = new Decimal(endAmount);
|
|
132
|
+
var P = new Decimal(startAmount);
|
|
133
|
+
var t = new Decimal(periodsPerYear).div(periodsElapsed);
|
|
134
|
+
var one = new Decimal(1);
|
|
135
|
+
return n
|
|
136
|
+
.mul(A.div(P)
|
|
137
|
+
.pow(one.div(n.div(t)))
|
|
138
|
+
.sub(one))
|
|
139
|
+
.toFixed(18);
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* calcApr. Simple apr calculation based on extrapolating the difference for a short period over a year.
|
|
143
|
+
*
|
|
144
|
+
* @param {Decimalish} startAmount - Starting amount or price
|
|
145
|
+
* @param {Decimalish} endAmount - Ending amount or price
|
|
146
|
+
* @param {Decimalish} periodsElapsed - periods elapsed from start to end
|
|
147
|
+
* @param {Decimalish} periodsPerYear - periods per year
|
|
148
|
+
*/
|
|
149
|
+
export var calcApr = function (startAmount, endAmount, periodsElapsed, periodsPerYear) {
|
|
150
|
+
return new Decimal(endAmount).sub(startAmount).div(startAmount).mul(periodsPerYear).div(periodsElapsed).toFixed(18);
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Takes two values and returns a list of number intervals
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```js
|
|
157
|
+
* getSamplesBetween(1, 9, 3) //returns [[1, 3], [4, 7], [8, 9]]
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
export var getSamplesBetween = function (min, max, size) {
|
|
161
|
+
var keepIterate = true;
|
|
162
|
+
var intervals = [];
|
|
163
|
+
while (keepIterate) {
|
|
164
|
+
var to = Math.min(min + size - 1, max);
|
|
165
|
+
intervals.push([min, to]);
|
|
166
|
+
min = to + 1;
|
|
167
|
+
if (min >= max)
|
|
168
|
+
keepIterate = false;
|
|
169
|
+
}
|
|
170
|
+
return intervals;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* A promise that resolves after a specified number of seconds
|
|
174
|
+
* @param seconds The number of seconds to wait
|
|
175
|
+
*/
|
|
176
|
+
export function delay(seconds) {
|
|
177
|
+
return new Promise(function (resolve) { return setTimeout(resolve, seconds * 1000); });
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Attempt to retry a function call a number of times with a delay between each attempt
|
|
181
|
+
* @param call The function to call
|
|
182
|
+
* @param times The number of times to retry
|
|
183
|
+
* @param delayS The number of seconds to delay between each attempt
|
|
184
|
+
* @returns The result of the function call.
|
|
185
|
+
*/
|
|
186
|
+
export function retry(call, times, delayS) {
|
|
187
|
+
var _this = this;
|
|
188
|
+
var promiseChain = call();
|
|
189
|
+
for (var i = 0; i < times; i++)
|
|
190
|
+
promiseChain = promiseChain.catch(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
191
|
+
return __generator(this, function (_a) {
|
|
192
|
+
switch (_a.label) {
|
|
193
|
+
case 0: return [4 /*yield*/, delay(delayS)];
|
|
194
|
+
case 1:
|
|
195
|
+
_a.sent();
|
|
196
|
+
return [4 /*yield*/, call()];
|
|
197
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}); });
|
|
201
|
+
return promiseChain;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Estimates the total gas cost required to submit an unsigned (populated) transaction on-chain.
|
|
205
|
+
* @param unsignedTx The unsigned transaction that this function will estimate.
|
|
206
|
+
* @param senderAddress The address that the transaction will be submitted from.
|
|
207
|
+
* @param provider A valid ethers provider - will be used to reason the gas price.
|
|
208
|
+
* @param gasMarkup Markup on the estimated gas cost. For example, 0.2 will increase this resulting value 1.2x.
|
|
209
|
+
* @param gasPrice A manually provided gas price - if set, this function will not resolve the current gas price.
|
|
210
|
+
* @returns Estimated cost in units of gas and the underlying gas token (gasPrice * estimatedGasUnits).
|
|
211
|
+
*/
|
|
212
|
+
export function estimateTotalGasRequiredByUnsignedTransaction(unsignedTx, senderAddress, provider, gasMarkup, gasPrice) {
|
|
213
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
214
|
+
var gasTotalMultiplier, chainId, voidSigner, nativeGasCost, tokenGasCost, populatedTransaction, gasPriceEstimate;
|
|
215
|
+
return __generator(this, function (_a) {
|
|
216
|
+
switch (_a.label) {
|
|
217
|
+
case 0:
|
|
218
|
+
assert(gasMarkup > -1 && gasMarkup <= 4, "Require -1.0 < Gas Markup (".concat(gasMarkup, ") <= 4.0 for a total gas multiplier within (0, +5.0]"));
|
|
219
|
+
gasTotalMultiplier = toBNWei(1.0 + gasMarkup);
|
|
220
|
+
return [4 /*yield*/, provider.getNetwork()];
|
|
221
|
+
case 1:
|
|
222
|
+
chainId = (_a.sent()).chainId;
|
|
223
|
+
voidSigner = new VoidSigner(senderAddress, provider);
|
|
224
|
+
return [4 /*yield*/, voidSigner.estimateGas(unsignedTx)];
|
|
225
|
+
case 2:
|
|
226
|
+
nativeGasCost = _a.sent();
|
|
227
|
+
if (!chainIsOPStack(chainId)) return [3 /*break*/, 5];
|
|
228
|
+
assert(isOptimismL2Provider(provider), "Unexpected provider for chain ID ".concat(chainId, "."));
|
|
229
|
+
assert(gasPrice === undefined, "Gas price (".concat(gasPrice, ") supplied for Optimism gas estimation (unused)."));
|
|
230
|
+
return [4 /*yield*/, voidSigner.populateTransaction(unsignedTx)];
|
|
231
|
+
case 3:
|
|
232
|
+
populatedTransaction = _a.sent();
|
|
233
|
+
return [4 /*yield*/, provider.estimateTotalGasCost(populatedTransaction)];
|
|
234
|
+
case 4:
|
|
235
|
+
tokenGasCost = _a.sent();
|
|
236
|
+
return [3 /*break*/, 8];
|
|
237
|
+
case 5:
|
|
238
|
+
if (!!gasPrice) return [3 /*break*/, 7];
|
|
239
|
+
return [4 /*yield*/, getGasPriceEstimate(provider)];
|
|
240
|
+
case 6:
|
|
241
|
+
gasPriceEstimate = _a.sent();
|
|
242
|
+
gasPrice = gasPriceEstimate.maxFeePerGas;
|
|
243
|
+
_a.label = 7;
|
|
244
|
+
case 7:
|
|
245
|
+
tokenGasCost = nativeGasCost.mul(gasPrice);
|
|
246
|
+
_a.label = 8;
|
|
247
|
+
case 8:
|
|
248
|
+
// Scale the results by the computed multiplier.
|
|
249
|
+
nativeGasCost = nativeGasCost.mul(gasTotalMultiplier).div(fixedPointAdjustment);
|
|
250
|
+
tokenGasCost = tokenGasCost.mul(gasTotalMultiplier).div(fixedPointAdjustment);
|
|
251
|
+
return [2 /*return*/, {
|
|
252
|
+
nativeGasCost: nativeGasCost,
|
|
253
|
+
tokenGasCost: tokenGasCost,
|
|
254
|
+
}];
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Utility function to get EIP-712 compliant typed data that can be signed with the JSON-RPC method
|
|
261
|
+
* `eth_signedTypedDataV4` in MetaMask (https://docs.metamask.io/guide/signing-data.html). The resulting signature
|
|
262
|
+
* can then be used to call the method `speedUpDeposit` of a `SpokePool.sol` contract.
|
|
263
|
+
* @param depositId The deposit ID to speed up.
|
|
264
|
+
* @param originChainId The chain ID of the origin chain.
|
|
265
|
+
* @param updatedRelayerFeePct The new relayer fee percentage.
|
|
266
|
+
* @param updatedRecipient The new recipient address.
|
|
267
|
+
* @param updatedMessage The new message that should be provided to the recipient.
|
|
268
|
+
* @return EIP-712 compliant typed data.
|
|
269
|
+
*/
|
|
270
|
+
export function getUpdateDepositTypedData(depositId, originChainId, updatedRelayerFeePct, updatedRecipient, updatedMessage) {
|
|
271
|
+
return {
|
|
272
|
+
types: {
|
|
273
|
+
UpdateDepositDetails: [
|
|
274
|
+
{ name: "depositId", type: "uint32" },
|
|
275
|
+
{ name: "originChainId", type: "uint256" },
|
|
276
|
+
{ name: "updatedRelayerFeePct", type: "int64" },
|
|
277
|
+
{ name: "updatedRecipient", type: "address" },
|
|
278
|
+
{ name: "updatedMessage", type: "bytes" },
|
|
279
|
+
],
|
|
280
|
+
},
|
|
281
|
+
primaryType: "UpdateDepositDetails",
|
|
282
|
+
domain: {
|
|
283
|
+
name: "ACROSS-V2",
|
|
284
|
+
version: "1.0.0",
|
|
285
|
+
chainId: originChainId,
|
|
286
|
+
},
|
|
287
|
+
message: {
|
|
288
|
+
depositId: depositId,
|
|
289
|
+
originChainId: originChainId,
|
|
290
|
+
updatedRelayerFeePct: updatedRelayerFeePct,
|
|
291
|
+
updatedRecipient: updatedRecipient,
|
|
292
|
+
updatedMessage: updatedMessage,
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
export function getUpdateV3DepositTypedData(depositId, originChainId, updatedOutputAmount, updatedRecipient, updatedMessage) {
|
|
297
|
+
return {
|
|
298
|
+
types: {
|
|
299
|
+
UpdateDepositDetails: [
|
|
300
|
+
{ name: "depositId", type: "uint32" },
|
|
301
|
+
{ name: "originChainId", type: "uint256" },
|
|
302
|
+
{ name: "updatedOutputAmount", type: "uint256" },
|
|
303
|
+
{ name: "updatedRecipient", type: "address" },
|
|
304
|
+
{ name: "updatedMessage", type: "bytes" },
|
|
305
|
+
],
|
|
306
|
+
},
|
|
307
|
+
primaryType: "UpdateDepositDetails",
|
|
308
|
+
domain: {
|
|
309
|
+
name: "ACROSS-V2",
|
|
310
|
+
version: "1.0.0",
|
|
311
|
+
chainId: originChainId,
|
|
312
|
+
},
|
|
313
|
+
message: {
|
|
314
|
+
depositId: depositId,
|
|
315
|
+
originChainId: originChainId,
|
|
316
|
+
updatedOutputAmount: updatedOutputAmount,
|
|
317
|
+
updatedRecipient: updatedRecipient,
|
|
318
|
+
updatedMessage: updatedMessage,
|
|
319
|
+
},
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
export function randomAddress() {
|
|
323
|
+
return ethers.utils.getAddress(ethers.utils.hexlify(ethers.utils.randomBytes(20)));
|
|
324
|
+
}
|
|
325
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/utils/common.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,IAAI,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAmC,UAAU,EAAE,MAAM,QAAQ,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAoB,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,MAAM,CAAC,IAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC;AACxD,MAAM,CAAC,IAAM,WAAW,GAAG,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,OAAO,GAAG,UAAC,GAAiB,EAAE,QAAiB,IAAS,OAAA,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,QAAQ,CAAC,EAAjD,CAAiD,CAAC;AAEvH;;;;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UAAU,aAAa;IAC3B,OAAO,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from "./common";
|
|
2
|
+
export * from "./abi";
|
|
3
|
+
export * from "./ArrayUtils";
|
|
4
|
+
export * from "./BlockUtils";
|
|
5
|
+
export * from "./EventUtils";
|
|
6
|
+
export * from "./ObjectUtils";
|
|
7
|
+
export * from "./TimeUtils";
|
|
8
|
+
export * from "./TypeGuards";
|
|
9
|
+
export * from "./TypeUtils";
|
|
10
|
+
export * from "./TokenUtils";
|
|
11
|
+
export * from "./LogUtils";
|
|
12
|
+
export * from "./FlowUtils";
|
|
13
|
+
export * from "./BundleUtils";
|
|
14
|
+
export * from "./JSONUtils";
|
|
15
|
+
export * from "./IPFSUtils";
|
|
16
|
+
export * from "./NumberUtils";
|
|
17
|
+
export * from "./DeploymentUtils";
|
|
18
|
+
export * from "./FormattingUtils";
|
|
19
|
+
export * from "./BlockExplorerUtils";
|
|
20
|
+
export * from "./BigNumberUtils";
|
|
21
|
+
export * from "./CachingUtils";
|
|
22
|
+
export * from "./NetworkUtils";
|
|
23
|
+
export * from "./Multicall";
|
|
24
|
+
export * from "./ReviverUtils";
|
|
25
|
+
export * from "./DepositUtils";
|
|
26
|
+
export * from "./ValidatorUtils";
|
|
27
|
+
export * from "./AddressUtils";
|
|
28
|
+
export * from "./SpokeUtils";
|
|
29
|
+
export * from "./V3Utils";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from "./common";
|
|
2
|
+
export * from "./abi";
|
|
3
|
+
export * from "./ArrayUtils";
|
|
4
|
+
export * from "./BlockUtils";
|
|
5
|
+
export * from "./EventUtils";
|
|
6
|
+
export * from "./ObjectUtils";
|
|
7
|
+
export * from "./TimeUtils";
|
|
8
|
+
export * from "./TypeGuards";
|
|
9
|
+
export * from "./TypeUtils";
|
|
10
|
+
export * from "./TokenUtils";
|
|
11
|
+
export * from "./LogUtils";
|
|
12
|
+
export * from "./FlowUtils";
|
|
13
|
+
export * from "./BundleUtils";
|
|
14
|
+
export * from "./JSONUtils";
|
|
15
|
+
export * from "./IPFSUtils";
|
|
16
|
+
export * from "./NumberUtils";
|
|
17
|
+
export * from "./DeploymentUtils";
|
|
18
|
+
export * from "./FormattingUtils";
|
|
19
|
+
export * from "./BlockExplorerUtils";
|
|
20
|
+
export * from "./BigNumberUtils";
|
|
21
|
+
export * from "./CachingUtils";
|
|
22
|
+
export * from "./NetworkUtils";
|
|
23
|
+
export * from "./Multicall";
|
|
24
|
+
export * from "./ReviverUtils";
|
|
25
|
+
export * from "./DepositUtils";
|
|
26
|
+
export * from "./ValidatorUtils";
|
|
27
|
+
export * from "./AddressUtils";
|
|
28
|
+
export * from "./SpokeUtils";
|
|
29
|
+
export * from "./V3Utils";
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ethers } from "ethers";
|
|
2
|
+
import { CoingeckoDataReturnType, SuggestedFeeReturnType, BridgeLimitsReturnType, AcrossBridgeStatisticsType } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* AbstractApiClient is an abstract class that defines the interface for the API client.
|
|
5
|
+
*/
|
|
6
|
+
export default abstract class AbstractApiClient {
|
|
7
|
+
/**
|
|
8
|
+
* serverlessApiUrl is the URL of the serverless API.
|
|
9
|
+
*/
|
|
10
|
+
private readonly serverlessApiUrl;
|
|
11
|
+
/**
|
|
12
|
+
* scraperApiUrl is the URL of the scraper API.
|
|
13
|
+
*/
|
|
14
|
+
private readonly scraperApiUrl;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new instance of AbstractApiClient.
|
|
17
|
+
* @param serverlessApiUrl The URL of the serverless API.
|
|
18
|
+
* @param scraperApiUrl The URL of the scraper API.
|
|
19
|
+
*/
|
|
20
|
+
protected constructor(serverlessApiUrl: string, scraperApiUrl: string);
|
|
21
|
+
/**
|
|
22
|
+
* Returns the URL of the serverless API.
|
|
23
|
+
* @returns The URL of the serverless API.
|
|
24
|
+
*/
|
|
25
|
+
protected getServerlessApiUrl(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the URL of the scraper API.
|
|
28
|
+
* @returns The URL of the scraper API.
|
|
29
|
+
*/
|
|
30
|
+
protected getScraperApiUrl(): string;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the coingecko data for the given token.
|
|
33
|
+
* @param l1Token The token to get the coingecko data for.
|
|
34
|
+
* @param baseCurrency The base currency to get the coingecko data for.
|
|
35
|
+
* @returns The coingecko data.
|
|
36
|
+
* @throws Throws an error if the API call fails.
|
|
37
|
+
*/
|
|
38
|
+
abstract getCoinGeckoData(l1Token: string, baseCurrency: string): Promise<CoingeckoDataReturnType>;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the suggested fees for the given token and amount to transfer to the given chain in a bridge transfer.
|
|
41
|
+
* @param amount The amount to transfer.
|
|
42
|
+
* @param originToken The token to transfer.
|
|
43
|
+
* @param toChainid The chain to transfer to
|
|
44
|
+
* @param fromChainid The chain to transfer from
|
|
45
|
+
* @returns The suggested fees.
|
|
46
|
+
* @throws Throws an error if the API call fails.
|
|
47
|
+
*/
|
|
48
|
+
abstract getSuggestedFees(amount: ethers.BigNumber, originToken: string, toChainid: number, fromChainid: number): Promise<SuggestedFeeReturnType>;
|
|
49
|
+
/**
|
|
50
|
+
* Returns the bridge limits for the given token and chain on Across.
|
|
51
|
+
* @class
|
|
52
|
+
* @abstract
|
|
53
|
+
* @param token The token to get the bridge limits for.
|
|
54
|
+
* @param fromChainId The chain that the transfer will originate from.
|
|
55
|
+
* @param toChainId The chain that the transfer will be bridged to.
|
|
56
|
+
* @returns The bridge limits.
|
|
57
|
+
* @throws Throws an error if the API call fails.
|
|
58
|
+
*/
|
|
59
|
+
abstract getBridgeLimits(token: string, fromnumber: string | number, tonumber: string | number): Promise<BridgeLimitsReturnType>;
|
|
60
|
+
/**
|
|
61
|
+
* Returns the Across bridge statistics. These are a set of statistics that are used to capture the current state of the bridge.
|
|
62
|
+
* @returns The Across bridge statistics.
|
|
63
|
+
* @throws Throws an error if the API call fails.
|
|
64
|
+
*/
|
|
65
|
+
abstract getAcrossStats(): Promise<AcrossBridgeStatisticsType>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=abstractClient.d.ts.map
|