@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,49 @@
|
|
|
1
|
+
import { Provider } from "@ethersproject/providers";
|
|
2
|
+
import { AcrossConfigStore, AcrossConfigStore__factory } from "../typechain";
|
|
3
|
+
import { object, string, Infer, assert, mask, record, optional } from "superstruct";
|
|
4
|
+
import type { CallOverrides } from "@ethersproject/contracts";
|
|
5
|
+
import { filterFalsyKeys } from "../utils";
|
|
6
|
+
|
|
7
|
+
const RateModelSs = object({
|
|
8
|
+
UBar: string(), // denote the utilization kink along the rate model where the slope of the interest rate model changes.
|
|
9
|
+
R0: string(), // is the interest rate charged at 0 utilization
|
|
10
|
+
R1: string(), // R_0+R_1 is the interest rate charged at UBar
|
|
11
|
+
R2: string(), // R_0+R_1+R_2 is the interest rate charged at 100% utilization
|
|
12
|
+
});
|
|
13
|
+
const L1TokenConfigSs = object({
|
|
14
|
+
rateModel: RateModelSs,
|
|
15
|
+
routeRateModel: optional(record(string(), RateModelSs)),
|
|
16
|
+
});
|
|
17
|
+
export type RateModel = Infer<typeof RateModelSs>;
|
|
18
|
+
export type L1TokenConfig = Infer<typeof L1TokenConfigSs>;
|
|
19
|
+
|
|
20
|
+
export class Client {
|
|
21
|
+
public readonly contract: AcrossConfigStore;
|
|
22
|
+
constructor(address: string, provider: Provider) {
|
|
23
|
+
this.contract = AcrossConfigStore__factory.connect(address, provider);
|
|
24
|
+
}
|
|
25
|
+
static parseL1TokenConfig(data: string): L1TokenConfig {
|
|
26
|
+
const l1TokenConfig = JSON.parse(data);
|
|
27
|
+
const l1TokenConfigMask = filterFalsyKeys(mask(l1TokenConfig, L1TokenConfigSs));
|
|
28
|
+
assert(l1TokenConfigMask, L1TokenConfigSs);
|
|
29
|
+
return l1TokenConfigMask;
|
|
30
|
+
}
|
|
31
|
+
async getL1TokenConfig(l1TokenAddress: string, overrides: CallOverrides = {}): Promise<L1TokenConfig> {
|
|
32
|
+
const data = await this.contract.l1TokenConfig(l1TokenAddress, overrides);
|
|
33
|
+
return Client.parseL1TokenConfig(data);
|
|
34
|
+
}
|
|
35
|
+
async getRateModel(
|
|
36
|
+
l1TokenAddress: string,
|
|
37
|
+
overrides: CallOverrides = {},
|
|
38
|
+
originChainId?: number,
|
|
39
|
+
destinationChainId?: number
|
|
40
|
+
): Promise<RateModel> {
|
|
41
|
+
const l1TokenConfig = await this.getL1TokenConfig(l1TokenAddress, overrides);
|
|
42
|
+
if (originChainId === undefined || destinationChainId === undefined) return l1TokenConfig.rateModel;
|
|
43
|
+
const routeRateModelKey = `${originChainId}-${destinationChainId}`;
|
|
44
|
+
if (l1TokenConfig.routeRateModel && l1TokenConfig.routeRateModel[routeRateModelKey]) {
|
|
45
|
+
return l1TokenConfig.routeRateModel[routeRateModelKey];
|
|
46
|
+
}
|
|
47
|
+
return l1TokenConfig.rateModel;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { HubPool, HubPool__factory, HubPoolInterface } from "../typechain";
|
|
2
|
+
|
|
3
|
+
import { providers, utils as ethersUtils, Signer } from "ethers";
|
|
4
|
+
import { Balances, SerializableEvent } from "./utils";
|
|
5
|
+
|
|
6
|
+
export type Instance = HubPool;
|
|
7
|
+
export const Factory = HubPool__factory;
|
|
8
|
+
export type Interface = HubPoolInterface;
|
|
9
|
+
|
|
10
|
+
export function connect(address: string, provider: providers.Provider | Signer): Instance {
|
|
11
|
+
return Factory.connect(address, provider as Signer);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type TokenEventState = {
|
|
15
|
+
tokenBalances: Balances;
|
|
16
|
+
lpTokenBalances: Balances;
|
|
17
|
+
l1Token?: string;
|
|
18
|
+
lpToken?: string;
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type EventState = Record<string, TokenEventState>;
|
|
22
|
+
|
|
23
|
+
export function eventStateDefaults(): EventState {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
function tokenEventStateDefaults(): TokenEventState {
|
|
27
|
+
return {
|
|
28
|
+
tokenBalances: {},
|
|
29
|
+
lpTokenBalances: {},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function reduceEvents(state: EventState, event: SerializableEvent): EventState {
|
|
34
|
+
const hubPoolInterface = new ethersUtils.Interface(Factory.abi);
|
|
35
|
+
|
|
36
|
+
const eventName = event.event ?? "unknown";
|
|
37
|
+
const { args } = hubPoolInterface.parseLog(event);
|
|
38
|
+
const { l1Token } = args;
|
|
39
|
+
const tokenEventState = state[l1Token] || tokenEventStateDefaults();
|
|
40
|
+
const tokens = Balances(tokenEventState.tokenBalances);
|
|
41
|
+
const lpTokens = Balances(tokenEventState.lpTokenBalances);
|
|
42
|
+
|
|
43
|
+
switch (eventName) {
|
|
44
|
+
case "LiquidityAdded":
|
|
45
|
+
case "LiquidityRemoved": {
|
|
46
|
+
const { amount, liquidityProvider } = args;
|
|
47
|
+
if (event.event === "LiquidityAdded") {
|
|
48
|
+
lpTokens.add(liquidityProvider, args.lpTokensMinted.toString());
|
|
49
|
+
tokens.add(liquidityProvider, amount.toString());
|
|
50
|
+
} else {
|
|
51
|
+
lpTokens.sub(liquidityProvider, args.lpTokensBurnt.toString());
|
|
52
|
+
tokens.sub(liquidityProvider, amount.toString());
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
...state,
|
|
57
|
+
[l1Token]: {
|
|
58
|
+
...tokenEventState,
|
|
59
|
+
l1Token,
|
|
60
|
+
tokenBalances: {
|
|
61
|
+
...tokens.balances,
|
|
62
|
+
},
|
|
63
|
+
lpTokenBalances: {
|
|
64
|
+
...lpTokens.balances,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
case "L1TokenEnabledForLiquidityProvision":
|
|
71
|
+
case "L2TokenDisabledForLiquidityProvision": {
|
|
72
|
+
const { lpToken } = args;
|
|
73
|
+
const enabled = event.event === "L1TokenEnabledForLiquidityProvision";
|
|
74
|
+
return {
|
|
75
|
+
...state,
|
|
76
|
+
[l1Token]: {
|
|
77
|
+
...tokenEventState,
|
|
78
|
+
lpToken,
|
|
79
|
+
l1Token,
|
|
80
|
+
enabled,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return state;
|
|
87
|
+
}
|
|
88
|
+
export function getEventState(events: SerializableEvent[], eventState: EventState = eventStateDefaults()): EventState {
|
|
89
|
+
return events.reduce(reduceEvents, eventState);
|
|
90
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import assert from "assert";
|
|
2
|
+
import { BigNumber, BigNumberish, Event } from "ethers";
|
|
3
|
+
import { isDefined } from "../utils";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @dev Originally imported from @uma/sdk.
|
|
7
|
+
* @dev This code is intended to support existing use of contracts/hubPool.ts and should not be used for new code.
|
|
8
|
+
* @todo Refactor contracts/hubPool.ts to avoid the need for this.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export type SerializableEvent = Omit<
|
|
12
|
+
Event,
|
|
13
|
+
"decode" | "removeListener" | "getBlock" | "getTransaction" | "getTransactionReceipt"
|
|
14
|
+
>;
|
|
15
|
+
|
|
16
|
+
// useful for maintaining balances from events
|
|
17
|
+
export type Balances = { [key: string]: string };
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Utility for maintaining records of a token balance.
|
|
21
|
+
*/
|
|
22
|
+
export function Balances(balances: Balances = {}) {
|
|
23
|
+
function create(id: string, amount = "0") {
|
|
24
|
+
assert(!has(id), "balance already exists");
|
|
25
|
+
return set(id, amount);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function has(id: string) {
|
|
29
|
+
return isDefined(balances[id]);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function set(id: string, amount: string) {
|
|
33
|
+
balances[id] = amount;
|
|
34
|
+
return amount;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function add(id: string, amount: BigNumberish) {
|
|
38
|
+
return set(id, BigNumber.from(amount).add(getOrCreate(id)).toString());
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function sub(id: string, amount: BigNumberish) {
|
|
42
|
+
return set(id, BigNumber.from(getOrCreate(id)).sub(amount).toString());
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function get(id: string) {
|
|
46
|
+
assert(has(id), "balance does not exist");
|
|
47
|
+
return balances[id];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function getOrCreate(id: string) {
|
|
51
|
+
if (has(id)) return get(id);
|
|
52
|
+
return create(id);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return { create, add, sub, get, balances, set, has, getOrCreate };
|
|
56
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ethers, providers, utils as ethersUtils } from "ethers";
|
|
2
|
+
import { GasPriceEstimate } from "../types";
|
|
3
|
+
import { eip1559 } from "./ethereum";
|
|
4
|
+
|
|
5
|
+
// Arbitrum Nitro implements EIP-1559 pricing, but the priority fee is always refunded to the caller. Further,
|
|
6
|
+
// ethers typically hardcodes the priority fee to 1.5 Gwei. So, confirm that the priority fee supplied was 1.5
|
|
7
|
+
// Gwei, and then drop it to 1 Wei. Reference: https://developer.arbitrum.io/faqs/gas-faqs#q-priority
|
|
8
|
+
export async function eip1559_arbitrum(provider: providers.Provider, chainId: number): Promise<GasPriceEstimate> {
|
|
9
|
+
const { maxFeePerGas: _maxFeePerGas, maxPriorityFeePerGas } = await eip1559(provider, chainId);
|
|
10
|
+
|
|
11
|
+
// If this throws, ethers default behaviour has changed, or Arbitrum RPCs are returning something more sensible.
|
|
12
|
+
if (!maxPriorityFeePerGas.eq(ethersUtils.parseUnits("1.5", 9))) {
|
|
13
|
+
throw new Error(`Expected hardcoded 1.5 Gwei priority fee on Arbitrum, got ${maxPriorityFeePerGas}`);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// eip1559() sets maxFeePerGas = lastBaseFeePerGas + maxPriorityFeePerGas, so revert that.
|
|
17
|
+
// The caller may apply scaling as they wish afterwards.
|
|
18
|
+
const maxFeePerGas = _maxFeePerGas.sub(maxPriorityFeePerGas).add(1);
|
|
19
|
+
|
|
20
|
+
return { maxPriorityFeePerGas: ethers.constants.One, maxFeePerGas };
|
|
21
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BigNumber, providers, ethers } from "ethers";
|
|
2
|
+
import { GasPriceEstimate } from "../types";
|
|
3
|
+
import { gasPriceError } from "../util";
|
|
4
|
+
|
|
5
|
+
export async function eip1559(provider: providers.Provider, chainId: number): Promise<GasPriceEstimate> {
|
|
6
|
+
const feeData = await provider.getFeeData();
|
|
7
|
+
|
|
8
|
+
[feeData.lastBaseFeePerGas, feeData.maxPriorityFeePerGas].forEach((field: BigNumber | null) => {
|
|
9
|
+
if (!BigNumber.isBigNumber(field) || field.lt(0)) gasPriceError("getFeeData()", chainId, feeData);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const maxPriorityFeePerGas = feeData.maxPriorityFeePerGas as BigNumber;
|
|
13
|
+
const maxFeePerGas = maxPriorityFeePerGas.add(feeData.lastBaseFeePerGas as BigNumber);
|
|
14
|
+
|
|
15
|
+
return { maxPriorityFeePerGas, maxFeePerGas };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function legacy(provider: providers.Provider, chainId: number): Promise<GasPriceEstimate> {
|
|
19
|
+
const gasPrice: BigNumber = await provider.getGasPrice();
|
|
20
|
+
|
|
21
|
+
if (!BigNumber.isBigNumber(gasPrice) || gasPrice.lt(0)) gasPriceError("getGasPrice()", chainId, gasPrice);
|
|
22
|
+
|
|
23
|
+
return {
|
|
24
|
+
maxFeePerGas: gasPrice,
|
|
25
|
+
maxPriorityFeePerGas: ethers.constants.Zero,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { providers, utils as ethersUtils } from "ethers";
|
|
2
|
+
import { BaseHTTPAdapter, BaseHTTPAdapterArgs } from "../../priceClient/adapters/baseAdapter";
|
|
3
|
+
import { isDefined } from "../../utils/TypeGuards";
|
|
4
|
+
import { GasPriceEstimate } from "../types";
|
|
5
|
+
import { gasPriceError } from "../util";
|
|
6
|
+
import { eip1559 } from "./ethereum";
|
|
7
|
+
|
|
8
|
+
type Polygon1559GasPrice = {
|
|
9
|
+
maxPriorityFee: number | string;
|
|
10
|
+
maxFee: number | string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type GasStationV2Response = {
|
|
14
|
+
safeLow: Polygon1559GasPrice;
|
|
15
|
+
standard: Polygon1559GasPrice;
|
|
16
|
+
fast: Polygon1559GasPrice;
|
|
17
|
+
estimatedBaseFee: number | string;
|
|
18
|
+
blockTime: number | string;
|
|
19
|
+
blockNumber: number | string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type GasStationArgs = BaseHTTPAdapterArgs & {
|
|
23
|
+
chainId?: number;
|
|
24
|
+
host?: string;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// @dev toBNWei() is not imported from ../utils because of a circular dependency loop.
|
|
28
|
+
// The fix is probably to relocate the function estimateTotalGasRequiredByUnsignedTransaction().
|
|
29
|
+
class PolygonGasStation extends BaseHTTPAdapter {
|
|
30
|
+
readonly chainId: number;
|
|
31
|
+
|
|
32
|
+
constructor({ chainId = 137, host, timeout = 1500, retries = 1 }: GasStationArgs = {}) {
|
|
33
|
+
host = host ?? chainId === 137 ? "gasstation.polygon.technology" : "gasstation-testnet.polygon.technology";
|
|
34
|
+
|
|
35
|
+
super("Polygon Gas Station", host, { timeout, retries });
|
|
36
|
+
this.chainId = chainId;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async getFeeData(strategy: "safeLow" | "standard" | "fast" = "fast"): Promise<GasPriceEstimate> {
|
|
40
|
+
const gas = await this.query("v2", {});
|
|
41
|
+
|
|
42
|
+
const gasPrice: Polygon1559GasPrice = (gas as GasStationV2Response)?.[strategy];
|
|
43
|
+
if (!this.isPolygon1559GasPrice(gasPrice)) {
|
|
44
|
+
// @todo: generalise gasPriceError() to accept a reason/cause?
|
|
45
|
+
gasPriceError("getFeeData()", this.chainId, ethersUtils.parseUnits("0"));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[gasPrice.maxFee, gasPrice.maxPriorityFee].forEach((gasPrice) => {
|
|
49
|
+
if (Number(gasPrice) < 0) {
|
|
50
|
+
gasPriceError("getFeeData()", this.chainId, ethersUtils.parseUnits(gasPrice.toString(), 9));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const maxPriorityFeePerGas = ethersUtils.parseUnits(gasPrice.maxPriorityFee.toString(), 9);
|
|
55
|
+
const maxFeePerGas = ethersUtils.parseUnits(gasPrice.maxFee.toString(), 9);
|
|
56
|
+
|
|
57
|
+
return { maxPriorityFeePerGas, maxFeePerGas };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
protected isPolygon1559GasPrice(gasPrice: unknown): gasPrice is Polygon1559GasPrice {
|
|
61
|
+
if (!isDefined(gasPrice)) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
const _gasPrice = gasPrice as Polygon1559GasPrice;
|
|
65
|
+
return [_gasPrice.maxPriorityFee, _gasPrice.maxFee].every((field) => ["number", "string"].includes(typeof field));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export async function polygonGasStation(provider: providers.Provider, chainId: number): Promise<GasPriceEstimate> {
|
|
70
|
+
const gasStation = new PolygonGasStation({ chainId: chainId });
|
|
71
|
+
try {
|
|
72
|
+
return await gasStation.getFeeData();
|
|
73
|
+
} catch (err) {
|
|
74
|
+
// Fall back to the RPC provider. May be less accurate.
|
|
75
|
+
return await eip1559(provider, chainId);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { providers } from "ethers";
|
|
2
|
+
import { eip1559, eip1559_arbitrum, legacy, polygonGasStation } from "./adapters";
|
|
3
|
+
import { GasPriceEstimate, GasPriceFeed } from "./types";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Provide an estimate for the current gas price for a particular chain.
|
|
7
|
+
* @param chainId The chain ID to query for gas prices.
|
|
8
|
+
* @param provider A valid ethers provider.
|
|
9
|
+
* @param legacyFallback In the case of an unrecognised chain, fall back to type 0 gas estimation.
|
|
10
|
+
* @returns Am object of type GasPriceEstimate.
|
|
11
|
+
*/
|
|
12
|
+
export async function getGasPriceEstimate(
|
|
13
|
+
provider: providers.Provider,
|
|
14
|
+
chainId?: number,
|
|
15
|
+
legacyFallback = true
|
|
16
|
+
): Promise<GasPriceEstimate> {
|
|
17
|
+
if (!chainId) {
|
|
18
|
+
const network: providers.Network = await provider.getNetwork();
|
|
19
|
+
chainId = network.chainId;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const gasPriceFeeds: { [chainId: number]: GasPriceFeed } = {
|
|
23
|
+
1: eip1559,
|
|
24
|
+
10: eip1559,
|
|
25
|
+
137: polygonGasStation,
|
|
26
|
+
288: legacy,
|
|
27
|
+
324: legacy,
|
|
28
|
+
8453: eip1559,
|
|
29
|
+
42161: eip1559_arbitrum,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
let gasPriceFeed: GasPriceFeed = gasPriceFeeds[chainId];
|
|
33
|
+
if (gasPriceFeed === undefined) {
|
|
34
|
+
if (!legacyFallback) {
|
|
35
|
+
throw new Error(`No suitable gas price oracle for Chain ID ${chainId}`);
|
|
36
|
+
}
|
|
37
|
+
gasPriceFeed = legacy;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const gasPriceEstimate: GasPriceEstimate = await gasPriceFeed(provider, chainId);
|
|
41
|
+
return gasPriceEstimate;
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BigNumber, providers } from "ethers";
|
|
2
|
+
|
|
3
|
+
export type GasPriceEstimate = {
|
|
4
|
+
maxFeePerGas: BigNumber;
|
|
5
|
+
maxPriorityFeePerGas: BigNumber;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export interface GasPriceFeed {
|
|
9
|
+
(provider: providers.Provider, chainId: number): Promise<GasPriceEstimate>;
|
|
10
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * as lpFeeCalculator from "./lpFeeCalculator";
|
|
2
|
+
export * as pool from "./pool";
|
|
3
|
+
export * as relayFeeCalculator from "./relayFeeCalculator";
|
|
4
|
+
export * as utils from "./utils";
|
|
5
|
+
export * as contracts from "./contracts";
|
|
6
|
+
export * as coingecko from "./coingecko";
|
|
7
|
+
export * as gasPriceOracle from "./gasPriceOracle";
|
|
8
|
+
export * as priceClient from "./priceClient";
|
|
9
|
+
export * as merkleDistributor from "./merkleDistributor";
|
|
10
|
+
export * as constants from "./constants";
|
|
11
|
+
export * as interfaces from "./interfaces";
|
|
12
|
+
export * as typeguards from "./typeguards";
|
|
13
|
+
export * as clients from "./clients";
|
|
14
|
+
export * as typechain from "./typechain";
|
|
15
|
+
export * as caching from "./caching";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Struct } from "superstruct";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The interface for a caching mechanism. This is used to store and retrieve values from a cache.
|
|
5
|
+
* @interface CachingInterface
|
|
6
|
+
* @exports
|
|
7
|
+
*/
|
|
8
|
+
export interface CachingMechanismInterface {
|
|
9
|
+
/**
|
|
10
|
+
* Attempts to retrieve a value from the cache.
|
|
11
|
+
* @param key The key to retrieve.
|
|
12
|
+
* @returns The value if it exists, otherwise null.
|
|
13
|
+
*/
|
|
14
|
+
get<ObjectType, OverrideType = unknown>(
|
|
15
|
+
key?: string,
|
|
16
|
+
structValidator?: Struct<unknown, unknown>,
|
|
17
|
+
overrides?: OverrideType
|
|
18
|
+
): Promise<ObjectType | null>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Attempts to set a key in the caching store. Returns the ID of the value stored. This is useful for storing values
|
|
22
|
+
* in a cache that are not known ahead of time. For example, if you want to store a value in a cache that is the result of a
|
|
23
|
+
* computation, you can use this method to store the value and retrieve the ID of the value stored.
|
|
24
|
+
* @param key The canonical key to store.
|
|
25
|
+
* @param value The value to store.
|
|
26
|
+
* @param ttl The time to live in seconds.
|
|
27
|
+
* @param overrides Any overrides to the default caching mechanism configuration for the given caching protocol.
|
|
28
|
+
* @note Caching mechanisms where the `key` is directly used to store values will return `key` on success.
|
|
29
|
+
* @returns The ID of the value stored. If the value could not be stored, undefined is returned. If the caching mechanism uses the `key` as the ID, the `key` is returned.
|
|
30
|
+
*/
|
|
31
|
+
set<ObjectType, OverrideType>(
|
|
32
|
+
key: string,
|
|
33
|
+
value: ObjectType,
|
|
34
|
+
ttl?: number,
|
|
35
|
+
overrides?: OverrideType
|
|
36
|
+
): Promise<string | undefined>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BigNumber } from "ethers";
|
|
2
|
+
|
|
3
|
+
export interface SortableEvent {
|
|
4
|
+
blockNumber: number;
|
|
5
|
+
transactionIndex: number;
|
|
6
|
+
logIndex: number;
|
|
7
|
+
transactionHash: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface BigNumberForToken {
|
|
11
|
+
[l1TokenAddress: string]: BigNumber;
|
|
12
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { BigNumber } from "ethers";
|
|
2
|
+
import { RateModelDictionary } from "../lpFeeCalculator/rateModel";
|
|
3
|
+
import { SortableEvent } from "./Common";
|
|
4
|
+
|
|
5
|
+
export interface ParsedTokenConfig {
|
|
6
|
+
rateModel: RateModelDictionary;
|
|
7
|
+
routeRateModel?: {
|
|
8
|
+
[path: string]: RateModelDictionary;
|
|
9
|
+
};
|
|
10
|
+
uba?: UBAOnChainConfigType;
|
|
11
|
+
spokeTargetBalances?: {
|
|
12
|
+
[chainId: number]: {
|
|
13
|
+
target: string;
|
|
14
|
+
threshold: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface SpokePoolTargetBalance {
|
|
20
|
+
target: BigNumber;
|
|
21
|
+
threshold: BigNumber;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type SpokePoolTargetBalanceStringified = Omit<SpokePoolTargetBalance, "threshold" | "target"> & {
|
|
25
|
+
target: string;
|
|
26
|
+
threshold: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export interface SpokeTargetBalanceUpdate extends SortableEvent {
|
|
30
|
+
spokeTargetBalances?: {
|
|
31
|
+
[chainId: number]: SpokePoolTargetBalance;
|
|
32
|
+
};
|
|
33
|
+
l1Token: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface SpokeTargetBalanceUpdateStringified extends SortableEvent {
|
|
37
|
+
spokeTargetBalances?: {
|
|
38
|
+
[chainId: number]: SpokePoolTargetBalanceStringified;
|
|
39
|
+
};
|
|
40
|
+
l1Token: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface RouteRateModelUpdate extends SortableEvent {
|
|
44
|
+
routeRateModel: {
|
|
45
|
+
[path: string]: string;
|
|
46
|
+
};
|
|
47
|
+
l1Token: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface TokenConfig extends SortableEvent {
|
|
51
|
+
key: string;
|
|
52
|
+
value: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface GlobalConfigUpdate<ValueStore = number> extends SortableEvent {
|
|
56
|
+
value: ValueStore;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface ConfigStoreVersionUpdate<ValueStore = number> extends GlobalConfigUpdate<ValueStore> {
|
|
60
|
+
timestamp: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface DisabledChainsUpdate extends SortableEvent {
|
|
64
|
+
chainIds: number[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* A generic type of a dictionary that has string keys and values of type T. This
|
|
69
|
+
* record is enforced to have a default entry within the "default" key.
|
|
70
|
+
* @type Value The type of the values in the dictionary.
|
|
71
|
+
*/
|
|
72
|
+
type RecordWithDefaultEntry<Value> = Record<string, Value>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A generic type for an array of tuples.
|
|
76
|
+
* @type Value The type of the values in the array.
|
|
77
|
+
*/
|
|
78
|
+
type ArrayOfTuples<Value> = [Value, Value][];
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* A type for the UBA config object stored both on and off chain.
|
|
82
|
+
* @type T The type of the values in the config.
|
|
83
|
+
* @note This is a dictionary of parameters that defines a fee curve for the token.
|
|
84
|
+
* These parameters can be further subindexed by a route (e.g. using the key "1-10" or "42161-1")
|
|
85
|
+
* to create a specific fee curve for a token per route. The subkeys are as followed:
|
|
86
|
+
* - alpha: The alpha parameter of the fee curve.
|
|
87
|
+
* - gamma: The gamma parameter of the fee curve.
|
|
88
|
+
* - omega: The omega parameter of the fee curve.
|
|
89
|
+
* - rebalance: The rebalance parameters of the fee curve.
|
|
90
|
+
*/
|
|
91
|
+
type UBAAgnosticConfigType<T> = {
|
|
92
|
+
/**
|
|
93
|
+
* A DAO controlled variable to track any donations made to the incentivePool liquidity
|
|
94
|
+
*/
|
|
95
|
+
incentivePoolAdjustment?: Record<string, T>;
|
|
96
|
+
/**
|
|
97
|
+
* Used to scale rewards when a fee is larger than the incentive balance
|
|
98
|
+
*/
|
|
99
|
+
ubaRewardMultiplier?: Record<string, T>;
|
|
100
|
+
/**
|
|
101
|
+
* This is a scalar value that is a constant percentage of each transfer that is allocated for LPs.
|
|
102
|
+
* This value can be determined by token and route-by-route.
|
|
103
|
+
*/
|
|
104
|
+
alpha: RecordWithDefaultEntry<T>;
|
|
105
|
+
/**
|
|
106
|
+
* This is a piecewise linear function (defined by a vector of cut-off points and the values at
|
|
107
|
+
* those points) that determine additional LP fees as a function of utilization. This piecewise
|
|
108
|
+
* linear function can be determined by token and chain-by-chain.
|
|
109
|
+
*/
|
|
110
|
+
gamma: RecordWithDefaultEntry<ArrayOfTuples<T>>;
|
|
111
|
+
/**
|
|
112
|
+
* This is a piecewise linear function (defined by a vector of cut-off points and the values at
|
|
113
|
+
* those points) that determine the balancing fees (rewards) that are imposed on (paid to) a user
|
|
114
|
+
* who makes a transfer involving a particular chain. There is a single piecewise linear function for
|
|
115
|
+
* each token/chain combination. A transfer will incur a balancing fee on both the origin and destination
|
|
116
|
+
* chains.
|
|
117
|
+
*/
|
|
118
|
+
omega: RecordWithDefaultEntry<ArrayOfTuples<T>>;
|
|
119
|
+
/**
|
|
120
|
+
* This is a set of parameters that determine when a rebalance is triggered. A rebalance is triggered
|
|
121
|
+
* when the utilization of a pool is outside of the range defined by the lower and upper thresholds.
|
|
122
|
+
*/
|
|
123
|
+
rebalance: RecordWithDefaultEntry<{
|
|
124
|
+
/**
|
|
125
|
+
* For tokens/chains that have a supported bridge, these are the lower and upper threshold that trigger
|
|
126
|
+
* the reallocation of funds. i.e. If the running balance on a chain moves below (above) threshold_lower
|
|
127
|
+
* (threshold_upper) then the bridge moves funds from Ethereum to the chain (from the chain to Ethereum).
|
|
128
|
+
*/
|
|
129
|
+
threshold_lower?: T;
|
|
130
|
+
/**
|
|
131
|
+
* For tokens/chains that have a supported bridge, these are the lower and upper threshold that trigger
|
|
132
|
+
* the reallocation of funds. i.e. If the running balance on a chain moves below (above) threshold_lower
|
|
133
|
+
* (threshold_upper) then the bridge moves funds from Ethereum to the chain (from the chain to Ethereum).
|
|
134
|
+
*/
|
|
135
|
+
threshold_upper?: T;
|
|
136
|
+
/**
|
|
137
|
+
* For tokens/chains that have a supported bridge, these are the values that are targeted whenever funds
|
|
138
|
+
* are reallocated.
|
|
139
|
+
*/
|
|
140
|
+
target_lower?: T;
|
|
141
|
+
/**
|
|
142
|
+
* For tokens/chains that have a supported bridge, these are the values that are targeted whenever funds
|
|
143
|
+
* are reallocated.
|
|
144
|
+
*/
|
|
145
|
+
target_upper?: T;
|
|
146
|
+
}>;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* A type for the UBA config object stored on chain.
|
|
151
|
+
*/
|
|
152
|
+
export type UBAOnChainConfigType = UBAAgnosticConfigType<string>;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* A type for the UBA config object after it has been parsed.
|
|
156
|
+
*/
|
|
157
|
+
export type UBAParsedConfigType = UBAAgnosticConfigType<BigNumber>;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* A type for UBAConfig Update events.
|
|
161
|
+
*/
|
|
162
|
+
export type UBAConfigUpdates = SortableEvent & {
|
|
163
|
+
config: UBAParsedConfigType;
|
|
164
|
+
l1Token: string;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* A type for stringified UBAConfig Update events.
|
|
169
|
+
*/
|
|
170
|
+
export type UBASerializedConfigUpdates = SortableEvent & {
|
|
171
|
+
config: UBAOnChainConfigType;
|
|
172
|
+
l1Token: string;
|
|
173
|
+
};
|