@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
|
@@ -113,6 +113,15 @@ export declare const resolveContractFromSymbol: (symbol: string, chainId: string
|
|
|
113
113
|
};
|
|
114
114
|
coingeckoId: string;
|
|
115
115
|
};
|
|
116
|
+
ezETH: {
|
|
117
|
+
name: string;
|
|
118
|
+
symbol: string;
|
|
119
|
+
decimals: number;
|
|
120
|
+
addresses: {
|
|
121
|
+
[x: number]: string;
|
|
122
|
+
};
|
|
123
|
+
coingeckoId: string;
|
|
124
|
+
};
|
|
116
125
|
GHO: {
|
|
117
126
|
name: string;
|
|
118
127
|
symbol: string;
|
|
@@ -519,6 +528,15 @@ export declare function getTokenInfo(l2TokenAddress: string, chainId: number, to
|
|
|
519
528
|
};
|
|
520
529
|
coingeckoId: string;
|
|
521
530
|
};
|
|
531
|
+
ezETH: {
|
|
532
|
+
name: string;
|
|
533
|
+
symbol: string;
|
|
534
|
+
decimals: number;
|
|
535
|
+
addresses: {
|
|
536
|
+
[x: number]: string;
|
|
537
|
+
};
|
|
538
|
+
coingeckoId: string;
|
|
539
|
+
};
|
|
522
540
|
GHO: {
|
|
523
541
|
name: string;
|
|
524
542
|
symbol: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/TokenUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAY,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAM7C,KAAK,gBAAgB,GAAG,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC;AAEpD,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAI1G;AAED,eAAO,MAAM,mBAAmB,mBACd,MAAM;;aAMvB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAY7E;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,WAC5B,MAAM,WACL,MAAM
|
|
1
|
+
{"version":3,"file":"TokenUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/TokenUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAY,SAAS,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAM7C,KAAK,gBAAgB,GAAG,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC;AAEpD,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CAI1G;AAED,eAAO,MAAM,mBAAmB,mBACd,MAAM;;aAMvB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAY7E;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,WAC5B,MAAM,WACL,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEd,MAAM,GAAG,SAIX,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAM7F;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,GAAE,QAAmB,GAC5B,OAAO,CAAC,SAAS,CAAC,CAGpB;AAED,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAI1D;AAED,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAIzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAoB,GAAG,OAAO,CAkB/G;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOlF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAUjF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@across-protocol/sdk",
|
|
3
3
|
"author": "UMA Team",
|
|
4
|
-
"version": "4.1.63
|
|
4
|
+
"version": "4.1.63",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"homepage": "https://docs.across.to/reference/sdk",
|
|
7
7
|
"files": [
|
|
@@ -104,17 +104,14 @@
|
|
|
104
104
|
},
|
|
105
105
|
"dependencies": {
|
|
106
106
|
"@across-protocol/across-token": "^1.0.0",
|
|
107
|
-
"@across-protocol/constants": "^3.1.
|
|
107
|
+
"@across-protocol/constants": "^3.1.66",
|
|
108
108
|
"@across-protocol/contracts": "^4.0.9",
|
|
109
109
|
"@coral-xyz/anchor": "^0.30.1",
|
|
110
110
|
"@eth-optimism/sdk": "^3.3.1",
|
|
111
111
|
"@ethersproject/bignumber": "^5.7.0",
|
|
112
112
|
"@pinata/sdk": "^2.1.0",
|
|
113
113
|
"@solana/kit": "^2.1.0",
|
|
114
|
-
"@solana-program/system": "^0.7.0",
|
|
115
|
-
"@solana-program/token-2022": "^0.4.0",
|
|
116
114
|
"@solana/web3.js": "^1.31.0",
|
|
117
|
-
"@solana-program/system": "^0.7.0",
|
|
118
115
|
"@types/mocha": "^10.0.1",
|
|
119
116
|
"@uma/sdk": "^0.34.10",
|
|
120
117
|
"arweave": "^1.14.4",
|
|
@@ -160,7 +160,7 @@ export async function findDepositBlock(
|
|
|
160
160
|
export async function relayFillStatus(
|
|
161
161
|
spokePool: Contract,
|
|
162
162
|
relayData: RelayData,
|
|
163
|
-
blockTag
|
|
163
|
+
blockTag?: number | "latest",
|
|
164
164
|
destinationChainId?: number
|
|
165
165
|
): Promise<FillStatus> {
|
|
166
166
|
destinationChainId ??= await spokePool.chainId();
|
|
@@ -290,20 +290,20 @@ export async function findFillEvent(
|
|
|
290
290
|
if (!blockNumber) return undefined;
|
|
291
291
|
|
|
292
292
|
// We can hardcode this to 0 to instruct paginatedEventQuery to make a single request for the same block number.
|
|
293
|
-
const
|
|
294
|
-
const [
|
|
293
|
+
const maxBlockLookBack = 0;
|
|
294
|
+
const [fromBlock, toBlock] = [blockNumber, blockNumber];
|
|
295
295
|
|
|
296
296
|
const query = (
|
|
297
297
|
await Promise.all([
|
|
298
298
|
paginatedEventQuery(
|
|
299
299
|
spokePool,
|
|
300
300
|
spokePool.filters.FilledRelay(null, null, null, null, null, relayData.originChainId, relayData.depositId),
|
|
301
|
-
{
|
|
301
|
+
{ fromBlock, toBlock, maxBlockLookBack }
|
|
302
302
|
),
|
|
303
303
|
paginatedEventQuery(
|
|
304
304
|
spokePool,
|
|
305
305
|
spokePool.filters.FilledV3Relay(null, null, null, null, null, relayData.originChainId, relayData.depositId),
|
|
306
|
-
{
|
|
306
|
+
{ fromBlock, toBlock, maxBlockLookBack }
|
|
307
307
|
),
|
|
308
308
|
])
|
|
309
309
|
).flat();
|
package/src/arch/svm/index.ts
CHANGED
|
@@ -98,12 +98,12 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
|
|
|
98
98
|
constructor(
|
|
99
99
|
readonly logger: winston.Logger,
|
|
100
100
|
readonly configStore: Contract,
|
|
101
|
-
eventSearchConfig: MakeOptional<EventSearchConfig, "
|
|
101
|
+
eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock"> = { fromBlock: 0, maxBlockLookBack: 0 },
|
|
102
102
|
readonly configStoreVersion: number
|
|
103
103
|
) {
|
|
104
104
|
super(eventSearchConfig);
|
|
105
|
-
this.
|
|
106
|
-
this.
|
|
105
|
+
this.firstBlockToSearch = eventSearchConfig.fromBlock;
|
|
106
|
+
this.latestBlockSearched = 0;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
getRateModelForBlockNumber(
|
|
@@ -355,7 +355,7 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
|
|
|
355
355
|
return {
|
|
356
356
|
success: true,
|
|
357
357
|
chainId,
|
|
358
|
-
searchEndBlock: searchConfig.
|
|
358
|
+
searchEndBlock: searchConfig.toBlock,
|
|
359
359
|
events: {
|
|
360
360
|
updatedTokenConfigEvents: updatedTokenConfigSortableEvents,
|
|
361
361
|
updatedGlobalConfigEvents: updatedGlobalConfigSortableEvents,
|
|
@@ -550,9 +550,9 @@ export class AcrossConfigStoreClient extends BaseAbstractClient {
|
|
|
550
550
|
}
|
|
551
551
|
|
|
552
552
|
this.hasLatestConfigStoreVersion = this.hasValidConfigStoreVersionForTimestamp();
|
|
553
|
-
this.
|
|
554
|
-
this.
|
|
555
|
-
this.eventSearchConfig.
|
|
553
|
+
this.latestBlockSearched = result.searchEndBlock;
|
|
554
|
+
this.firstBlockToSearch = result.searchEndBlock + 1; // Next iteration should start off from where this one ended.
|
|
555
|
+
this.eventSearchConfig.toBlock = undefined; // Caller can re-set on subsequent updates if necessary
|
|
556
556
|
this.chainId = this.chainId ?? chainId; // Update on the first run only.
|
|
557
557
|
this.isUpdated = true;
|
|
558
558
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { providers } from "ethers";
|
|
2
2
|
import { CachingMechanismInterface } from "../interfaces";
|
|
3
3
|
import { EventSearchConfig, isDefined, MakeOptional } from "../utils";
|
|
4
|
-
import { SVMProvider } from "../arch/svm";
|
|
5
4
|
|
|
6
5
|
export enum UpdateFailureReason {
|
|
7
6
|
NotReady,
|
|
@@ -19,15 +18,15 @@ export function isUpdateFailureReason(x: EventSearchConfig | UpdateFailureReason
|
|
|
19
18
|
*/
|
|
20
19
|
export abstract class BaseAbstractClient {
|
|
21
20
|
protected _isUpdated: boolean;
|
|
22
|
-
public
|
|
23
|
-
public
|
|
21
|
+
public firstBlockToSearch = 0;
|
|
22
|
+
public latestBlockSearched = 0;
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
* Creates a new client.
|
|
27
26
|
* @param cachingMechanism The caching mechanism to use for this client. If not provided, the client will not rely on an external cache.
|
|
28
27
|
*/
|
|
29
28
|
constructor(
|
|
30
|
-
readonly eventSearchConfig: MakeOptional<EventSearchConfig, "
|
|
29
|
+
readonly eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock"> = { fromBlock: 0, maxBlockLookBack: 0 },
|
|
31
30
|
protected cachingMechanism?: CachingMechanismInterface
|
|
32
31
|
) {
|
|
33
32
|
this._isUpdated = false;
|
|
@@ -59,28 +58,22 @@ export abstract class BaseAbstractClient {
|
|
|
59
58
|
* @provider Ethers RPC provider instance.
|
|
60
59
|
* @returns An EventSearchConfig instance if valid, otherwise an UpdateFailureReason.
|
|
61
60
|
*/
|
|
62
|
-
public async updateSearchConfig(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (from > to) {
|
|
69
|
-
throw new Error(`Invalid event search config from (${from}) > to (${to})`);
|
|
61
|
+
public async updateSearchConfig(provider: providers.Provider): Promise<EventSearchConfig | UpdateFailureReason> {
|
|
62
|
+
const fromBlock = this.firstBlockToSearch;
|
|
63
|
+
let { toBlock } = this.eventSearchConfig;
|
|
64
|
+
if (isDefined(toBlock)) {
|
|
65
|
+
if (fromBlock > toBlock) {
|
|
66
|
+
throw new Error(`Invalid event search config fromBlock (${fromBlock}) > toBlock (${toBlock})`);
|
|
70
67
|
}
|
|
71
68
|
} else {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
} else {
|
|
75
|
-
to = Number(await provider.getSlot({ commitment: "confirmed" }).send());
|
|
76
|
-
}
|
|
77
|
-
if (to < from) {
|
|
69
|
+
toBlock = await provider.getBlockNumber();
|
|
70
|
+
if (toBlock < fromBlock) {
|
|
78
71
|
return UpdateFailureReason.AlreadyUpdated;
|
|
79
72
|
}
|
|
80
73
|
}
|
|
81
74
|
|
|
82
|
-
const {
|
|
83
|
-
return {
|
|
75
|
+
const { maxBlockLookBack } = this.eventSearchConfig;
|
|
76
|
+
return { fromBlock, toBlock, maxBlockLookBack };
|
|
84
77
|
}
|
|
85
78
|
|
|
86
79
|
/**
|
|
@@ -20,8 +20,7 @@ import {
|
|
|
20
20
|
DepositWithBlock,
|
|
21
21
|
} from "../../interfaces";
|
|
22
22
|
import { SpokePoolClient } from "..";
|
|
23
|
-
import { findFillEvent
|
|
24
|
-
import { findFillEvent as findSvmFillEvent } from "../../arch/svm";
|
|
23
|
+
import { findFillEvent } from "../../arch/evm";
|
|
25
24
|
import {
|
|
26
25
|
BigNumber,
|
|
27
26
|
bnZero,
|
|
@@ -57,7 +56,7 @@ import {
|
|
|
57
56
|
V3FillWithBlock,
|
|
58
57
|
verifyFillRepayment,
|
|
59
58
|
} from "./utils";
|
|
60
|
-
import { isEVMSpokePoolClient
|
|
59
|
+
import { isEVMSpokePoolClient } from "../SpokePoolClient";
|
|
61
60
|
|
|
62
61
|
// max(uint256) - 1
|
|
63
62
|
export const INFINITE_FILL_DEADLINE = bnUint32Max;
|
|
@@ -371,7 +370,7 @@ export class BundleDataClient {
|
|
|
371
370
|
}
|
|
372
371
|
|
|
373
372
|
const bundle = this.clients.hubPoolClient.getLatestFullyExecutedRootBundle(
|
|
374
|
-
this.clients.hubPoolClient.
|
|
373
|
+
this.clients.hubPoolClient.latestBlockSearched
|
|
375
374
|
);
|
|
376
375
|
if (bundle !== undefined) {
|
|
377
376
|
refunds.push(await this.getPendingRefundsFromBundle(bundle));
|
|
@@ -384,7 +383,7 @@ export class BundleDataClient {
|
|
|
384
383
|
async getPendingRefundsFromBundle(bundle: ProposedRootBundle): Promise<CombinedRefunds> {
|
|
385
384
|
const nextBundleMainnetStartBlock = this.clients.hubPoolClient.getNextBundleStartBlockNumber(
|
|
386
385
|
this.chainIdListForBundleEvaluationBlockNumbers,
|
|
387
|
-
this.clients.hubPoolClient.
|
|
386
|
+
this.clients.hubPoolClient.latestBlockSearched,
|
|
388
387
|
this.clients.hubPoolClient.chainId
|
|
389
388
|
);
|
|
390
389
|
const chainIds = this.clients.configStoreClient.getChainIdIndicesForBlock(nextBundleMainnetStartBlock);
|
|
@@ -518,7 +517,7 @@ export class BundleDataClient {
|
|
|
518
517
|
const hubPoolClient = this.clients.hubPoolClient;
|
|
519
518
|
const nextBundleMainnetStartBlock = hubPoolClient.getNextBundleStartBlockNumber(
|
|
520
519
|
this.chainIdListForBundleEvaluationBlockNumbers,
|
|
521
|
-
hubPoolClient.
|
|
520
|
+
hubPoolClient.latestBlockSearched,
|
|
522
521
|
hubPoolClient.chainId
|
|
523
522
|
);
|
|
524
523
|
const chainIds = this.clients.configStoreClient.getChainIdIndicesForBlock(nextBundleMainnetStartBlock);
|
|
@@ -531,8 +530,8 @@ export class BundleDataClient {
|
|
|
531
530
|
this.spokePoolClients,
|
|
532
531
|
getEndBlockBuffers(chainIds, this.blockRangeEndBlockBuffer),
|
|
533
532
|
this.clients,
|
|
534
|
-
this.clients.hubPoolClient.
|
|
535
|
-
this.clients.configStoreClient.getEnabledChains(this.clients.hubPoolClient.
|
|
533
|
+
this.clients.hubPoolClient.latestBlockSearched,
|
|
534
|
+
this.clients.configStoreClient.getEnabledChains(this.clients.hubPoolClient.latestBlockSearched)
|
|
536
535
|
);
|
|
537
536
|
// Return block ranges for blocks after _pendingBlockRanges and up to widestBlockRanges.
|
|
538
537
|
// If a chain is disabled or doesn't have a spoke pool client, return a range of 0
|
|
@@ -800,7 +799,7 @@ export class BundleDataClient {
|
|
|
800
799
|
// hasn't queried. This is because this function will usually be called
|
|
801
800
|
// in production with block ranges that were validated by
|
|
802
801
|
// DataworkerUtils.blockRangesAreInvalidForSpokeClients.
|
|
803
|
-
Math.min(queryBlock, spokePoolClients[deposit.destinationChainId].
|
|
802
|
+
Math.min(queryBlock, spokePoolClients[deposit.destinationChainId].latestBlockSearched)
|
|
804
803
|
);
|
|
805
804
|
};
|
|
806
805
|
|
|
@@ -1617,24 +1616,16 @@ export class BundleDataClient {
|
|
|
1617
1616
|
deposit: DepositWithBlock,
|
|
1618
1617
|
spokePoolClient: SpokePoolClient
|
|
1619
1618
|
): Promise<FillWithBlock | undefined> {
|
|
1620
|
-
if (
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
spokePoolClient.chainId,
|
|
1624
|
-
spokePoolClient.svmEventsClient,
|
|
1625
|
-
spokePoolClient.deploymentBlock,
|
|
1626
|
-
spokePoolClient.latestHeightSearched
|
|
1627
|
-
);
|
|
1628
|
-
} else if (isEVMSpokePoolClient(spokePoolClient)) {
|
|
1629
|
-
return await findEvmFillEvent(
|
|
1630
|
-
spokePoolClient.spokePool,
|
|
1631
|
-
deposit,
|
|
1632
|
-
spokePoolClient.deploymentBlock,
|
|
1633
|
-
spokePoolClient.latestHeightSearched
|
|
1634
|
-
);
|
|
1635
|
-
} else {
|
|
1636
|
-
throw new Error("Unsupported spoke pool client type");
|
|
1619
|
+
if (!isEVMSpokePoolClient(spokePoolClient)) {
|
|
1620
|
+
// FIXME: Handle non-EVM chains.
|
|
1621
|
+
throw new Error("Destination chain is not an EVM chain.");
|
|
1637
1622
|
}
|
|
1623
|
+
return await findFillEvent(
|
|
1624
|
+
spokePoolClient.spokePool,
|
|
1625
|
+
deposit,
|
|
1626
|
+
spokePoolClient.deploymentBlock,
|
|
1627
|
+
spokePoolClient.latestBlockSearched
|
|
1628
|
+
);
|
|
1638
1629
|
}
|
|
1639
1630
|
|
|
1640
1631
|
async getBundleBlockTimestamps(
|
|
@@ -1661,13 +1652,13 @@ export class BundleDataClient {
|
|
|
1661
1652
|
// contain blocks where the spoke pool client hasn't queried. This is because this function
|
|
1662
1653
|
// will usually be called in production with block ranges that were validated by
|
|
1663
1654
|
// DataworkerUtils.blockRangesAreInvalidForSpokeClients.
|
|
1664
|
-
const startBlockForChain = Math.min(_startBlockForChain, spokePoolClient.
|
|
1655
|
+
const startBlockForChain = Math.min(_startBlockForChain, spokePoolClient.latestBlockSearched);
|
|
1665
1656
|
// @dev Add 1 to the bundle end block. The thinking here is that there can be a gap between
|
|
1666
1657
|
// block timestamps in subsequent blocks. The bundle data client assumes that fill deadlines expire
|
|
1667
1658
|
// in exactly one bundle, therefore we must make sure that the bundle block timestamp for one bundle's
|
|
1668
1659
|
// end block is exactly equal to the bundle block timestamp for the next bundle's start block. This way
|
|
1669
1660
|
// there are no gaps in block timestamps between bundles.
|
|
1670
|
-
const endBlockForChain = Math.min(_endBlockForChain + 1, spokePoolClient.
|
|
1661
|
+
const endBlockForChain = Math.min(_endBlockForChain + 1, spokePoolClient.latestBlockSearched);
|
|
1671
1662
|
const [startTime, _endTime] = [
|
|
1672
1663
|
await spokePoolClient.getTimestampForBlock(startBlockForChain),
|
|
1673
1664
|
await spokePoolClient.getTimestampForBlock(endBlockForChain),
|
|
@@ -32,7 +32,7 @@ export function getWidestPossibleExpectedBlockRange(
|
|
|
32
32
|
// filled during the challenge period.
|
|
33
33
|
const latestPossibleBundleEndBlockNumbers = chainIdListForBundleEvaluationBlockNumbers.map(
|
|
34
34
|
(chainId: number, index) =>
|
|
35
|
-
spokeClients[chainId] && Math.max(spokeClients[chainId].
|
|
35
|
+
spokeClients[chainId] && Math.max(spokeClients[chainId].latestBlockSearched - endBlockBuffers[index], 0)
|
|
36
36
|
);
|
|
37
37
|
return chainIdListForBundleEvaluationBlockNumbers.map((chainId: number, index) => {
|
|
38
38
|
const lastEndBlockForChain = clients.hubPoolClient.getLatestBundleEndBlockForChain(
|
|
@@ -105,7 +105,7 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
105
105
|
public configStoreClient: ConfigStoreClient,
|
|
106
106
|
public deploymentBlock = 0,
|
|
107
107
|
readonly chainId: number = 1,
|
|
108
|
-
eventSearchConfig: MakeOptional<EventSearchConfig, "
|
|
108
|
+
eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock"> = { fromBlock: 0, maxBlockLookBack: 0 },
|
|
109
109
|
protected readonly configOverride: {
|
|
110
110
|
ignoredHubExecutedBundles: number[];
|
|
111
111
|
ignoredHubProposedBundles: number[];
|
|
@@ -117,8 +117,8 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
117
117
|
cachingMechanism?: CachingMechanismInterface
|
|
118
118
|
) {
|
|
119
119
|
super(eventSearchConfig, cachingMechanism);
|
|
120
|
-
this.
|
|
121
|
-
this.
|
|
120
|
+
this.latestBlockSearched = Math.min(deploymentBlock - 1, 0);
|
|
121
|
+
this.firstBlockToSearch = eventSearchConfig.fromBlock;
|
|
122
122
|
|
|
123
123
|
const provider = this.hubPool.provider;
|
|
124
124
|
this.blockFinder = new BlockFinder(provider);
|
|
@@ -254,7 +254,7 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
254
254
|
return l2Token !== undefined;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
l2TokenHasPoolRebalanceRoute(l2Token: string, l2ChainId: number, hubPoolBlock = this.
|
|
257
|
+
l2TokenHasPoolRebalanceRoute(l2Token: string, l2ChainId: number, hubPoolBlock = this.latestBlockSearched): boolean {
|
|
258
258
|
return Object.values(this.l1TokensToDestinationTokensWithBlock).some((destinationTokenMapping) => {
|
|
259
259
|
return Object.entries(destinationTokenMapping).some(([_l2ChainId, setPoolRebalanceRouteEvents]) => {
|
|
260
260
|
return setPoolRebalanceRouteEvents.some((e) => {
|
|
@@ -312,7 +312,7 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
async getCurrentPoolUtilization(l1Token: string): Promise<BigNumber> {
|
|
315
|
-
const blockNumber = this.
|
|
315
|
+
const blockNumber = this.latestBlockSearched ?? (await this.hubPool.provider.getBlockNumber());
|
|
316
316
|
return await this.getUtilization(l1Token, blockNumber, bnZero, getCurrentTime(), 0);
|
|
317
317
|
}
|
|
318
318
|
|
|
@@ -523,7 +523,7 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
523
523
|
chainIdA: number,
|
|
524
524
|
tokenB: string,
|
|
525
525
|
chainIdB: number,
|
|
526
|
-
hubPoolBlock = this.
|
|
526
|
+
hubPoolBlock = this.latestBlockSearched
|
|
527
527
|
): boolean {
|
|
528
528
|
if (
|
|
529
529
|
!this.l2TokenHasPoolRebalanceRoute(tokenA, chainIdA, hubPoolBlock) ||
|
|
@@ -719,7 +719,7 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
719
719
|
if (n === 0) {
|
|
720
720
|
throw new Error("n cannot be 0");
|
|
721
721
|
}
|
|
722
|
-
if (!this.
|
|
722
|
+
if (!this.latestBlockSearched) {
|
|
723
723
|
throw new Error("HubPoolClient::getNthFullyExecutedRootBundle client not updated");
|
|
724
724
|
}
|
|
725
725
|
|
|
@@ -728,7 +728,7 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
728
728
|
// If n is negative, then return the Nth latest executed bundle, otherwise return the Nth earliest
|
|
729
729
|
// executed bundle.
|
|
730
730
|
if (n < 0) {
|
|
731
|
-
let nextLatestMainnetBlock = startBlock ?? this.
|
|
731
|
+
let nextLatestMainnetBlock = startBlock ?? this.latestBlockSearched;
|
|
732
732
|
for (let i = 0; i < Math.abs(n); i++) {
|
|
733
733
|
bundleToReturn = this.getLatestFullyExecutedRootBundle(nextLatestMainnetBlock);
|
|
734
734
|
const bundleBlockNumber = bundleToReturn ? bundleToReturn.blockNumber : 0;
|
|
@@ -740,12 +740,12 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
740
740
|
} else {
|
|
741
741
|
let nextStartBlock = startBlock ?? 0;
|
|
742
742
|
for (let i = 0; i < n; i++) {
|
|
743
|
-
bundleToReturn = this.getEarliestFullyExecutedRootBundle(this.
|
|
743
|
+
bundleToReturn = this.getEarliestFullyExecutedRootBundle(this.latestBlockSearched, nextStartBlock);
|
|
744
744
|
const bundleBlockNumber = bundleToReturn ? bundleToReturn.blockNumber : 0;
|
|
745
745
|
|
|
746
746
|
// Add 1 so that next `getEarliestFullyExecutedRootBundle` call filters out the root bundle we just found
|
|
747
747
|
// because its block number is < nextStartBlock.
|
|
748
|
-
nextStartBlock = Math.min(bundleBlockNumber + 1, this.
|
|
748
|
+
nextStartBlock = Math.min(bundleBlockNumber + 1, this.latestBlockSearched);
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
751
|
|
|
@@ -831,7 +831,7 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
831
831
|
// instantiation. However, certain events generally must be queried back to HubPool genesis.
|
|
832
832
|
const overrideEvents = ["CrossChainContractsSet", "L1TokenEnabledForLiquidityProvision", "SetPoolRebalanceRoute"];
|
|
833
833
|
if (overrideEvents.includes(eventName) && !this.isUpdated) {
|
|
834
|
-
_searchConfig.
|
|
834
|
+
_searchConfig.fromBlock = this.deploymentBlock;
|
|
835
835
|
}
|
|
836
836
|
|
|
837
837
|
return {
|
|
@@ -853,7 +853,7 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
853
853
|
const [multicallOutput, ...events] = await Promise.all([
|
|
854
854
|
hubPool.callStatic.multicall(
|
|
855
855
|
multicallFunctions.map((f) => hubPool.interface.encodeFunctionData(f)),
|
|
856
|
-
{ blockTag: searchConfig.
|
|
856
|
+
{ blockTag: searchConfig.toBlock }
|
|
857
857
|
),
|
|
858
858
|
...eventSearchConfigs.map((config) => paginatedEventQuery(hubPool, config.filter, config.searchConfig)),
|
|
859
859
|
]);
|
|
@@ -874,7 +874,7 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
874
874
|
success: true,
|
|
875
875
|
currentTime,
|
|
876
876
|
pendingRootBundleProposal,
|
|
877
|
-
searchEndBlock: searchConfig.
|
|
877
|
+
searchEndBlock: searchConfig.toBlock,
|
|
878
878
|
events: _events,
|
|
879
879
|
};
|
|
880
880
|
}
|
|
@@ -1087,9 +1087,9 @@ export class HubPoolClient extends BaseAbstractClient {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
|
|
1089
1089
|
this.currentTime = currentTime;
|
|
1090
|
-
this.
|
|
1091
|
-
this.
|
|
1092
|
-
this.eventSearchConfig.
|
|
1090
|
+
this.latestBlockSearched = searchEndBlock;
|
|
1091
|
+
this.firstBlockToSearch = update.searchEndBlock + 1; // Next iteration should start off from where this one ended.
|
|
1092
|
+
this.eventSearchConfig.toBlock = undefined; // Caller can re-set on subsequent updates if necessary.
|
|
1093
1093
|
|
|
1094
1094
|
this.isUpdated = true;
|
|
1095
1095
|
this.logger.debug({ at: "HubPoolClient::update", message: "HubPool client updated!", searchEndBlock });
|
|
@@ -39,17 +39,20 @@ export class EVMSpokePoolClient extends SpokePoolClient {
|
|
|
39
39
|
hubPoolClient: HubPoolClient | null,
|
|
40
40
|
chainId: number,
|
|
41
41
|
deploymentBlock: number,
|
|
42
|
-
eventSearchConfig: MakeOptional<EventSearchConfig, "
|
|
42
|
+
eventSearchConfig: MakeOptional<EventSearchConfig, "toBlock"> = { fromBlock: 0, maxBlockLookBack: 0 }
|
|
43
43
|
) {
|
|
44
44
|
super(logger, hubPoolClient, chainId, deploymentBlock, eventSearchConfig);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
public override relayFillStatus(relayData: RelayData,
|
|
48
|
-
return relayFillStatus(this.spokePool, relayData,
|
|
47
|
+
public override relayFillStatus(relayData: RelayData, blockTag?: number | "latest"): Promise<FillStatus> {
|
|
48
|
+
return relayFillStatus(this.spokePool, relayData, blockTag, this.chainId);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
public override fillStatusArray(
|
|
52
|
-
|
|
51
|
+
public override fillStatusArray(
|
|
52
|
+
relayData: RelayData[],
|
|
53
|
+
blockTag?: number | "latest"
|
|
54
|
+
): Promise<(FillStatus | undefined)[]> {
|
|
55
|
+
return fillStatusArray(this.spokePool, relayData, blockTag);
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
public override getMaxFillDeadlineInRange(startBlock: number, endBlock: number): Promise<number> {
|
|
@@ -86,7 +89,7 @@ export class EVMSpokePoolClient extends SpokePoolClient {
|
|
|
86
89
|
// However, certain events have special overriding requirements to their search ranges:
|
|
87
90
|
// - EnabledDepositRoute: The full history is always required, so override the requested fromBlock.
|
|
88
91
|
if (eventName === "EnabledDepositRoute" && !this.isUpdated) {
|
|
89
|
-
_searchConfig.
|
|
92
|
+
_searchConfig.fromBlock = this.deploymentBlock;
|
|
90
93
|
}
|
|
91
94
|
|
|
92
95
|
return {
|
|
@@ -107,7 +110,7 @@ export class EVMSpokePoolClient extends SpokePoolClient {
|
|
|
107
110
|
const [multicallOutput, ...events] = await Promise.all([
|
|
108
111
|
spokePool.callStatic.multicall(
|
|
109
112
|
multicallFunctions.map((f) => spokePool.interface.encodeFunctionData(f)),
|
|
110
|
-
{ blockTag: searchConfig.
|
|
113
|
+
{ blockTag: searchConfig.toBlock }
|
|
111
114
|
),
|
|
112
115
|
...eventSearchConfigs.map((config) => paginatedEventQuery(this.spokePool, config.filter, config.searchConfig)),
|
|
113
116
|
]);
|
|
@@ -121,22 +124,17 @@ export class EVMSpokePoolClient extends SpokePoolClient {
|
|
|
121
124
|
const errMsg = BigNumber.isBigNumber(currentTime)
|
|
122
125
|
? `currentTime: ${currentTime} < ${toBN(this.currentTime)}`
|
|
123
126
|
: `currentTime is not a BigNumber: ${JSON.stringify(currentTime)}`;
|
|
124
|
-
throw new Error(`
|
|
127
|
+
throw new Error(`SpokePoolClient::update: ${errMsg}`);
|
|
125
128
|
}
|
|
126
129
|
|
|
127
130
|
// Sort all events to ensure they are stored in a consistent order.
|
|
128
131
|
events.forEach((events) => sortEventsAscendingInPlace(events.map(logToSortableEvent)));
|
|
129
132
|
|
|
130
|
-
// Map events to SortableEvent
|
|
131
|
-
const eventsWithBlockNumber = events.map((eventList) =>
|
|
132
|
-
eventList.map((event) => spreadEventWithBlockNumber(event))
|
|
133
|
-
);
|
|
134
|
-
|
|
135
133
|
return {
|
|
136
134
|
success: true,
|
|
137
135
|
currentTime: currentTime.toNumber(), // uint32
|
|
138
|
-
searchEndBlock: searchConfig.
|
|
139
|
-
events
|
|
136
|
+
searchEndBlock: searchConfig.toBlock,
|
|
137
|
+
events,
|
|
140
138
|
};
|
|
141
139
|
}
|
|
142
140
|
|
|
@@ -151,31 +149,31 @@ export class EVMSpokePoolClient extends SpokePoolClient {
|
|
|
151
149
|
}
|
|
152
150
|
|
|
153
151
|
// No deposit found; revert to searching for it.
|
|
154
|
-
const upperBound = this.
|
|
155
|
-
const
|
|
152
|
+
const upperBound = this.latestBlockSearched || undefined; // Don't permit block 0 as the high block.
|
|
153
|
+
const fromBlock = await findDepositBlock(this.spokePool, depositId, this.deploymentBlock, upperBound);
|
|
156
154
|
const chain = getNetworkName(this.chainId);
|
|
157
|
-
if (!
|
|
155
|
+
if (!fromBlock) {
|
|
158
156
|
const reason =
|
|
159
157
|
`Unable to find ${chain} depositId ${depositId}` +
|
|
160
158
|
` within blocks [${this.deploymentBlock}, ${upperBound ?? "latest"}].`;
|
|
161
159
|
return { found: false, code: InvalidFill.DepositIdNotFound, reason };
|
|
162
160
|
}
|
|
163
161
|
|
|
164
|
-
const
|
|
162
|
+
const toBlock = fromBlock;
|
|
165
163
|
const tStart = Date.now();
|
|
166
164
|
// Check both V3FundsDeposited and FundsDeposited events to look for a specified depositId.
|
|
167
|
-
const {
|
|
165
|
+
const { maxBlockLookBack } = this.eventSearchConfig;
|
|
168
166
|
const query = (
|
|
169
167
|
await Promise.all([
|
|
170
168
|
paginatedEventQuery(
|
|
171
169
|
this.spokePool,
|
|
172
170
|
this.spokePool.filters.V3FundsDeposited(null, null, null, null, null, depositId),
|
|
173
|
-
{
|
|
171
|
+
{ fromBlock, toBlock, maxBlockLookBack }
|
|
174
172
|
),
|
|
175
173
|
paginatedEventQuery(
|
|
176
174
|
this.spokePool,
|
|
177
175
|
this.spokePool.filters.FundsDeposited(null, null, null, null, null, depositId),
|
|
178
|
-
{
|
|
176
|
+
{ fromBlock, toBlock, maxBlockLookBack }
|
|
179
177
|
),
|
|
180
178
|
])
|
|
181
179
|
).flat();
|
|
@@ -186,7 +184,7 @@ export class EVMSpokePoolClient extends SpokePoolClient {
|
|
|
186
184
|
return {
|
|
187
185
|
found: false,
|
|
188
186
|
code: InvalidFill.DepositIdNotFound,
|
|
189
|
-
reason: `${chain} depositId ${depositId} not found at block ${
|
|
187
|
+
reason: `${chain} depositId ${depositId} not found at block ${fromBlock}.`,
|
|
190
188
|
};
|
|
191
189
|
}
|
|
192
190
|
|