@across-protocol/sdk 4.1.63-beta.0 → 4.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/arch/evm/SpokeUtils.d.ts +1 -1
- package/dist/cjs/arch/evm/SpokeUtils.js +5 -6
- package/dist/cjs/arch/evm/SpokeUtils.js.map +1 -1
- package/dist/cjs/arch/svm/index.d.ts +1 -5
- package/dist/cjs/arch/svm/index.js +2 -6
- package/dist/cjs/arch/svm/index.js.map +1 -1
- package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
- package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +7 -7
- package/dist/cjs/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
- package/dist/cjs/clients/BaseAbstractClient.d.ts +5 -6
- package/dist/cjs/clients/BaseAbstractClient.js +19 -30
- package/dist/cjs/clients/BaseAbstractClient.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/BundleDataClient.js +11 -15
- package/dist/cjs/clients/BundleDataClient/BundleDataClient.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
- package/dist/cjs/clients/BundleDataClient/utils/SuperstructUtils.d.ts +90 -90
- package/dist/cjs/clients/HubPoolClient.d.ts +1 -1
- package/dist/cjs/clients/HubPoolClient.js +16 -16
- package/dist/cjs/clients/HubPoolClient.js.map +1 -1
- package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
- package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js +20 -23
- package/dist/cjs/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
- package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.d.ts +5 -5
- package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js +54 -50
- package/dist/cjs/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
- package/dist/cjs/clients/SpokePoolClient/index.d.ts +0 -3
- package/dist/cjs/clients/SpokePoolClient/index.js +1 -8
- package/dist/cjs/clients/SpokePoolClient/index.js.map +1 -1
- package/dist/cjs/clients/index.d.ts +1 -1
- package/dist/cjs/clients/index.js +1 -2
- package/dist/cjs/clients/index.js.map +1 -1
- package/dist/cjs/clients/mocks/MockConfigStoreClient.d.ts +1 -1
- package/dist/cjs/clients/mocks/MockConfigStoreClient.js +2 -2
- package/dist/cjs/clients/mocks/MockConfigStoreClient.js.map +1 -1
- package/dist/cjs/clients/mocks/MockHubPoolClient.js +2 -2
- package/dist/cjs/clients/mocks/MockHubPoolClient.js.map +1 -1
- package/dist/cjs/clients/mocks/MockSpokePoolClient.js +4 -7
- package/dist/cjs/clients/mocks/MockSpokePoolClient.js.map +1 -1
- package/dist/cjs/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
- package/dist/cjs/gasPriceOracle/adapters/arbitrum.js.map +1 -1
- package/dist/cjs/gasPriceOracle/adapters/ethereum.d.ts +4 -4
- package/dist/cjs/gasPriceOracle/adapters/ethereum.js.map +1 -1
- package/dist/cjs/gasPriceOracle/adapters/linea-viem.js +2 -3
- package/dist/cjs/gasPriceOracle/adapters/linea-viem.js.map +1 -1
- package/dist/cjs/gasPriceOracle/adapters/polygon.d.ts +3 -3
- package/dist/cjs/gasPriceOracle/index.d.ts +1 -1
- package/dist/cjs/gasPriceOracle/oracle.d.ts +3 -4
- package/dist/cjs/gasPriceOracle/oracle.js +9 -16
- package/dist/cjs/gasPriceOracle/oracle.js.map +1 -1
- package/dist/cjs/gasPriceOracle/types.d.ts +1 -6
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/SpokePool.d.ts +0 -7
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +4 -5
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +11 -4
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +1 -7
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/index.d.ts +0 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/index.js +0 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/index.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.d.ts +9 -0
- package/dist/cjs/svm/eventsClient.d.ts +15 -0
- package/dist/cjs/{arch/svm → svm}/eventsClient.js +28 -60
- package/dist/cjs/svm/eventsClient.js.map +1 -0
- package/dist/cjs/svm/index.d.ts +3 -0
- package/dist/cjs/svm/index.js +8 -0
- package/dist/cjs/svm/index.js.map +1 -0
- package/dist/{esm/arch → cjs}/svm/types.d.ts +4 -9
- package/dist/cjs/svm/types.js.map +1 -0
- package/dist/cjs/svm/utils/events.d.ts +8 -0
- package/dist/cjs/svm/utils/events.js +47 -0
- package/dist/cjs/svm/utils/events.js.map +1 -0
- package/dist/cjs/svm/utils/helpers.d.ts +2 -0
- package/dist/cjs/svm/utils/helpers.js +19 -0
- package/dist/cjs/svm/utils/helpers.js.map +1 -0
- package/dist/cjs/svm/utils/index.d.ts +1 -0
- package/dist/cjs/svm/utils/index.js +5 -0
- package/dist/cjs/svm/utils/index.js.map +1 -0
- package/dist/cjs/utils/AddressUtils.d.ts +3 -9
- package/dist/cjs/utils/AddressUtils.js +6 -36
- package/dist/cjs/utils/AddressUtils.js.map +1 -1
- package/dist/cjs/utils/ArrayUtils.d.ts +0 -1
- package/dist/cjs/utils/ArrayUtils.js +1 -6
- package/dist/cjs/utils/ArrayUtils.js.map +1 -1
- package/dist/cjs/utils/EventUtils.d.ts +4 -4
- package/dist/cjs/utils/EventUtils.js +4 -7
- package/dist/cjs/utils/EventUtils.js.map +1 -1
- package/dist/cjs/utils/JSONUtils.js +0 -3
- package/dist/cjs/utils/JSONUtils.js.map +1 -1
- package/dist/cjs/utils/SpokeUtils.js +0 -5
- package/dist/cjs/utils/SpokeUtils.js.map +1 -1
- package/dist/cjs/utils/TokenUtils.d.ts +18 -0
- package/dist/esm/arch/evm/SpokeUtils.d.ts +1 -1
- package/dist/esm/arch/evm/SpokeUtils.js +5 -6
- package/dist/esm/arch/evm/SpokeUtils.js.map +1 -1
- package/dist/esm/arch/svm/index.d.ts +1 -5
- package/dist/esm/arch/svm/index.js +1 -5
- package/dist/esm/arch/svm/index.js.map +1 -1
- package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
- package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js +7 -7
- package/dist/esm/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.js.map +1 -1
- package/dist/esm/clients/BaseAbstractClient.d.ts +5 -6
- package/dist/esm/clients/BaseAbstractClient.js +19 -30
- package/dist/esm/clients/BaseAbstractClient.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/BundleDataClient.js +14 -17
- package/dist/esm/clients/BundleDataClient/BundleDataClient.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js +1 -1
- package/dist/esm/clients/BundleDataClient/utils/PoolRebalanceUtils.js.map +1 -1
- package/dist/esm/clients/BundleDataClient/utils/SuperstructUtils.d.ts +90 -90
- package/dist/esm/clients/HubPoolClient.d.ts +1 -1
- package/dist/esm/clients/HubPoolClient.js +16 -16
- package/dist/esm/clients/HubPoolClient.js.map +1 -1
- package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
- package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js +20 -23
- package/dist/esm/clients/SpokePoolClient/EVMSpokePoolClient.js.map +1 -1
- package/dist/esm/clients/SpokePoolClient/SpokePoolClient.d.ts +7 -7
- package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js +55 -51
- package/dist/esm/clients/SpokePoolClient/SpokePoolClient.js.map +1 -1
- package/dist/esm/clients/SpokePoolClient/index.d.ts +0 -8
- package/dist/esm/clients/SpokePoolClient/index.js +0 -10
- package/dist/esm/clients/SpokePoolClient/index.js.map +1 -1
- package/dist/esm/clients/index.d.ts +1 -1
- package/dist/esm/clients/index.js +1 -1
- package/dist/esm/clients/index.js.map +1 -1
- package/dist/esm/clients/mocks/MockConfigStoreClient.d.ts +1 -1
- package/dist/esm/clients/mocks/MockConfigStoreClient.js +2 -2
- package/dist/esm/clients/mocks/MockConfigStoreClient.js.map +1 -1
- package/dist/esm/clients/mocks/MockHubPoolClient.js +2 -2
- package/dist/esm/clients/mocks/MockHubPoolClient.js.map +1 -1
- package/dist/esm/clients/mocks/MockSpokePoolClient.js +5 -8
- package/dist/esm/clients/mocks/MockSpokePoolClient.js.map +1 -1
- package/dist/esm/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
- package/dist/esm/gasPriceOracle/adapters/arbitrum.js.map +1 -1
- package/dist/esm/gasPriceOracle/adapters/ethereum.d.ts +4 -4
- package/dist/esm/gasPriceOracle/adapters/ethereum.js.map +1 -1
- package/dist/esm/gasPriceOracle/adapters/linea-viem.js +2 -3
- package/dist/esm/gasPriceOracle/adapters/linea-viem.js.map +1 -1
- package/dist/esm/gasPriceOracle/adapters/polygon.d.ts +4 -4
- package/dist/esm/gasPriceOracle/adapters/polygon.js +1 -1
- package/dist/esm/gasPriceOracle/index.d.ts +1 -1
- package/dist/esm/gasPriceOracle/oracle.d.ts +3 -4
- package/dist/esm/gasPriceOracle/oracle.js +9 -18
- package/dist/esm/gasPriceOracle/oracle.js.map +1 -1
- package/dist/esm/gasPriceOracle/types.d.ts +1 -6
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces/SpokePool.d.ts +0 -7
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +3 -4
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +11 -4
- package/dist/esm/relayFeeCalculator/chain-queries/factory.js +2 -8
- package/dist/esm/relayFeeCalculator/chain-queries/factory.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/index.d.ts +0 -1
- package/dist/esm/relayFeeCalculator/chain-queries/index.js +0 -1
- package/dist/esm/relayFeeCalculator/chain-queries/index.js.map +1 -1
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.d.ts +9 -0
- package/dist/esm/svm/eventsClient.d.ts +51 -0
- package/dist/esm/{arch/svm → svm}/eventsClient.js +27 -69
- package/dist/esm/svm/eventsClient.js.map +1 -0
- package/dist/esm/svm/index.d.ts +3 -0
- package/dist/esm/svm/index.js +5 -0
- package/dist/esm/svm/index.js.map +1 -0
- package/dist/{cjs/arch → esm}/svm/types.d.ts +4 -9
- package/dist/esm/svm/types.js.map +1 -0
- package/dist/esm/svm/utils/events.d.ts +17 -0
- package/dist/esm/svm/utils/events.js +55 -0
- package/dist/esm/svm/utils/events.js.map +1 -0
- package/dist/esm/svm/utils/helpers.d.ts +5 -0
- package/dist/esm/svm/utils/helpers.js +18 -0
- package/dist/esm/svm/utils/helpers.js.map +1 -0
- package/dist/esm/svm/utils/index.d.ts +1 -0
- package/dist/esm/svm/utils/index.js +2 -0
- package/dist/esm/svm/utils/index.js.map +1 -0
- package/dist/esm/utils/AddressUtils.d.ts +3 -9
- package/dist/esm/utils/AddressUtils.js +6 -41
- package/dist/esm/utils/AddressUtils.js.map +1 -1
- package/dist/esm/utils/ArrayUtils.d.ts +0 -6
- package/dist/esm/utils/ArrayUtils.js +0 -9
- package/dist/esm/utils/ArrayUtils.js.map +1 -1
- package/dist/esm/utils/EventUtils.d.ts +4 -4
- package/dist/esm/utils/EventUtils.js +4 -7
- package/dist/esm/utils/EventUtils.js.map +1 -1
- package/dist/esm/utils/JSONUtils.js +0 -3
- package/dist/esm/utils/JSONUtils.js.map +1 -1
- package/dist/esm/utils/SpokeUtils.js +0 -5
- package/dist/esm/utils/SpokeUtils.js.map +1 -1
- package/dist/esm/utils/TokenUtils.d.ts +18 -0
- package/dist/types/arch/evm/SpokeUtils.d.ts +1 -1
- package/dist/types/arch/evm/SpokeUtils.d.ts.map +1 -1
- package/dist/types/arch/svm/index.d.ts +1 -5
- package/dist/types/arch/svm/index.d.ts.map +1 -1
- package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts +1 -1
- package/dist/types/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.d.ts.map +1 -1
- package/dist/types/clients/BaseAbstractClient.d.ts +5 -6
- package/dist/types/clients/BaseAbstractClient.d.ts.map +1 -1
- package/dist/types/clients/BundleDataClient/BundleDataClient.d.ts.map +1 -1
- package/dist/types/clients/BundleDataClient/utils/SuperstructUtils.d.ts +90 -90
- package/dist/types/clients/HubPoolClient.d.ts +1 -1
- package/dist/types/clients/HubPoolClient.d.ts.map +1 -1
- package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts +3 -3
- package/dist/types/clients/SpokePoolClient/EVMSpokePoolClient.d.ts.map +1 -1
- package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts +7 -7
- package/dist/types/clients/SpokePoolClient/SpokePoolClient.d.ts.map +1 -1
- package/dist/types/clients/SpokePoolClient/index.d.ts +0 -8
- package/dist/types/clients/SpokePoolClient/index.d.ts.map +1 -1
- package/dist/types/clients/index.d.ts +1 -1
- package/dist/types/clients/index.d.ts.map +1 -1
- package/dist/types/clients/mocks/MockConfigStoreClient.d.ts +1 -1
- package/dist/types/clients/mocks/MockConfigStoreClient.d.ts.map +1 -1
- package/dist/types/clients/mocks/MockSpokePoolClient.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts +2 -2
- package/dist/types/gasPriceOracle/adapters/arbitrum.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/adapters/ethereum.d.ts +4 -4
- package/dist/types/gasPriceOracle/adapters/ethereum.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/adapters/linea-viem.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/adapters/polygon.d.ts +4 -4
- package/dist/types/gasPriceOracle/adapters/polygon.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/index.d.ts +1 -1
- package/dist/types/gasPriceOracle/index.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/oracle.d.ts +3 -4
- package/dist/types/gasPriceOracle/oracle.d.ts.map +1 -1
- package/dist/types/gasPriceOracle/types.d.ts +1 -6
- package/dist/types/gasPriceOracle/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/interfaces/SpokePool.d.ts +0 -7
- package/dist/types/interfaces/SpokePool.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/baseQuery.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts +11 -4
- package/dist/types/relayFeeCalculator/chain-queries/factory.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/chain-queries/index.d.ts +0 -1
- package/dist/types/relayFeeCalculator/chain-queries/index.d.ts.map +1 -1
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts +9 -0
- package/dist/types/relayFeeCalculator/relayFeeCalculator.d.ts.map +1 -1
- package/dist/types/svm/eventsClient.d.ts +52 -0
- package/dist/types/svm/eventsClient.d.ts.map +1 -0
- package/dist/types/svm/index.d.ts +4 -0
- package/dist/types/svm/index.d.ts.map +1 -0
- package/dist/types/{arch/svm → svm}/types.d.ts +4 -9
- package/dist/types/svm/types.d.ts.map +1 -0
- package/dist/types/svm/utils/events.d.ts +18 -0
- package/dist/types/svm/utils/events.d.ts.map +1 -0
- package/dist/types/svm/utils/helpers.d.ts +6 -0
- package/dist/types/svm/utils/helpers.d.ts.map +1 -0
- package/dist/types/svm/utils/index.d.ts +2 -0
- package/dist/types/svm/utils/index.d.ts.map +1 -0
- package/dist/types/utils/AddressUtils.d.ts +3 -9
- package/dist/types/utils/AddressUtils.d.ts.map +1 -1
- package/dist/types/utils/ArrayUtils.d.ts +0 -6
- package/dist/types/utils/ArrayUtils.d.ts.map +1 -1
- package/dist/types/utils/EventUtils.d.ts +4 -4
- package/dist/types/utils/EventUtils.d.ts.map +1 -1
- package/dist/types/utils/JSONUtils.d.ts.map +1 -1
- package/dist/types/utils/SpokeUtils.d.ts.map +1 -1
- package/dist/types/utils/TokenUtils.d.ts +18 -0
- package/dist/types/utils/TokenUtils.d.ts.map +1 -1
- package/package.json +2 -5
- package/src/arch/evm/SpokeUtils.ts +5 -5
- package/src/arch/svm/index.ts +1 -5
- package/src/clients/AcrossConfigStoreClient/AcrossConfigStoreClient.ts +7 -7
- package/src/clients/BaseAbstractClient.ts +13 -20
- package/src/clients/BundleDataClient/BundleDataClient.ts +19 -28
- package/src/clients/BundleDataClient/utils/PoolRebalanceUtils.ts +1 -1
- package/src/clients/HubPoolClient.ts +16 -16
- package/src/clients/SpokePoolClient/EVMSpokePoolClient.ts +21 -23
- package/src/clients/SpokePoolClient/SpokePoolClient.ts +56 -44
- package/src/clients/SpokePoolClient/index.ts +0 -11
- package/src/clients/index.ts +1 -1
- package/src/clients/mocks/MockConfigStoreClient.ts +2 -2
- package/src/clients/mocks/MockHubPoolClient.ts +2 -2
- package/src/clients/mocks/MockSpokePoolClient.ts +4 -9
- package/src/gasPriceOracle/adapters/arbitrum.ts +2 -5
- package/src/gasPriceOracle/adapters/ethereum.ts +4 -7
- package/src/gasPriceOracle/adapters/linea-viem.ts +1 -3
- package/src/gasPriceOracle/adapters/polygon.ts +6 -6
- package/src/gasPriceOracle/index.ts +1 -1
- package/src/gasPriceOracle/oracle.ts +4 -20
- package/src/gasPriceOracle/types.ts +1 -7
- package/src/index.ts +1 -0
- package/src/interfaces/SpokePool.ts +0 -7
- package/src/relayFeeCalculator/chain-queries/baseQuery.ts +3 -5
- package/src/relayFeeCalculator/chain-queries/factory.ts +5 -21
- package/src/relayFeeCalculator/chain-queries/index.ts +0 -1
- package/src/{arch/svm → svm}/eventsClient.ts +45 -67
- package/src/svm/index.ts +3 -0
- package/src/{arch/svm → svm}/types.ts +4 -21
- package/src/svm/utils/events.ts +58 -0
- package/src/svm/utils/helpers.ts +9 -0
- package/src/svm/utils/index.ts +1 -0
- package/src/utils/AddressUtils.ts +6 -49
- package/src/utils/ArrayUtils.ts +0 -12
- package/src/utils/EventUtils.ts +11 -11
- package/src/utils/JSONUtils.ts +0 -2
- package/src/utils/SpokeUtils.ts +1 -5
- package/dist/cjs/arch/svm/SpokeUtils.d.ts +0 -20
- package/dist/cjs/arch/svm/SpokeUtils.js +0 -428
- package/dist/cjs/arch/svm/SpokeUtils.js.map +0 -1
- package/dist/cjs/arch/svm/constants.d.ts +0 -1
- package/dist/cjs/arch/svm/constants.js +0 -5
- package/dist/cjs/arch/svm/constants.js.map +0 -1
- package/dist/cjs/arch/svm/eventsClient.d.ts +0 -21
- package/dist/cjs/arch/svm/eventsClient.js.map +0 -1
- package/dist/cjs/arch/svm/types.js.map +0 -1
- package/dist/cjs/arch/svm/utils.d.ts +0 -17
- package/dist/cjs/arch/svm/utils.js +0 -204
- package/dist/cjs/arch/svm/utils.js.map +0 -1
- package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +0 -23
- package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.js +0 -145
- package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.js.map +0 -1
- package/dist/cjs/gasPriceOracle/adapters/solana.d.ts +0 -4
- package/dist/cjs/gasPriceOracle/adapters/solana.js +0 -43
- package/dist/cjs/gasPriceOracle/adapters/solana.js.map +0 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -31
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js +0 -136
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js.map +0 -1
- package/dist/esm/arch/svm/SpokeUtils.d.ts +0 -94
- package/dist/esm/arch/svm/SpokeUtils.js +0 -513
- package/dist/esm/arch/svm/SpokeUtils.js.map +0 -1
- package/dist/esm/arch/svm/constants.d.ts +0 -1
- package/dist/esm/arch/svm/constants.js +0 -2
- package/dist/esm/arch/svm/constants.js.map +0 -1
- package/dist/esm/arch/svm/eventsClient.d.ts +0 -67
- package/dist/esm/arch/svm/eventsClient.js.map +0 -1
- package/dist/esm/arch/svm/types.js.map +0 -1
- package/dist/esm/arch/svm/utils.d.ts +0 -59
- package/dist/esm/arch/svm/utils.js +0 -248
- package/dist/esm/arch/svm/utils.js.map +0 -1
- package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +0 -67
- package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.js +0 -196
- package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.js.map +0 -1
- package/dist/esm/gasPriceOracle/adapters/solana.d.ts +0 -8
- package/dist/esm/gasPriceOracle/adapters/solana.js +0 -43
- package/dist/esm/gasPriceOracle/adapters/solana.js.map +0 -1
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -66
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js +0 -169
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js.map +0 -1
- package/dist/types/arch/svm/SpokeUtils.d.ts +0 -95
- package/dist/types/arch/svm/SpokeUtils.d.ts.map +0 -1
- package/dist/types/arch/svm/constants.d.ts +0 -2
- package/dist/types/arch/svm/constants.d.ts.map +0 -1
- package/dist/types/arch/svm/eventsClient.d.ts +0 -68
- package/dist/types/arch/svm/eventsClient.d.ts.map +0 -1
- package/dist/types/arch/svm/types.d.ts.map +0 -1
- package/dist/types/arch/svm/utils.d.ts +0 -60
- package/dist/types/arch/svm/utils.d.ts.map +0 -1
- package/dist/types/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +0 -68
- package/dist/types/clients/SpokePoolClient/SVMSpokePoolClient.d.ts.map +0 -1
- package/dist/types/gasPriceOracle/adapters/solana.d.ts +0 -9
- package/dist/types/gasPriceOracle/adapters/solana.d.ts.map +0 -1
- package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -67
- package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts.map +0 -1
- package/src/arch/svm/SpokeUtils.ts +0 -526
- package/src/arch/svm/constants.ts +0 -1
- package/src/arch/svm/utils.ts +0 -222
- package/src/clients/SpokePoolClient/SVMSpokePoolClient.ts +0 -244
- package/src/gasPriceOracle/adapters/solana.ts +0 -45
- package/src/relayFeeCalculator/chain-queries/svmQuery.ts +0 -193
- /package/dist/cjs/{arch/svm → svm}/types.js +0 -0
- /package/dist/esm/{arch/svm → svm}/types.js +0 -0
|
@@ -19,20 +19,24 @@ import {
|
|
|
19
19
|
validateFillForDeposit,
|
|
20
20
|
chainIsEvm,
|
|
21
21
|
} from "../../utils";
|
|
22
|
-
import {
|
|
22
|
+
import {
|
|
23
|
+
duplicateEvent,
|
|
24
|
+
sortEventsAscendingInPlace,
|
|
25
|
+
spreadEvent,
|
|
26
|
+
spreadEventWithBlockNumber,
|
|
27
|
+
} from "../../utils/EventUtils";
|
|
23
28
|
import { ZERO_ADDRESS } from "../../constants";
|
|
24
29
|
import {
|
|
25
30
|
Deposit,
|
|
26
31
|
DepositWithBlock,
|
|
27
|
-
EnabledDepositRouteWithBlock,
|
|
28
32
|
Fill,
|
|
29
33
|
FillStatus,
|
|
30
34
|
FillWithBlock,
|
|
35
|
+
Log,
|
|
31
36
|
RelayData,
|
|
32
37
|
RelayerRefundExecutionWithBlock,
|
|
33
38
|
RootBundleRelayWithBlock,
|
|
34
39
|
SlowFillRequestWithBlock,
|
|
35
|
-
SortableEvent,
|
|
36
40
|
SpeedUpWithBlock,
|
|
37
41
|
TokensBridged,
|
|
38
42
|
} from "../../interfaces";
|
|
@@ -44,7 +48,7 @@ import { HubPoolClient } from "../HubPoolClient";
|
|
|
44
48
|
export type SpokePoolUpdateSuccess = {
|
|
45
49
|
success: true;
|
|
46
50
|
currentTime: number;
|
|
47
|
-
events:
|
|
51
|
+
events: Log[][];
|
|
48
52
|
searchEndBlock: number;
|
|
49
53
|
};
|
|
50
54
|
export type SpokePoolUpdateFailure = {
|
|
@@ -101,11 +105,11 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
101
105
|
readonly hubPoolClient: HubPoolClient | null,
|
|
102
106
|
readonly chainId: number,
|
|
103
107
|
public deploymentBlock: number,
|
|
104
|
-
eventSearchConfig: MakeOptional<EventSearchConfig, "
|
|
108
|
+
eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock"> = { fromBlock: 0, maxBlockLookBack: 0 }
|
|
105
109
|
) {
|
|
106
110
|
super(eventSearchConfig);
|
|
107
|
-
this.
|
|
108
|
-
this.
|
|
111
|
+
this.firstBlockToSearch = eventSearchConfig.fromBlock;
|
|
112
|
+
this.latestBlockSearched = 0;
|
|
109
113
|
this.configStoreClient = hubPoolClient?.configStoreClient;
|
|
110
114
|
}
|
|
111
115
|
|
|
@@ -369,7 +373,7 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
369
373
|
const { chainToSendRefundTo: repaymentChainId } = getRefundInformationFromFill(
|
|
370
374
|
fillRepaymentData,
|
|
371
375
|
this.hubPoolClient!,
|
|
372
|
-
this.hubPoolClient!.
|
|
376
|
+
this.hubPoolClient!.latestBlockSearched
|
|
373
377
|
);
|
|
374
378
|
// In order to keep this function sync, we can't call verifyFillRepayment so we'll log any fills where
|
|
375
379
|
// the filler-specified repayment chain and repayment address is not a valid repayment upon
|
|
@@ -482,7 +486,7 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
482
486
|
* @see _update
|
|
483
487
|
*/
|
|
484
488
|
public async update(eventsToQuery = this._queryableEventNames()): Promise<void> {
|
|
485
|
-
const duplicateEvents:
|
|
489
|
+
const duplicateEvents: Log[] = [];
|
|
486
490
|
if (this.hubPoolClient !== null && !this.hubPoolClient.isUpdated) {
|
|
487
491
|
throw new Error("HubPoolClient not updated");
|
|
488
492
|
}
|
|
@@ -494,14 +498,14 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
494
498
|
const { events: queryResults, currentTime, searchEndBlock } = update;
|
|
495
499
|
|
|
496
500
|
if (eventsToQuery.includes("TokensBridged")) {
|
|
497
|
-
for (const event of queryResults[eventsToQuery.indexOf("TokensBridged")]
|
|
498
|
-
this.tokensBridged.push(event);
|
|
501
|
+
for (const event of queryResults[eventsToQuery.indexOf("TokensBridged")]) {
|
|
502
|
+
this.tokensBridged.push(spreadEventWithBlockNumber(event) as TokensBridged);
|
|
499
503
|
}
|
|
500
504
|
}
|
|
501
505
|
|
|
502
506
|
// Performs the indexing of a deposit-like spoke pool event.
|
|
503
507
|
const queryDepositEvents = async (eventName: string) => {
|
|
504
|
-
const depositEvents =
|
|
508
|
+
const depositEvents = queryResults[eventsToQuery.indexOf(eventName)] ?? [];
|
|
505
509
|
if (depositEvents.length > 0) {
|
|
506
510
|
this.log(
|
|
507
511
|
"debug",
|
|
@@ -514,20 +518,22 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
514
518
|
|
|
515
519
|
// For each deposit, resolve its quoteTimestamp to a block number on the HubPool.
|
|
516
520
|
// Don't bother filtering for uniqueness; the HubPoolClient handles this efficienctly.
|
|
517
|
-
const quoteBlockNumbers = await this.getBlockNumbers(
|
|
521
|
+
const quoteBlockNumbers = await this.getBlockNumbers(
|
|
522
|
+
depositEvents.map(({ args }) => Number(args["quoteTimestamp"]))
|
|
523
|
+
);
|
|
518
524
|
for (const event of depositEvents) {
|
|
519
|
-
const quoteBlockNumber = quoteBlockNumbers[Number(event.quoteTimestamp)];
|
|
525
|
+
const quoteBlockNumber = quoteBlockNumbers[Number(event.args["quoteTimestamp"])];
|
|
520
526
|
|
|
521
527
|
// Derive and append the common properties that are not part of the onchain event.
|
|
522
528
|
const deposit = {
|
|
523
|
-
...event,
|
|
524
|
-
messageHash: getMessageHash(event.message),
|
|
529
|
+
...spreadEventWithBlockNumber(event),
|
|
530
|
+
messageHash: getMessageHash(event.args.message),
|
|
525
531
|
quoteBlockNumber,
|
|
526
532
|
originChainId: this.chainId,
|
|
527
533
|
// The following properties are placeholders to be updated immediately.
|
|
528
534
|
fromLiteChain: true,
|
|
529
535
|
toLiteChain: true,
|
|
530
|
-
};
|
|
536
|
+
} as DepositWithBlock;
|
|
531
537
|
|
|
532
538
|
deposit.fromLiteChain = this.isOriginLiteChain(deposit);
|
|
533
539
|
deposit.toLiteChain = this.isDestinationLiteChain(deposit);
|
|
@@ -558,10 +564,10 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
558
564
|
|
|
559
565
|
// Performs indexing of a "speed up deposit"-like event.
|
|
560
566
|
const querySpeedUpDepositEvents = (eventName: string) => {
|
|
561
|
-
const speedUpEvents =
|
|
567
|
+
const speedUpEvents = queryResults[eventsToQuery.indexOf(eventName)] ?? [];
|
|
562
568
|
|
|
563
569
|
for (const event of speedUpEvents) {
|
|
564
|
-
const speedUp = { ...event, originChainId: this.chainId };
|
|
570
|
+
const speedUp = { ...spreadEventWithBlockNumber(event), originChainId: this.chainId } as SpeedUpWithBlock;
|
|
565
571
|
assign(this.speedUps, [speedUp.depositor, speedUp.depositId.toString()], [speedUp]);
|
|
566
572
|
|
|
567
573
|
// Find deposit hash matching this speed up event and update the deposit data associated with the hash,
|
|
@@ -586,12 +592,12 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
586
592
|
|
|
587
593
|
// Performs indexing of "requested slow fill"-like events.
|
|
588
594
|
const queryRequestedSlowFillEvents = (eventName: string) => {
|
|
589
|
-
const slowFillRequests =
|
|
595
|
+
const slowFillRequests = queryResults[eventsToQuery.indexOf(eventName)];
|
|
590
596
|
for (const event of slowFillRequests) {
|
|
591
597
|
const slowFillRequest = {
|
|
592
|
-
...event,
|
|
598
|
+
...spreadEventWithBlockNumber(event),
|
|
593
599
|
destinationChainId: this.chainId,
|
|
594
|
-
};
|
|
600
|
+
} as SlowFillRequestWithBlock;
|
|
595
601
|
|
|
596
602
|
if (eventName === "RequestedV3SlowFill") {
|
|
597
603
|
slowFillRequest.messageHash = getMessageHash(slowFillRequest.message);
|
|
@@ -617,7 +623,7 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
617
623
|
|
|
618
624
|
// Performs indexing of filled relay-like events.
|
|
619
625
|
const queryFilledRelayEvents = (eventName: string) => {
|
|
620
|
-
const fillEvents =
|
|
626
|
+
const fillEvents = queryResults[eventsToQuery.indexOf(eventName)] ?? [];
|
|
621
627
|
|
|
622
628
|
if (fillEvents.length > 0) {
|
|
623
629
|
this.log("debug", `Using ${fillEvents.length} newly queried ${eventName} events for chain ${this.chainId}`, {
|
|
@@ -629,13 +635,13 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
629
635
|
// test that the types are complete. A broader change in strategy for safely unpacking events will be introduced.
|
|
630
636
|
for (const event of fillEvents) {
|
|
631
637
|
const fill = {
|
|
632
|
-
...event,
|
|
638
|
+
...spreadEventWithBlockNumber(event),
|
|
633
639
|
destinationChainId: this.chainId,
|
|
634
|
-
};
|
|
640
|
+
} as FillWithBlock;
|
|
635
641
|
|
|
636
642
|
if (eventName === "FilledV3Relay") {
|
|
637
|
-
fill.messageHash = getMessageHash(
|
|
638
|
-
fill.relayExecutionInfo.updatedMessageHash = getMessageHash(event.relayExecutionInfo.updatedMessage
|
|
643
|
+
fill.messageHash = getMessageHash(event.args.message);
|
|
644
|
+
fill.relayExecutionInfo.updatedMessageHash = getMessageHash(event.args.relayExecutionInfo.updatedMessage);
|
|
639
645
|
}
|
|
640
646
|
|
|
641
647
|
// Sanity check that this event is not a duplicate.
|
|
@@ -658,27 +664,30 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
658
664
|
});
|
|
659
665
|
|
|
660
666
|
if (eventsToQuery.includes("EnabledDepositRoute")) {
|
|
661
|
-
const enableDepositsEvents =
|
|
662
|
-
[]) as EnabledDepositRouteWithBlock[];
|
|
667
|
+
const enableDepositsEvents = queryResults[eventsToQuery.indexOf("EnabledDepositRoute")];
|
|
663
668
|
|
|
664
669
|
for (const event of enableDepositsEvents) {
|
|
665
|
-
|
|
670
|
+
const enableDeposit = spreadEvent(event.args);
|
|
671
|
+
assign(
|
|
672
|
+
this.depositRoutes,
|
|
673
|
+
[enableDeposit.originToken, enableDeposit.destinationChainId],
|
|
674
|
+
enableDeposit.enabled
|
|
675
|
+
);
|
|
666
676
|
}
|
|
667
677
|
}
|
|
668
678
|
|
|
669
679
|
if (eventsToQuery.includes("RelayedRootBundle")) {
|
|
670
|
-
const relayedRootBundleEvents =
|
|
671
|
-
[]) as RootBundleRelayWithBlock[];
|
|
680
|
+
const relayedRootBundleEvents = queryResults[eventsToQuery.indexOf("RelayedRootBundle")];
|
|
672
681
|
for (const event of relayedRootBundleEvents) {
|
|
673
|
-
this.rootBundleRelays.push(event);
|
|
682
|
+
this.rootBundleRelays.push(spreadEventWithBlockNumber(event) as RootBundleRelayWithBlock);
|
|
674
683
|
}
|
|
675
684
|
}
|
|
676
685
|
|
|
677
686
|
if (eventsToQuery.includes("ExecutedRelayerRefundRoot")) {
|
|
678
|
-
const refundEvents =
|
|
679
|
-
[]) as RelayerRefundExecutionWithBlock[];
|
|
687
|
+
const refundEvents = queryResults[eventsToQuery.indexOf("ExecutedRelayerRefundRoot")];
|
|
680
688
|
for (const event of refundEvents) {
|
|
681
|
-
|
|
689
|
+
const executedRefund = spreadEventWithBlockNumber(event) as RelayerRefundExecutionWithBlock;
|
|
690
|
+
this.relayerRefundExecutions.push(executedRefund);
|
|
682
691
|
}
|
|
683
692
|
}
|
|
684
693
|
|
|
@@ -691,12 +700,12 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
691
700
|
|
|
692
701
|
// Next iteration should start off from where this one ended.
|
|
693
702
|
this.currentTime = currentTime;
|
|
694
|
-
this.
|
|
695
|
-
this.
|
|
696
|
-
this.eventSearchConfig.
|
|
703
|
+
this.latestBlockSearched = searchEndBlock;
|
|
704
|
+
this.firstBlockToSearch = searchEndBlock + 1;
|
|
705
|
+
this.eventSearchConfig.toBlock = undefined; // Caller can re-set on subsequent updates if necessary
|
|
697
706
|
this.isUpdated = true;
|
|
698
707
|
this.log("debug", `SpokePool client for chain ${this.chainId} updated!`, {
|
|
699
|
-
|
|
708
|
+
nextFirstBlockToSearch: this.firstBlockToSearch,
|
|
700
709
|
});
|
|
701
710
|
}
|
|
702
711
|
|
|
@@ -839,16 +848,19 @@ export abstract class SpokePoolClient extends BaseAbstractClient {
|
|
|
839
848
|
/**
|
|
840
849
|
* Retrieves the fill status for a given relay data.
|
|
841
850
|
* @param relayData The relay data to retrieve the fill status for.
|
|
842
|
-
* @param
|
|
851
|
+
* @param blockTag The block at which to query the fill status.
|
|
843
852
|
* @returns The fill status for the given relay data.
|
|
844
853
|
*/
|
|
845
|
-
public abstract relayFillStatus(relayData: RelayData,
|
|
854
|
+
public abstract relayFillStatus(relayData: RelayData, blockTag?: number | "latest"): Promise<FillStatus>;
|
|
846
855
|
|
|
847
856
|
/**
|
|
848
857
|
* Retrieves the fill status for an array of given relay data.
|
|
849
858
|
* @param relayData The array relay data to retrieve the fill status for.
|
|
850
|
-
* @param
|
|
859
|
+
* @param blockTag The block at which to query the fill status.
|
|
851
860
|
* @returns The fill status for each of the given relay data.
|
|
852
861
|
*/
|
|
853
|
-
public abstract fillStatusArray(
|
|
862
|
+
public abstract fillStatusArray(
|
|
863
|
+
relayData: RelayData[],
|
|
864
|
+
blockTag?: number | "latest"
|
|
865
|
+
): Promise<(FillStatus | undefined)[]>;
|
|
854
866
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { EVMSpokePoolClient } from "./EVMSpokePoolClient";
|
|
2
|
-
import { SvmSpokePoolClient } from "./SVMSpokePoolClient";
|
|
3
2
|
import { SpokePoolClient } from "./SpokePoolClient";
|
|
4
3
|
|
|
5
4
|
export { EVMSpokePoolClient } from "./EVMSpokePoolClient";
|
|
6
5
|
export { SpokePoolClient, SpokePoolUpdate } from "./SpokePoolClient";
|
|
7
|
-
export { SvmSpokePoolClient } from "./SVMSpokePoolClient";
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Checks if a SpokePoolClient is an EVMSpokePoolClient.
|
|
@@ -14,12 +12,3 @@ export { SvmSpokePoolClient } from "./SVMSpokePoolClient";
|
|
|
14
12
|
export function isEVMSpokePoolClient(spokePoolClient: SpokePoolClient): spokePoolClient is EVMSpokePoolClient {
|
|
15
13
|
return spokePoolClient instanceof EVMSpokePoolClient;
|
|
16
14
|
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Checks if a SpokePoolClient is an SVMSpokePoolClient.
|
|
20
|
-
* @param spokePoolClient The SpokePoolClient to check.
|
|
21
|
-
* @returns True if the SpokePoolClient is an SVMSpokePoolClient, false otherwise.
|
|
22
|
-
*/
|
|
23
|
-
export function isSvmSpokePoolClient(spokePoolClient: SpokePoolClient): spokePoolClient is SvmSpokePoolClient {
|
|
24
|
-
return spokePoolClient instanceof SvmSpokePoolClient;
|
|
25
|
-
}
|
package/src/clients/index.ts
CHANGED
|
@@ -6,6 +6,6 @@ export {
|
|
|
6
6
|
} from "./AcrossConfigStoreClient";
|
|
7
7
|
export { UpdateFailureReason } from "./BaseAbstractClient";
|
|
8
8
|
export { HubPoolClient, LpFeeRequest } from "./HubPoolClient";
|
|
9
|
-
export { SpokePoolClient, SpokePoolUpdate, EVMSpokePoolClient
|
|
9
|
+
export { SpokePoolClient, SpokePoolUpdate, EVMSpokePoolClient } from "./SpokePoolClient";
|
|
10
10
|
export * as BundleDataClient from "./BundleDataClient";
|
|
11
11
|
export * as mocks from "./mocks";
|
|
@@ -33,7 +33,7 @@ export class MockConfigStoreClient extends AcrossConfigStoreClient {
|
|
|
33
33
|
constructor(
|
|
34
34
|
logger: winston.Logger,
|
|
35
35
|
configStore: Contract,
|
|
36
|
-
eventSearchConfig: MakeOptional<EventSearchConfig, "
|
|
36
|
+
eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock"> = { fromBlock: 0, maxBlockLookBack: 0 },
|
|
37
37
|
configStoreVersion: number,
|
|
38
38
|
chainId = 1,
|
|
39
39
|
mockUpdate = false,
|
|
@@ -97,7 +97,7 @@ export class MockConfigStoreClient extends AcrossConfigStoreClient {
|
|
|
97
97
|
return Promise.resolve({
|
|
98
98
|
success: true,
|
|
99
99
|
chainId: this.chainId as number,
|
|
100
|
-
searchEndBlock: this.eventSearchConfig.
|
|
100
|
+
searchEndBlock: this.eventSearchConfig.toBlock || latestBlockSearched,
|
|
101
101
|
events: {
|
|
102
102
|
updatedGlobalConfigEvents: events["UpdatedGlobalConfig"].map(spreadEventWithBlockNumber),
|
|
103
103
|
globalConfigUpdateTimes,
|
|
@@ -79,7 +79,7 @@ export class MockHubPoolClient extends HubPoolClient {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
setLatestBlockNumber(blockNumber: number) {
|
|
82
|
-
this.
|
|
82
|
+
this.latestBlockSearched = blockNumber;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
addL1Token(l1Token: L1Token) {
|
|
@@ -158,7 +158,7 @@ export class MockHubPoolClient extends HubPoolClient {
|
|
|
158
158
|
latestBlockSearched,
|
|
159
159
|
pendingRootBundleProposal: this.rootBundleProposal,
|
|
160
160
|
events,
|
|
161
|
-
searchEndBlock: this.eventSearchConfig.
|
|
161
|
+
searchEndBlock: this.eventSearchConfig.toBlock || latestBlockSearched,
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
|
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
bnOne,
|
|
28
28
|
toAddress,
|
|
29
29
|
toBytes32,
|
|
30
|
-
spreadEventWithBlockNumber,
|
|
31
30
|
} from "../../utils";
|
|
32
31
|
import { EVMSpokePoolClient, SpokePoolUpdate } from "../SpokePoolClient";
|
|
33
32
|
import { HubPoolClient } from "../HubPoolClient";
|
|
@@ -51,7 +50,7 @@ export class MockSpokePoolClient extends EVMSpokePoolClient {
|
|
|
51
50
|
opts: { hubPoolClient: HubPoolClient | null } = { hubPoolClient: null }
|
|
52
51
|
) {
|
|
53
52
|
super(logger, spokePool, opts.hubPoolClient, chainId, deploymentBlock);
|
|
54
|
-
this.
|
|
53
|
+
this.latestBlockSearched = deploymentBlock;
|
|
55
54
|
this.eventManager = getEventManager(chainId, this.eventSignatures, deploymentBlock);
|
|
56
55
|
}
|
|
57
56
|
|
|
@@ -68,7 +67,7 @@ export class MockSpokePoolClient extends EVMSpokePoolClient {
|
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
setLatestBlockNumber(blockNumber: number): void {
|
|
71
|
-
this.
|
|
70
|
+
this.latestBlockSearched = blockNumber;
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
setDepositIds(_depositIds: BigNumber[]): void {
|
|
@@ -107,16 +106,12 @@ export class MockSpokePoolClient extends EVMSpokePoolClient {
|
|
|
107
106
|
}
|
|
108
107
|
});
|
|
109
108
|
|
|
110
|
-
const eventsWithBlockNumber = events.map((eventList) =>
|
|
111
|
-
eventList.map((event) => spreadEventWithBlockNumber(event))
|
|
112
|
-
);
|
|
113
|
-
|
|
114
109
|
return Promise.resolve({
|
|
115
110
|
success: true,
|
|
116
111
|
firstDepositId: bnZero,
|
|
117
112
|
currentTime,
|
|
118
|
-
events
|
|
119
|
-
searchEndBlock: this.eventSearchConfig.
|
|
113
|
+
events,
|
|
114
|
+
searchEndBlock: this.eventSearchConfig.toBlock || latestBlockSearched,
|
|
120
115
|
});
|
|
121
116
|
}
|
|
122
117
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { providers } from "ethers";
|
|
2
2
|
import { bnOne } from "../../utils";
|
|
3
|
-
import {
|
|
3
|
+
import { GasPriceEstimate } from "../types";
|
|
4
4
|
import * as ethereum from "./ethereum";
|
|
5
5
|
import { GasPriceEstimateOptions } from "../oracle";
|
|
6
6
|
|
|
@@ -16,10 +16,7 @@ import { GasPriceEstimateOptions } from "../oracle";
|
|
|
16
16
|
* function.
|
|
17
17
|
* @returns GasPriceEstimate
|
|
18
18
|
*/
|
|
19
|
-
export async function eip1559(
|
|
20
|
-
provider: providers.Provider,
|
|
21
|
-
opts: GasPriceEstimateOptions
|
|
22
|
-
): Promise<EvmGasPriceEstimate> {
|
|
19
|
+
export async function eip1559(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate> {
|
|
23
20
|
const { maxFeePerGas: _maxFeePerGas, maxPriorityFeePerGas } = await ethereum.eip1559(provider, opts);
|
|
24
21
|
|
|
25
22
|
// eip1559() sets maxFeePerGas = lastBaseFeePerGas + maxPriorityFeePerGas, so back out priority fee.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
2
|
import { providers } from "ethers";
|
|
3
3
|
import { BigNumber, bnZero, fixedPointAdjustment, getNetworkName, parseUnits } from "../../utils";
|
|
4
|
-
import {
|
|
4
|
+
import { GasPriceEstimate } from "../types";
|
|
5
5
|
import { gasPriceError } from "../util";
|
|
6
6
|
import { GasPriceEstimateOptions } from "../oracle";
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ import { GasPriceEstimateOptions } from "../oracle";
|
|
|
13
13
|
* @param priorityFeeMultiplier Amount to multiply priority fee or unused for legacy gas pricing.
|
|
14
14
|
* @returns Promise of gas price estimate object.
|
|
15
15
|
*/
|
|
16
|
-
export function eip1559(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<
|
|
16
|
+
export function eip1559(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate> {
|
|
17
17
|
return eip1559Raw(provider, opts.chainId, opts.baseFeeMultiplier, opts.priorityFeeMultiplier);
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -29,7 +29,7 @@ export async function eip1559Raw(
|
|
|
29
29
|
chainId: number,
|
|
30
30
|
baseFeeMultiplier: BigNumber,
|
|
31
31
|
priorityFeeMultiplier: BigNumber
|
|
32
|
-
): Promise<
|
|
32
|
+
): Promise<GasPriceEstimate> {
|
|
33
33
|
const [{ baseFeePerGas }, _maxPriorityFeePerGas] = await Promise.all([
|
|
34
34
|
provider.getBlock("pending"),
|
|
35
35
|
(provider as providers.JsonRpcProvider).send("eth_maxPriorityFeePerGas", []),
|
|
@@ -54,10 +54,7 @@ export async function eip1559Raw(
|
|
|
54
54
|
* @dev Its recommended to use the eip1559Raw method over this one where possible as it will be more accurate.
|
|
55
55
|
* @returns GasPriceEstimate
|
|
56
56
|
*/
|
|
57
|
-
export async function legacy(
|
|
58
|
-
provider: providers.Provider,
|
|
59
|
-
opts: GasPriceEstimateOptions
|
|
60
|
-
): Promise<EvmGasPriceEstimate> {
|
|
57
|
+
export async function legacy(provider: providers.Provider, opts: GasPriceEstimateOptions): Promise<GasPriceEstimate> {
|
|
61
58
|
const { chainId, baseFeeMultiplier } = opts;
|
|
62
59
|
const gasPrice = await provider.getGasPrice();
|
|
63
60
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PopulatedTransaction } from "ethers";
|
|
2
1
|
import { Address, Hex, PublicClient } from "viem";
|
|
3
2
|
import { estimateGas } from "viem/linea";
|
|
4
3
|
import { DEFAULT_SIMULATED_RELAYER_ADDRESS as account } from "../../constants";
|
|
@@ -27,8 +26,7 @@ export async function eip1559(
|
|
|
27
26
|
provider: PublicClient,
|
|
28
27
|
opts: GasPriceEstimateOptions
|
|
29
28
|
): Promise<InternalGasPriceEstimate> {
|
|
30
|
-
const { unsignedTx
|
|
31
|
-
const unsignedTx = _unsignedTx as PopulatedTransaction; // Cast the opaque unsignedTx type to an ethers PopulatedTransaction.
|
|
29
|
+
const { unsignedTx, priorityFeeMultiplier } = opts;
|
|
32
30
|
const { baseFeePerGas, priorityFeePerGas: _priorityFeePerGas } = await estimateGas(provider, {
|
|
33
31
|
account: (unsignedTx?.from as Address) ?? account,
|
|
34
32
|
to: (unsignedTx?.to as Address) ?? account,
|
|
@@ -2,7 +2,7 @@ import { providers } from "ethers";
|
|
|
2
2
|
import { BaseHTTPAdapter, BaseHTTPAdapterArgs } from "../../priceClient/adapters/baseAdapter";
|
|
3
3
|
import { BigNumber, bnZero, fixedPointAdjustment, isDefined, parseUnits } from "../../utils";
|
|
4
4
|
import { CHAIN_IDs } from "../../constants";
|
|
5
|
-
import {
|
|
5
|
+
import { GasPriceEstimate } from "../types";
|
|
6
6
|
import { gasPriceError } from "../util";
|
|
7
7
|
import { eip1559 } from "./ethereum";
|
|
8
8
|
import { GasPriceEstimateOptions } from "../oracle";
|
|
@@ -38,7 +38,7 @@ export class PolygonGasStation extends BaseHTTPAdapter {
|
|
|
38
38
|
this.chainId = chainId;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
async getFeeData(strategy: "safeLow" | "standard" | "fast" = "fast"): Promise<
|
|
41
|
+
async getFeeData(strategy: "safeLow" | "standard" | "fast" = "fast"): Promise<GasPriceEstimate> {
|
|
42
42
|
const gas = await this.query("v2", {});
|
|
43
43
|
|
|
44
44
|
const gasPrice = (gas as GasStationV2Response)?.[strategy];
|
|
@@ -69,7 +69,7 @@ export class PolygonGasStation extends BaseHTTPAdapter {
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
class MockRevertingPolygonGasStation extends PolygonGasStation {
|
|
72
|
-
getFeeData(): Promise<
|
|
72
|
+
getFeeData(): Promise<GasPriceEstimate> {
|
|
73
73
|
throw new Error();
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -78,7 +78,7 @@ export const MockPolygonGasStationBaseFee = () => parseUnits("12", 9);
|
|
|
78
78
|
export const MockPolygonGasStationPriorityFee = () => parseUnits("1", 9);
|
|
79
79
|
|
|
80
80
|
class MockPolygonGasStation extends PolygonGasStation {
|
|
81
|
-
getFeeData(): Promise<
|
|
81
|
+
getFeeData(): Promise<GasPriceEstimate> {
|
|
82
82
|
return Promise.resolve({
|
|
83
83
|
maxPriorityFeePerGas: MockPolygonGasStationPriorityFee(),
|
|
84
84
|
maxFeePerGas: MockPolygonGasStationBaseFee().add(MockPolygonGasStationPriorityFee()),
|
|
@@ -90,12 +90,12 @@ class MockPolygonGasStation extends PolygonGasStation {
|
|
|
90
90
|
* @notice Returns the gas price suggested by the Polygon GasStation API or reconstructs it using
|
|
91
91
|
* the eip1559() method as a fallback.
|
|
92
92
|
* @param provider Ethers Provider.
|
|
93
|
-
* @returns
|
|
93
|
+
* @returns GasPriceEstimate
|
|
94
94
|
*/
|
|
95
95
|
export async function gasStation(
|
|
96
96
|
provider: providers.Provider,
|
|
97
97
|
opts: GasPriceEstimateOptions
|
|
98
|
-
): Promise<
|
|
98
|
+
): Promise<GasPriceEstimate> {
|
|
99
99
|
const { chainId, baseFeeMultiplier, priorityFeeMultiplier } = opts;
|
|
100
100
|
let gasStation: PolygonGasStation;
|
|
101
101
|
if (process.env.TEST_POLYGON_GAS_STATION === "true") {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { getGasPriceEstimate } from "./oracle";
|
|
2
|
-
export { GasPriceEstimate
|
|
2
|
+
export { GasPriceEstimate } from "./types";
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
2
|
import { Transport } from "viem";
|
|
3
|
-
import { providers } from "ethers";
|
|
3
|
+
import { PopulatedTransaction, providers } from "ethers";
|
|
4
4
|
import { CHAIN_IDs } from "../constants";
|
|
5
5
|
import { BigNumber, chainIsOPStack, fixedPointAdjustment, toBNWei } from "../utils";
|
|
6
|
-
import { SVMProvider as SolanaProvider } from "../arch/svm";
|
|
7
6
|
import { GasPriceEstimate } from "./types";
|
|
8
7
|
import { getPublicClient } from "./util";
|
|
9
8
|
import * as arbitrum from "./adapters/arbitrum";
|
|
10
9
|
import * as ethereum from "./adapters/ethereum";
|
|
11
10
|
import * as polygon from "./adapters/polygon";
|
|
12
11
|
import * as lineaViem from "./adapters/linea-viem";
|
|
13
|
-
import * as solana from "./adapters/solana";
|
|
14
12
|
|
|
15
13
|
export interface GasPriceEstimateOptions {
|
|
16
14
|
// baseFeeMultiplier Multiplier applied to base fee for EIP1559 gas prices (or total fee for legacy).
|
|
@@ -21,8 +19,8 @@ export interface GasPriceEstimateOptions {
|
|
|
21
19
|
legacyFallback: boolean;
|
|
22
20
|
// chainId The chain ID to query for gas prices. If omitted can be inferred by provider.
|
|
23
21
|
chainId: number;
|
|
24
|
-
// unsignedTx The unsigned transaction used for simulation by Linea's Viem provider to produce the priority gas fee
|
|
25
|
-
unsignedTx?:
|
|
22
|
+
// unsignedTx The unsigned transaction used for simulation by Linea's Viem provider to produce the priority gas fee.
|
|
23
|
+
unsignedTx?: PopulatedTransaction;
|
|
26
24
|
// transport Viem Transport object to use for querying gas fees used for testing.
|
|
27
25
|
transport?: Transport;
|
|
28
26
|
}
|
|
@@ -41,7 +39,7 @@ const VIEM_CHAINS = [CHAIN_IDs.LINEA];
|
|
|
41
39
|
* @returns An object of type GasPriceEstimate.
|
|
42
40
|
*/
|
|
43
41
|
export async function getGasPriceEstimate(
|
|
44
|
-
provider: providers.Provider
|
|
42
|
+
provider: providers.Provider,
|
|
45
43
|
opts: Partial<GasPriceEstimateOptions> = {}
|
|
46
44
|
): Promise<GasPriceEstimate> {
|
|
47
45
|
const baseFeeMultiplier = opts.baseFeeMultiplier ?? toBNWei("1");
|
|
@@ -55,20 +53,6 @@ export async function getGasPriceEstimate(
|
|
|
55
53
|
`Require 1.0 < priority fee multiplier (${priorityFeeMultiplier}) <= 5.0 for a total gas multiplier within [+1.0, +5.0]`
|
|
56
54
|
);
|
|
57
55
|
|
|
58
|
-
// Exit here if we need to estimate on Solana.
|
|
59
|
-
if (!(provider instanceof providers.Provider)) {
|
|
60
|
-
const optsWithDefaults: GasPriceEstimateOptions = {
|
|
61
|
-
...GAS_PRICE_ESTIMATE_DEFAULTS,
|
|
62
|
-
baseFeeMultiplier,
|
|
63
|
-
priorityFeeMultiplier,
|
|
64
|
-
...opts,
|
|
65
|
-
chainId: opts.chainId ?? CHAIN_IDs.SOLANA,
|
|
66
|
-
};
|
|
67
|
-
return solana.messageFee(provider, optsWithDefaults);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Cast the provider to an ethers provider, which should be given to the oracle when querying an EVM network.
|
|
71
|
-
provider = provider as providers.Provider;
|
|
72
56
|
const chainId = opts.chainId ?? (await provider.getNetwork()).chainId;
|
|
73
57
|
const optsWithDefaults: GasPriceEstimateOptions = {
|
|
74
58
|
...GAS_PRICE_ESTIMATE_DEFAULTS,
|
|
@@ -2,18 +2,12 @@ import { type Chain, type Transport, PublicClient, FeeValuesEIP1559 } from "viem
|
|
|
2
2
|
import { BigNumber } from "../utils";
|
|
3
3
|
|
|
4
4
|
export type InternalGasPriceEstimate = FeeValuesEIP1559;
|
|
5
|
-
export type GasPriceEstimate = EvmGasPriceEstimate | SvmGasPriceEstimate;
|
|
6
5
|
|
|
7
|
-
export type
|
|
6
|
+
export type GasPriceEstimate = {
|
|
8
7
|
maxFeePerGas: BigNumber;
|
|
9
8
|
maxPriorityFeePerGas: BigNumber;
|
|
10
9
|
};
|
|
11
10
|
|
|
12
|
-
export type SvmGasPriceEstimate = {
|
|
13
|
-
baseFee: BigNumber;
|
|
14
|
-
microLamportsPerComputeUnit: BigNumber;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
11
|
export interface GasPriceFeed {
|
|
18
12
|
(provider: PublicClient<Transport, Chain>, chainId: number): Promise<InternalGasPriceEstimate>;
|
|
19
13
|
}
|
package/src/index.ts
CHANGED
|
@@ -67,13 +67,6 @@ export interface Fill extends Omit<RelayData, "message"> {
|
|
|
67
67
|
|
|
68
68
|
export interface FillWithBlock extends Fill, SortableEvent {}
|
|
69
69
|
|
|
70
|
-
export interface EnabledDepositRoute {
|
|
71
|
-
originToken: string;
|
|
72
|
-
destinationChainId: number;
|
|
73
|
-
enabled: boolean;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface EnabledDepositRouteWithBlock extends EnabledDepositRoute, SortableEvent {}
|
|
77
70
|
export interface SpeedUp {
|
|
78
71
|
depositor: string;
|
|
79
72
|
depositorSignature: string;
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
import assert from "assert";
|
|
20
20
|
import { Logger, QueryInterface } from "../relayFeeCalculator";
|
|
21
21
|
import { Transport } from "viem";
|
|
22
|
-
import { getGasPriceEstimate
|
|
22
|
+
import { getGasPriceEstimate } from "../../gasPriceOracle/oracle";
|
|
23
23
|
type Provider = providers.Provider;
|
|
24
24
|
type OptimismProvider = L2Provider<Provider>;
|
|
25
|
-
|
|
25
|
+
type SymbolMappingType = Record<
|
|
26
26
|
string,
|
|
27
27
|
{
|
|
28
28
|
addresses: Record<number, string>;
|
|
@@ -213,9 +213,7 @@ export class QueryBase implements QueryInterface {
|
|
|
213
213
|
? Promise.resolve({ maxFeePerGas: _gasPrice })
|
|
214
214
|
: getGasPriceEstimate(provider, { chainId, baseFeeMultiplier, priorityFeeMultiplier, transport, unsignedTx }),
|
|
215
215
|
] as const;
|
|
216
|
-
const [nativeGasCost,
|
|
217
|
-
// It should be safe to cast to an EvmGasPriceEstimate here since QueryBase is only used for EVM chains.
|
|
218
|
-
const gasPrice = (_gasPriceEstimate as EvmGasPriceEstimate).maxFeePerGas;
|
|
216
|
+
const [nativeGasCost, { maxFeePerGas: gasPrice }] = await Promise.all(queries);
|
|
219
217
|
assert(nativeGasCost.gt(bnZero), "Gas cost should not be 0");
|
|
220
218
|
let tokenGasCost: BigNumber;
|
|
221
219
|
|