@across-protocol/sdk 4.1.63-beta.3 → 4.1.64-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/evm/index.d.ts +0 -1
- package/dist/cjs/arch/evm/index.js +0 -1
- package/dist/cjs/arch/evm/index.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 +114 -114
- package/dist/cjs/clients/HubPoolClient.d.ts +3 -4
- package/dist/cjs/clients/HubPoolClient.js +17 -18
- 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 +57 -54
- 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/clients/mocks/index.d.ts +0 -2
- package/dist/cjs/clients/mocks/index.js +0 -2
- package/dist/cjs/clients/mocks/index.js.map +1 -1
- package/dist/cjs/constants.d.ts +0 -1
- package/dist/cjs/constants.js +1 -2
- package/dist/cjs/constants.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 -13
- package/dist/cjs/interfaces/SpokePool.js.map +1 -1
- package/dist/cjs/providers/index.d.ts +1 -1
- package/dist/cjs/providers/index.js +2 -1
- package/dist/cjs/providers/index.js.map +1 -1
- package/dist/cjs/providers/{mocks/mockEthersProvider.js → mockProvider.js} +2 -2
- package/dist/cjs/providers/mockProvider.js.map +1 -0
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js +8 -10
- package/dist/cjs/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.d.ts +2 -4
- package/dist/cjs/relayFeeCalculator/chain-queries/factory.js +2 -8
- 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 +0 -2
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js +4 -10
- package/dist/cjs/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
- package/dist/cjs/svm/eventsClient.d.ts +15 -0
- package/dist/cjs/svm/eventsClient.js +157 -0
- 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/cjs/{arch/svm → 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/BlockUtils.d.ts +27 -2
- package/dist/cjs/utils/BlockUtils.js +208 -2
- package/dist/cjs/utils/BlockUtils.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/index.d.ts +0 -1
- package/dist/cjs/utils/index.js +0 -1
- package/dist/cjs/utils/index.js.map +1 -1
- 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/evm/index.d.ts +0 -1
- package/dist/esm/arch/evm/index.js +0 -1
- package/dist/esm/arch/evm/index.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 +114 -114
- package/dist/esm/clients/HubPoolClient.d.ts +3 -4
- package/dist/esm/clients/HubPoolClient.js +18 -19
- 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 +59 -57
- 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/clients/mocks/index.d.ts +0 -2
- package/dist/esm/clients/mocks/index.js +0 -2
- package/dist/esm/clients/mocks/index.js.map +1 -1
- package/dist/esm/constants.d.ts +0 -1
- package/dist/esm/constants.js +0 -1
- package/dist/esm/constants.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 -13
- package/dist/esm/interfaces/SpokePool.js.map +1 -1
- package/dist/esm/providers/index.d.ts +1 -1
- package/dist/esm/providers/index.js +2 -1
- package/dist/esm/providers/index.js.map +1 -1
- package/dist/esm/providers/{mocks/mockEthersProvider.js → mockProvider.js} +2 -2
- package/dist/esm/providers/mockProvider.js.map +1 -0
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.d.ts +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js +8 -10
- package/dist/esm/relayFeeCalculator/chain-queries/baseQuery.js.map +1 -1
- package/dist/esm/relayFeeCalculator/chain-queries/factory.d.ts +2 -4
- package/dist/esm/relayFeeCalculator/chain-queries/factory.js +5 -11
- 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 +1 -12
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.js +5 -10
- package/dist/esm/relayFeeCalculator/relayFeeCalculator.js.map +1 -1
- package/dist/esm/svm/eventsClient.d.ts +51 -0
- package/dist/esm/svm/eventsClient.js +195 -0
- 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/esm/{arch/svm → 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/BlockUtils.d.ts +36 -2
- package/dist/esm/utils/BlockUtils.js +243 -2
- package/dist/esm/utils/BlockUtils.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/index.d.ts +0 -1
- package/dist/esm/utils/index.js +0 -1
- package/dist/esm/utils/index.js.map +1 -1
- 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/evm/index.d.ts +0 -1
- package/dist/types/arch/evm/index.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 +114 -114
- package/dist/types/clients/HubPoolClient.d.ts +3 -4
- 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/clients/mocks/index.d.ts +0 -2
- package/dist/types/clients/mocks/index.d.ts.map +1 -1
- package/dist/types/constants.d.ts +0 -1
- package/dist/types/constants.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 -13
- package/dist/types/interfaces/SpokePool.d.ts.map +1 -1
- package/dist/types/providers/index.d.ts +1 -1
- package/dist/types/providers/index.d.ts.map +1 -1
- package/dist/types/providers/{mocks/mockEthersProvider.d.ts → mockProvider.d.ts} +1 -1
- package/dist/types/providers/mockProvider.d.ts.map +1 -0
- 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 +2 -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 +1 -12
- 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/BlockUtils.d.ts +36 -2
- package/dist/types/utils/BlockUtils.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/index.d.ts +0 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/package.json +1 -3
- package/src/arch/evm/SpokeUtils.ts +5 -5
- package/src/arch/evm/index.ts +0 -1
- 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 +19 -19
- package/src/clients/SpokePoolClient/EVMSpokePoolClient.ts +21 -23
- package/src/clients/SpokePoolClient/SpokePoolClient.ts +59 -50
- 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/clients/mocks/index.ts +0 -2
- package/src/constants.ts +0 -1
- 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 -14
- package/src/providers/index.ts +1 -1
- package/src/providers/{mocks/mockEthersProvider.ts → mockProvider.ts} +1 -1
- package/src/relayFeeCalculator/chain-queries/baseQuery.ts +9 -11
- package/src/relayFeeCalculator/chain-queries/factory.ts +8 -24
- package/src/relayFeeCalculator/chain-queries/index.ts +0 -1
- package/src/relayFeeCalculator/relayFeeCalculator.ts +4 -16
- package/src/svm/eventsClient.ts +199 -0
- 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/BlockUtils.ts +215 -5
- package/src/utils/EventUtils.ts +11 -11
- package/src/utils/JSONUtils.ts +0 -2
- package/src/utils/SpokeUtils.ts +3 -7
- package/src/utils/index.ts +0 -1
- package/dist/cjs/arch/evm/BlockUtils.d.ts +0 -15
- package/dist/cjs/arch/evm/BlockUtils.js +0 -218
- package/dist/cjs/arch/evm/BlockUtils.js.map +0 -1
- package/dist/cjs/arch/svm/SpokeUtils.d.ts +0 -21
- package/dist/cjs/arch/svm/SpokeUtils.js +0 -454
- package/dist/cjs/arch/svm/SpokeUtils.js.map +0 -1
- package/dist/cjs/arch/svm/constants.d.ts +0 -2
- package/dist/cjs/arch/svm/constants.js +0 -7
- package/dist/cjs/arch/svm/constants.js.map +0 -1
- package/dist/cjs/arch/svm/eventsClient.d.ts +0 -26
- package/dist/cjs/arch/svm/eventsClient.js +0 -253
- 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 -18
- package/dist/cjs/arch/svm/utils.js +0 -212
- 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 -172
- package/dist/cjs/clients/SpokePoolClient/SVMSpokePoolClient.js.map +0 -1
- package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.d.ts +0 -33
- package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.js +0 -184
- package/dist/cjs/clients/mocks/MockSvmCpiEventsClient.js.map +0 -1
- package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.d.ts +0 -30
- package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.js +0 -90
- package/dist/cjs/clients/mocks/MockSvmSpokePoolClient.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/providers/mocks/MockCachedSolanaRpcFactory.d.ts +0 -5
- package/dist/cjs/providers/mocks/MockCachedSolanaRpcFactory.js +0 -21
- package/dist/cjs/providers/mocks/MockCachedSolanaRpcFactory.js.map +0 -1
- package/dist/cjs/providers/mocks/MockRateLimitedSolanaRpcFactory.d.ts +0 -5
- package/dist/cjs/providers/mocks/MockRateLimitedSolanaRpcFactory.js +0 -20
- package/dist/cjs/providers/mocks/MockRateLimitedSolanaRpcFactory.js.map +0 -1
- package/dist/cjs/providers/mocks/MockSolanaRpcFactory.d.ts +0 -13
- package/dist/cjs/providers/mocks/MockSolanaRpcFactory.js +0 -76
- package/dist/cjs/providers/mocks/MockSolanaRpcFactory.js.map +0 -1
- package/dist/cjs/providers/mocks/index.d.ts +0 -4
- package/dist/cjs/providers/mocks/index.js +0 -8
- package/dist/cjs/providers/mocks/index.js.map +0 -1
- package/dist/cjs/providers/mocks/mockEthersProvider.js.map +0 -1
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -37
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js +0 -171
- package/dist/cjs/relayFeeCalculator/chain-queries/svmQuery.js.map +0 -1
- package/dist/cjs/utils/BlockFinder.d.ts +0 -22
- package/dist/cjs/utils/BlockFinder.js +0 -10
- package/dist/cjs/utils/BlockFinder.js.map +0 -1
- package/dist/esm/arch/evm/BlockUtils.d.ts +0 -24
- package/dist/esm/arch/evm/BlockUtils.js +0 -250
- package/dist/esm/arch/evm/BlockUtils.js.map +0 -1
- package/dist/esm/arch/svm/SpokeUtils.d.ts +0 -129
- package/dist/esm/arch/svm/SpokeUtils.js +0 -576
- package/dist/esm/arch/svm/SpokeUtils.js.map +0 -1
- package/dist/esm/arch/svm/constants.d.ts +0 -2
- package/dist/esm/arch/svm/constants.js +0 -3
- package/dist/esm/arch/svm/constants.js.map +0 -1
- package/dist/esm/arch/svm/eventsClient.d.ts +0 -87
- package/dist/esm/arch/svm/eventsClient.js +0 -316
- 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 -63
- package/dist/esm/arch/svm/utils.js +0 -258
- package/dist/esm/arch/svm/utils.js.map +0 -1
- package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +0 -66
- package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.js +0 -225
- package/dist/esm/clients/SpokePoolClient/SVMSpokePoolClient.js.map +0 -1
- package/dist/esm/clients/mocks/MockSvmCpiEventsClient.d.ts +0 -33
- package/dist/esm/clients/mocks/MockSvmCpiEventsClient.js +0 -183
- package/dist/esm/clients/mocks/MockSvmCpiEventsClient.js.map +0 -1
- package/dist/esm/clients/mocks/MockSvmSpokePoolClient.d.ts +0 -30
- package/dist/esm/clients/mocks/MockSvmSpokePoolClient.js +0 -89
- package/dist/esm/clients/mocks/MockSvmSpokePoolClient.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/providers/mocks/MockCachedSolanaRpcFactory.d.ts +0 -5
- package/dist/esm/providers/mocks/MockCachedSolanaRpcFactory.js +0 -19
- package/dist/esm/providers/mocks/MockCachedSolanaRpcFactory.js.map +0 -1
- package/dist/esm/providers/mocks/MockRateLimitedSolanaRpcFactory.d.ts +0 -5
- package/dist/esm/providers/mocks/MockRateLimitedSolanaRpcFactory.js +0 -18
- package/dist/esm/providers/mocks/MockRateLimitedSolanaRpcFactory.js.map +0 -1
- package/dist/esm/providers/mocks/MockSolanaRpcFactory.d.ts +0 -13
- package/dist/esm/providers/mocks/MockSolanaRpcFactory.js +0 -74
- package/dist/esm/providers/mocks/MockSolanaRpcFactory.js.map +0 -1
- package/dist/esm/providers/mocks/index.d.ts +0 -4
- package/dist/esm/providers/mocks/index.js +0 -5
- package/dist/esm/providers/mocks/index.js.map +0 -1
- package/dist/esm/providers/mocks/mockEthersProvider.js.map +0 -1
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -84
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js +0 -216
- package/dist/esm/relayFeeCalculator/chain-queries/svmQuery.js.map +0 -1
- package/dist/esm/utils/BlockFinder.d.ts +0 -22
- package/dist/esm/utils/BlockFinder.js +0 -7
- package/dist/esm/utils/BlockFinder.js.map +0 -1
- package/dist/types/arch/evm/BlockUtils.d.ts +0 -25
- package/dist/types/arch/evm/BlockUtils.d.ts.map +0 -1
- package/dist/types/arch/svm/SpokeUtils.d.ts +0 -130
- package/dist/types/arch/svm/SpokeUtils.d.ts.map +0 -1
- package/dist/types/arch/svm/constants.d.ts +0 -3
- package/dist/types/arch/svm/constants.d.ts.map +0 -1
- package/dist/types/arch/svm/eventsClient.d.ts +0 -88
- 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 -64
- package/dist/types/arch/svm/utils.d.ts.map +0 -1
- package/dist/types/clients/SpokePoolClient/SVMSpokePoolClient.d.ts +0 -67
- package/dist/types/clients/SpokePoolClient/SVMSpokePoolClient.d.ts.map +0 -1
- package/dist/types/clients/mocks/MockSvmCpiEventsClient.d.ts +0 -34
- package/dist/types/clients/mocks/MockSvmCpiEventsClient.d.ts.map +0 -1
- package/dist/types/clients/mocks/MockSvmSpokePoolClient.d.ts +0 -31
- package/dist/types/clients/mocks/MockSvmSpokePoolClient.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/providers/mocks/MockCachedSolanaRpcFactory.d.ts +0 -6
- package/dist/types/providers/mocks/MockCachedSolanaRpcFactory.d.ts.map +0 -1
- package/dist/types/providers/mocks/MockRateLimitedSolanaRpcFactory.d.ts +0 -6
- package/dist/types/providers/mocks/MockRateLimitedSolanaRpcFactory.d.ts.map +0 -1
- package/dist/types/providers/mocks/MockSolanaRpcFactory.d.ts +0 -14
- package/dist/types/providers/mocks/MockSolanaRpcFactory.d.ts.map +0 -1
- package/dist/types/providers/mocks/index.d.ts +0 -5
- package/dist/types/providers/mocks/index.d.ts.map +0 -1
- package/dist/types/providers/mocks/mockEthersProvider.d.ts.map +0 -1
- package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts +0 -85
- package/dist/types/relayFeeCalculator/chain-queries/svmQuery.d.ts.map +0 -1
- package/dist/types/utils/BlockFinder.d.ts +0 -23
- package/dist/types/utils/BlockFinder.d.ts.map +0 -1
- package/src/arch/evm/BlockUtils.ts +0 -209
- package/src/arch/svm/SpokeUtils.ts +0 -596
- package/src/arch/svm/constants.ts +0 -2
- package/src/arch/svm/eventsClient.ts +0 -342
- package/src/arch/svm/utils.ts +0 -233
- package/src/clients/SpokePoolClient/SVMSpokePoolClient.ts +0 -268
- package/src/clients/mocks/MockSvmCpiEventsClient.ts +0 -226
- package/src/clients/mocks/MockSvmSpokePoolClient.ts +0 -119
- package/src/gasPriceOracle/adapters/solana.ts +0 -45
- package/src/providers/mocks/MockCachedSolanaRpcFactory.ts +0 -15
- package/src/providers/mocks/MockRateLimitedSolanaRpcFactory.ts +0 -14
- package/src/providers/mocks/MockSolanaRpcFactory.ts +0 -55
- package/src/providers/mocks/index.ts +0 -4
- package/src/relayFeeCalculator/chain-queries/svmQuery.ts +0 -225
- package/src/utils/BlockFinder.ts +0 -26
- /package/dist/cjs/providers/{mocks/mockEthersProvider.d.ts → mockProvider.d.ts} +0 -0
- /package/dist/cjs/{arch/svm → svm}/types.js +0 -0
- /package/dist/esm/providers/{mocks/mockEthersProvider.d.ts → mockProvider.d.ts} +0 -0
- /package/dist/esm/{arch/svm → svm}/types.js +0 -0
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { SymbolMappingType } from "./";
|
|
2
|
-
import { Deposit } from "../../interfaces";
|
|
3
|
-
import { BigNumberish, TransactionCostEstimate, BigNumber, SvmAddress } from "../../utils";
|
|
4
|
-
import { Logger, QueryInterface } from "../relayFeeCalculator";
|
|
5
|
-
import { SVMProvider } from "../../arch/svm";
|
|
6
|
-
import { IInstruction } from "@solana/kit";
|
|
7
|
-
/**
|
|
8
|
-
* A special QueryBase implementation for SVM used for querying gas costs, token prices, and decimals of various tokens
|
|
9
|
-
* on Solana.
|
|
10
|
-
*/
|
|
11
|
-
export declare class SvmQuery implements QueryInterface {
|
|
12
|
-
readonly provider: SVMProvider;
|
|
13
|
-
readonly symbolMapping: SymbolMappingType;
|
|
14
|
-
readonly spokePoolAddress: SvmAddress;
|
|
15
|
-
readonly simulatedRelayerAddress: SvmAddress;
|
|
16
|
-
readonly logger: Logger;
|
|
17
|
-
readonly coingeckoProApiKey?: string | undefined;
|
|
18
|
-
readonly fixedGasPrice?: BigNumberish | undefined;
|
|
19
|
-
readonly coingeckoBaseCurrency: string;
|
|
20
|
-
protected computeUnitEstimator: (transactionMessage: import("@solana/kit").CompilableTransactionMessage | (import("@solana/kit").ITransactionMessageWithFeePayer<string> & import("@solana/kit").TransactionMessage), config?: Omit<Readonly<{
|
|
21
|
-
abortSignal?: AbortSignal | undefined;
|
|
22
|
-
commitment?: import("@solana/kit").Commitment | undefined;
|
|
23
|
-
minContextSlot?: bigint | undefined;
|
|
24
|
-
rpc: import("@solana/kit").Rpc<import("@solana/kit").SimulateTransactionApi>;
|
|
25
|
-
transactionMessage: import("@solana/kit").CompilableTransactionMessage | (import("@solana/kit").ITransactionMessageWithFeePayer<string> & import("@solana/kit").TransactionMessage);
|
|
26
|
-
}>, "rpc" | "transactionMessage"> | undefined) => Promise<number>;
|
|
27
|
-
/**
|
|
28
|
-
* Instantiates a SvmQuery instance
|
|
29
|
-
* @param provider A valid solana/kit rpc client.
|
|
30
|
-
* @param symbolMapping A mapping to valid ERC20 tokens and their respective characteristics
|
|
31
|
-
* @param spokePoolAddress The valid address of the Spoke Pool deployment
|
|
32
|
-
* @param simulatedRelayerAddress The address that these queries will reference as the sender. Note: This address must be approved for USDC
|
|
33
|
-
* @param logger A logging utility to report logs
|
|
34
|
-
* @param coingeckoProApiKey An optional CoinGecko API key that links to a PRO account
|
|
35
|
-
* @param fixedGasPrice Overrides the gas price with a fixed value. Note: primarily used for the Boba blockchain
|
|
36
|
-
* @param coingeckoBaseCurrency The basis currency that CoinGecko will use to resolve pricing
|
|
37
|
-
*/
|
|
38
|
-
constructor(provider: SVMProvider, symbolMapping: SymbolMappingType, spokePoolAddress: SvmAddress, simulatedRelayerAddress: SvmAddress, logger: Logger, coingeckoProApiKey?: string | undefined, fixedGasPrice?: BigNumberish | undefined, coingeckoBaseCurrency?: string);
|
|
39
|
-
/**
|
|
40
|
-
* Retrieves the current gas costs of performing a fillRelay contract at the referenced SpokePool.
|
|
41
|
-
* @param deposit V3 deposit instance.
|
|
42
|
-
* @param relayerAddress Relayer address to simulate with.
|
|
43
|
-
* @param options
|
|
44
|
-
* @param options.gasPrice Optional gas price to use for the simulation.
|
|
45
|
-
* @param options.gasUnits Optional gas units to use for the simulation.
|
|
46
|
-
* @param options.transport Optional transport object for custom gas price retrieval.
|
|
47
|
-
* @returns The gas estimate for this function call (multiplied with the optional buffer).
|
|
48
|
-
*/
|
|
49
|
-
getGasCosts(deposit: Omit<Deposit, "messageHash">, _relayer?: string, options?: Partial<{
|
|
50
|
-
gasPrice: BigNumberish;
|
|
51
|
-
gasUnits: BigNumberish;
|
|
52
|
-
baseFeeMultiplier: BigNumber;
|
|
53
|
-
priorityFeeMultiplier: BigNumber;
|
|
54
|
-
}>): Promise<TransactionCostEstimate>;
|
|
55
|
-
/**
|
|
56
|
-
* @notice Return the gas cost of a simulated transaction
|
|
57
|
-
* @param fillRelayTx FillRelay transaction
|
|
58
|
-
* @param relayer SVM address of the relayer
|
|
59
|
-
* @returns Estimated gas cost in compute units
|
|
60
|
-
*/
|
|
61
|
-
getNativeGasCost(deposit: Omit<Deposit, "messageHash">, _relayer?: string): Promise<BigNumber>;
|
|
62
|
-
/**
|
|
63
|
-
* @notice Return the fillRelay transaction for a given deposit
|
|
64
|
-
* @param deposit
|
|
65
|
-
* @param relayer SVM address of the relayer
|
|
66
|
-
* @returns FillRelay transaction
|
|
67
|
-
*/
|
|
68
|
-
getFillRelayTx(deposit: Omit<Deposit, "messageHash">, _relayer?: string): Promise<import("@solana/kit").TransactionMessageWithBlockhashLifetime & import("@solana/kit").ITransactionMessageWithFeePayer<string> & Omit<Readonly<{
|
|
69
|
-
instructions: readonly IInstruction<string, readonly (import("@solana/kit").IAccountMeta<string> | import("@solana/kit").IAccountLookupMeta<string, string>)[]>[];
|
|
70
|
-
version: 0;
|
|
71
|
-
}>, "feePayer">>;
|
|
72
|
-
/**
|
|
73
|
-
* Retrieves the current price of a token
|
|
74
|
-
* @param tokenSymbol A valid [CoinGecko-ID](https://api.coingecko.com/api/v3/coins/list)
|
|
75
|
-
* @returns The resolved token price within the specified coingeckoBaseCurrency
|
|
76
|
-
*/
|
|
77
|
-
getTokenPrice(tokenSymbol: string): Promise<number>;
|
|
78
|
-
/**
|
|
79
|
-
* Resolves the number of decimal places a token can have
|
|
80
|
-
* @param tokenSymbol A valid Across-Enabled Token ID
|
|
81
|
-
* @returns The number of decimals of precision for the corresponding tokenSymbol
|
|
82
|
-
*/
|
|
83
|
-
getTokenDecimals(tokenSymbol: string): number;
|
|
84
|
-
}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __generator } from "tslib";
|
|
2
|
-
import { pipe } from "@solana/functional";
|
|
3
|
-
import { Coingecko } from "../../coingecko";
|
|
4
|
-
import { CHAIN_IDs } from "../../constants";
|
|
5
|
-
import { getGasPriceEstimate } from "../../gasPriceOracle";
|
|
6
|
-
import { toBN, isDefined, toAddressType, } from "../../utils";
|
|
7
|
-
import { getDefaultSimulatedRelayerAddress } from "../relayFeeCalculator";
|
|
8
|
-
import { fillRelayInstruction, createApproveInstruction, createTokenAccountsInstruction, SolanaVoidSigner, getAssociatedTokenAddress, } from "../../arch/svm";
|
|
9
|
-
import { createTransactionMessage, setTransactionMessageFeePayer, setTransactionMessageLifetimeUsingBlockhash, appendTransactionMessageInstructions, getComputeUnitEstimateForTransactionMessageFactory, fetchEncodedAccount, } from "@solana/kit";
|
|
10
|
-
import { TOKEN_PROGRAM_ADDRESS, getMintSize, getInitializeMintInstruction, fetchMint } from "@solana-program/token";
|
|
11
|
-
import { getCreateAccountInstruction } from "@solana-program/system";
|
|
12
|
-
/**
|
|
13
|
-
* A special QueryBase implementation for SVM used for querying gas costs, token prices, and decimals of various tokens
|
|
14
|
-
* on Solana.
|
|
15
|
-
*/
|
|
16
|
-
var SvmQuery = /** @class */ (function () {
|
|
17
|
-
/**
|
|
18
|
-
* Instantiates a SvmQuery instance
|
|
19
|
-
* @param provider A valid solana/kit rpc client.
|
|
20
|
-
* @param symbolMapping A mapping to valid ERC20 tokens and their respective characteristics
|
|
21
|
-
* @param spokePoolAddress The valid address of the Spoke Pool deployment
|
|
22
|
-
* @param simulatedRelayerAddress The address that these queries will reference as the sender. Note: This address must be approved for USDC
|
|
23
|
-
* @param logger A logging utility to report logs
|
|
24
|
-
* @param coingeckoProApiKey An optional CoinGecko API key that links to a PRO account
|
|
25
|
-
* @param fixedGasPrice Overrides the gas price with a fixed value. Note: primarily used for the Boba blockchain
|
|
26
|
-
* @param coingeckoBaseCurrency The basis currency that CoinGecko will use to resolve pricing
|
|
27
|
-
*/
|
|
28
|
-
function SvmQuery(provider, symbolMapping, spokePoolAddress, simulatedRelayerAddress, logger, coingeckoProApiKey, fixedGasPrice, coingeckoBaseCurrency) {
|
|
29
|
-
if (coingeckoBaseCurrency === void 0) { coingeckoBaseCurrency = "eth"; }
|
|
30
|
-
this.provider = provider;
|
|
31
|
-
this.symbolMapping = symbolMapping;
|
|
32
|
-
this.spokePoolAddress = spokePoolAddress;
|
|
33
|
-
this.simulatedRelayerAddress = simulatedRelayerAddress;
|
|
34
|
-
this.logger = logger;
|
|
35
|
-
this.coingeckoProApiKey = coingeckoProApiKey;
|
|
36
|
-
this.fixedGasPrice = fixedGasPrice;
|
|
37
|
-
this.coingeckoBaseCurrency = coingeckoBaseCurrency;
|
|
38
|
-
this.computeUnitEstimator = getComputeUnitEstimateForTransactionMessageFactory({
|
|
39
|
-
rpc: provider,
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Retrieves the current gas costs of performing a fillRelay contract at the referenced SpokePool.
|
|
44
|
-
* @param deposit V3 deposit instance.
|
|
45
|
-
* @param relayerAddress Relayer address to simulate with.
|
|
46
|
-
* @param options
|
|
47
|
-
* @param options.gasPrice Optional gas price to use for the simulation.
|
|
48
|
-
* @param options.gasUnits Optional gas units to use for the simulation.
|
|
49
|
-
* @param options.transport Optional transport object for custom gas price retrieval.
|
|
50
|
-
* @returns The gas estimate for this function call (multiplied with the optional buffer).
|
|
51
|
-
*/
|
|
52
|
-
SvmQuery.prototype.getGasCosts = function (deposit, _relayer, options) {
|
|
53
|
-
if (_relayer === void 0) { _relayer = getDefaultSimulatedRelayerAddress(deposit.destinationChainId); }
|
|
54
|
-
if (options === void 0) { options = {}; }
|
|
55
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
56
|
-
var relayer, fillRelayTx, _a, computeUnitsConsumed, _gasPriceEstimate, _b, _c, _d, gasPriceEstimate, gasPrice;
|
|
57
|
-
return __generator(this, function (_e) {
|
|
58
|
-
switch (_e.label) {
|
|
59
|
-
case 0:
|
|
60
|
-
relayer = _relayer ? toAddressType(_relayer).forceSvmAddress() : this.simulatedRelayerAddress;
|
|
61
|
-
return [4 /*yield*/, this.getFillRelayTx(deposit, relayer.toBase58())];
|
|
62
|
-
case 1:
|
|
63
|
-
fillRelayTx = _e.sent();
|
|
64
|
-
_c = (_b = Promise).all;
|
|
65
|
-
_d = toBN;
|
|
66
|
-
return [4 /*yield*/, this.computeUnitEstimator(fillRelayTx)];
|
|
67
|
-
case 2: return [4 /*yield*/, _c.apply(_b, [[
|
|
68
|
-
_d.apply(void 0, [_e.sent()]),
|
|
69
|
-
getGasPriceEstimate(this.provider, {
|
|
70
|
-
unsignedTx: fillRelayTx,
|
|
71
|
-
baseFeeMultiplier: options.baseFeeMultiplier,
|
|
72
|
-
priorityFeeMultiplier: options.priorityFeeMultiplier,
|
|
73
|
-
})
|
|
74
|
-
]])];
|
|
75
|
-
case 3:
|
|
76
|
-
_a = _e.sent(), computeUnitsConsumed = _a[0], _gasPriceEstimate = _a[1];
|
|
77
|
-
gasPriceEstimate = _gasPriceEstimate;
|
|
78
|
-
gasPrice = gasPriceEstimate.baseFee.add(gasPriceEstimate.microLamportsPerComputeUnit.mul(computeUnitsConsumed).div(toBN(1000000)) // 1_000_000 microLamports/lamport.
|
|
79
|
-
);
|
|
80
|
-
return [2 /*return*/, {
|
|
81
|
-
nativeGasCost: computeUnitsConsumed,
|
|
82
|
-
tokenGasCost: gasPrice,
|
|
83
|
-
gasPrice: gasPrice,
|
|
84
|
-
}];
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* @notice Return the gas cost of a simulated transaction
|
|
91
|
-
* @param fillRelayTx FillRelay transaction
|
|
92
|
-
* @param relayer SVM address of the relayer
|
|
93
|
-
* @returns Estimated gas cost in compute units
|
|
94
|
-
*/
|
|
95
|
-
SvmQuery.prototype.getNativeGasCost = function (deposit, _relayer) {
|
|
96
|
-
if (_relayer === void 0) { _relayer = getDefaultSimulatedRelayerAddress(deposit.destinationChainId); }
|
|
97
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
-
var fillRelayTx, computeUnitsConsumed, _a;
|
|
99
|
-
return __generator(this, function (_b) {
|
|
100
|
-
switch (_b.label) {
|
|
101
|
-
case 0: return [4 /*yield*/, this.getFillRelayTx(deposit, _relayer)];
|
|
102
|
-
case 1:
|
|
103
|
-
fillRelayTx = _b.sent();
|
|
104
|
-
_a = toBN;
|
|
105
|
-
return [4 /*yield*/, this.computeUnitEstimator(fillRelayTx)];
|
|
106
|
-
case 2:
|
|
107
|
-
computeUnitsConsumed = _a.apply(void 0, [_b.sent()]);
|
|
108
|
-
return [2 /*return*/, computeUnitsConsumed];
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* @notice Return the fillRelay transaction for a given deposit
|
|
115
|
-
* @param deposit
|
|
116
|
-
* @param relayer SVM address of the relayer
|
|
117
|
-
* @returns FillRelay transaction
|
|
118
|
-
*/
|
|
119
|
-
SvmQuery.prototype.getFillRelayTx = function (deposit, _relayer) {
|
|
120
|
-
if (_relayer === void 0) { _relayer = getDefaultSimulatedRelayerAddress(deposit.destinationChainId); }
|
|
121
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
-
var relayer, mint, owner, associatedToken, simulatedSigner, recipientCreateTokenAccountInstructions, _a, associatedTokenAccountExists, mintInfo, _b, _c, space, rent, createAccountIx, initializeMintIx, _d, createTokenAccountsIx, approveIx, fillIx, recentBlockhash, fillRelayTx;
|
|
123
|
-
return __generator(this, function (_e) {
|
|
124
|
-
switch (_e.label) {
|
|
125
|
-
case 0:
|
|
126
|
-
relayer = _relayer ? toAddressType(_relayer).forceSvmAddress() : this.simulatedRelayerAddress;
|
|
127
|
-
mint = toAddressType(deposit.outputToken).forceSvmAddress();
|
|
128
|
-
owner = toAddressType(deposit.recipient).forceSvmAddress();
|
|
129
|
-
return [4 /*yield*/, getAssociatedTokenAddress(owner, mint)];
|
|
130
|
-
case 1:
|
|
131
|
-
associatedToken = _e.sent();
|
|
132
|
-
simulatedSigner = SolanaVoidSigner(relayer.toBase58());
|
|
133
|
-
recipientCreateTokenAccountInstructions = undefined;
|
|
134
|
-
_c = (_b = Promise).all;
|
|
135
|
-
return [4 /*yield*/, fetchEncodedAccount(this.provider, associatedToken)];
|
|
136
|
-
case 2: return [4 /*yield*/, _c.apply(_b, [[
|
|
137
|
-
(_e.sent()).exists,
|
|
138
|
-
fetchMint(this.provider, mint.toV2Address())
|
|
139
|
-
]])];
|
|
140
|
-
case 3:
|
|
141
|
-
_a = _e.sent(), associatedTokenAccountExists = _a[0], mintInfo = _a[1];
|
|
142
|
-
if (!!associatedTokenAccountExists) return [3 /*break*/, 5];
|
|
143
|
-
space = BigInt(getMintSize());
|
|
144
|
-
return [4 /*yield*/, this.provider.getMinimumBalanceForRentExemption(space).send()];
|
|
145
|
-
case 4:
|
|
146
|
-
rent = _e.sent();
|
|
147
|
-
createAccountIx = getCreateAccountInstruction({
|
|
148
|
-
payer: simulatedSigner,
|
|
149
|
-
newAccount: SolanaVoidSigner(mint.toBase58()),
|
|
150
|
-
lamports: rent,
|
|
151
|
-
space: space,
|
|
152
|
-
programAddress: TOKEN_PROGRAM_ADDRESS,
|
|
153
|
-
});
|
|
154
|
-
initializeMintIx = getInitializeMintInstruction({
|
|
155
|
-
mint: mint.toV2Address(),
|
|
156
|
-
decimals: mintInfo.data.decimals,
|
|
157
|
-
mintAuthority: owner.toV2Address(),
|
|
158
|
-
});
|
|
159
|
-
recipientCreateTokenAccountInstructions = [createAccountIx, initializeMintIx];
|
|
160
|
-
_e.label = 5;
|
|
161
|
-
case 5: return [4 /*yield*/, Promise.all([
|
|
162
|
-
createTokenAccountsInstruction(mint, simulatedSigner),
|
|
163
|
-
createApproveInstruction(mint, deposit.outputAmount, this.simulatedRelayerAddress, this.spokePoolAddress, mintInfo.data.decimals),
|
|
164
|
-
fillRelayInstruction(this.spokePoolAddress, deposit, simulatedSigner, associatedToken),
|
|
165
|
-
])];
|
|
166
|
-
case 6:
|
|
167
|
-
_d = _e.sent(), createTokenAccountsIx = _d[0], approveIx = _d[1], fillIx = _d[2];
|
|
168
|
-
return [4 /*yield*/, this.provider.getLatestBlockhash().send()];
|
|
169
|
-
case 7:
|
|
170
|
-
recentBlockhash = _e.sent();
|
|
171
|
-
fillRelayTx = pipe(createTransactionMessage({ version: 0 }), function (tx) { return setTransactionMessageFeePayer(relayer.toV2Address(), tx); }, function (tx) { return setTransactionMessageLifetimeUsingBlockhash(recentBlockhash.value, tx); }, function (tx) {
|
|
172
|
-
return isDefined(recipientCreateTokenAccountInstructions)
|
|
173
|
-
? appendTransactionMessageInstructions(recipientCreateTokenAccountInstructions, tx)
|
|
174
|
-
: tx;
|
|
175
|
-
}, function (tx) { return appendTransactionMessageInstructions([createTokenAccountsIx, approveIx, fillIx], tx); });
|
|
176
|
-
return [2 /*return*/, fillRelayTx];
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
};
|
|
181
|
-
/**
|
|
182
|
-
* Retrieves the current price of a token
|
|
183
|
-
* @param tokenSymbol A valid [CoinGecko-ID](https://api.coingecko.com/api/v3/coins/list)
|
|
184
|
-
* @returns The resolved token price within the specified coingeckoBaseCurrency
|
|
185
|
-
*/
|
|
186
|
-
SvmQuery.prototype.getTokenPrice = function (tokenSymbol) {
|
|
187
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
188
|
-
var coingeckoInstance, _a, price;
|
|
189
|
-
return __generator(this, function (_b) {
|
|
190
|
-
switch (_b.label) {
|
|
191
|
-
case 0:
|
|
192
|
-
if (!this.symbolMapping[tokenSymbol])
|
|
193
|
-
throw new Error("".concat(tokenSymbol, " does not exist in mapping"));
|
|
194
|
-
coingeckoInstance = Coingecko.get(this.logger, this.coingeckoProApiKey);
|
|
195
|
-
return [4 /*yield*/, coingeckoInstance.getCurrentPriceByContract(this.symbolMapping[tokenSymbol].addresses[CHAIN_IDs.MAINNET], this.coingeckoBaseCurrency)];
|
|
196
|
-
case 1:
|
|
197
|
-
_a = _b.sent(), price = _a[1];
|
|
198
|
-
return [2 /*return*/, price];
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
};
|
|
203
|
-
/**
|
|
204
|
-
* Resolves the number of decimal places a token can have
|
|
205
|
-
* @param tokenSymbol A valid Across-Enabled Token ID
|
|
206
|
-
* @returns The number of decimals of precision for the corresponding tokenSymbol
|
|
207
|
-
*/
|
|
208
|
-
SvmQuery.prototype.getTokenDecimals = function (tokenSymbol) {
|
|
209
|
-
if (!this.symbolMapping[tokenSymbol])
|
|
210
|
-
throw new Error("".concat(tokenSymbol, " does not exist in mapping"));
|
|
211
|
-
return this.symbolMapping[tokenSymbol].decimals;
|
|
212
|
-
};
|
|
213
|
-
return SvmQuery;
|
|
214
|
-
}());
|
|
215
|
-
export { SvmQuery };
|
|
216
|
-
//# sourceMappingURL=svmQuery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"svmQuery.js","sourceRoot":"","sources":["../../../../src/relayFeeCalculator/chain-queries/svmQuery.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAuB,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAKL,IAAI,EACJ,SAAS,EACT,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iCAAiC,EAA0B,MAAM,uBAAuB,CAAC;AAClG,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAE9B,gBAAgB,EAChB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,2CAA2C,EAC3C,oCAAoC,EACpC,kDAAkD,EAClD,mBAAmB,GAEpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,4BAA4B,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACpH,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAErE;;;GAGG;AACH;IAGE;;;;;;;;;;OAUG;IACH,kBACW,QAAqB,EAC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,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;4BAAE,MAAM,IAAI,KAAK,CAAC,UAAG,WAAW,+BAA4B,CAAC,CAAC;wBAC5F,iBAAiB,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;wBAC5D,qBAAM,iBAAiB,CAAC,yBAAyB,CACjE,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,EAC5D,IAAI,CAAC,qBAAqB,CAC3B,EAAA;;wBAHK,KAAY,SAGjB,EAHQ,KAAK,QAAA;wBAId,sBAAO,KAAK,EAAC;;;;KACd;IAED;;;;OAIG;IACH,mCAAgB,GAAhB,UAAiB,WAAmB;QAClC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,UAAG,WAAW,+BAA4B,CAAC,CAAC;QAClG,OAAO,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC;IAClD,CAAC;IACH,eAAC;AAAD,CAAC,AAxLD,IAwLC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type BlockFinderOpts = {
|
|
2
|
-
highBlock?: number;
|
|
3
|
-
highBlockOffset?: number;
|
|
4
|
-
blockRange?: number;
|
|
5
|
-
};
|
|
6
|
-
export type BlockTimeAverage = {
|
|
7
|
-
average: number;
|
|
8
|
-
blockRange: number;
|
|
9
|
-
timestamp: number;
|
|
10
|
-
};
|
|
11
|
-
export interface Block {
|
|
12
|
-
hash: string;
|
|
13
|
-
number: number;
|
|
14
|
-
timestamp: number;
|
|
15
|
-
}
|
|
16
|
-
export type BlockFinderHints = {
|
|
17
|
-
lowBlock?: number;
|
|
18
|
-
highBlock?: number;
|
|
19
|
-
};
|
|
20
|
-
export declare abstract class BlockFinder<TBlock extends Block> {
|
|
21
|
-
abstract getBlockForTimestamp(timestamp: number | string, hints: BlockFinderHints): Promise<TBlock>;
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BlockFinder.js","sourceRoot":"","sources":["../../../src/utils/BlockFinder.ts"],"names":[],"mappings":"AAuBA;IAAA;IAEA,CAAC;IAAD,kBAAC;AAAD,CAAC,AAFD,IAEC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Provider, Block as EthersBlock } from "@ethersproject/abstract-provider";
|
|
2
|
-
import { BlockFinder, type Block, type BlockFinderOpts as Opts, type BlockTimeAverage, type BlockFinderHints } from "../../utils/BlockFinder";
|
|
3
|
-
interface EVMBlock extends Block, EthersBlock {
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* @description Compute the average block time over a block range.
|
|
7
|
-
* @returns Average number of seconds per block.
|
|
8
|
-
*/
|
|
9
|
-
export declare function averageBlockTime(provider: Provider, { highBlock, highBlockOffset, blockRange }?: Opts): Promise<Pick<BlockTimeAverage, "average" | "blockRange">>;
|
|
10
|
-
export declare class EVMBlockFinder extends BlockFinder<EVMBlock> {
|
|
11
|
-
private readonly provider;
|
|
12
|
-
private readonly blocks;
|
|
13
|
-
constructor(provider: Provider, blocks?: EVMBlock[]);
|
|
14
|
-
/**
|
|
15
|
-
* @notice Gets the latest block whose timestamp is <= the provided timestamp.
|
|
16
|
-
* @param number Timestamp timestamp to search.
|
|
17
|
-
* @param hints Optional low and high block to bound the search space.
|
|
18
|
-
*/
|
|
19
|
-
getBlockForTimestamp(timestamp: number | string, hints?: BlockFinderHints): Promise<EVMBlock>;
|
|
20
|
-
private getLatestBlock;
|
|
21
|
-
private getBlock;
|
|
22
|
-
private findBlock;
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
25
|
-
//# sourceMappingURL=BlockUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BlockUtils.d.ts","sourceRoot":"","sources":["../../../../src/arch/evm/BlockUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAIlF,OAAO,EACL,WAAW,EACX,KAAK,KAAK,EACV,KAAK,eAAe,IAAI,IAAI,EAC5B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACtB,MAAM,yBAAyB,CAAC;AAKjC,UAAU,QAAS,SAAQ,KAAK,EAAE,WAAW;CAAG;AAuBhD;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,QAAQ,EAClB,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,GAAE,IAAS,GACpD,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,YAAY,CAAC,CAAC,CAqC3D;AAQD,qBAAa,cAAe,SAAQ,WAAW,CAAC,QAAQ,CAAC;IAErD,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBADN,QAAQ,EAAE,QAAQ,EAClB,MAAM,GAAE,QAAQ,EAAO;IAK1C;;;;OAIG;IACU,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,GAAE,gBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC;YA+ChG,cAAc;YAQd,QAAQ;YAiBR,SAAS;CAgCxB"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { SvmSpokeClient } from "@across-protocol/contracts";
|
|
2
|
-
import { Address, type TransactionSigner } from "@solana/kit";
|
|
3
|
-
import { Logger } from "winston";
|
|
4
|
-
import { Deposit, DepositWithBlock, FillStatus, FillWithBlock, RelayData } from "../../interfaces";
|
|
5
|
-
import { BigNumber, SvmAddress } from "../../utils";
|
|
6
|
-
import { SvmCpiEventsClient } from "./";
|
|
7
|
-
import { SVMProvider } from "./types";
|
|
8
|
-
/**
|
|
9
|
-
* @note: Average Solana slot duration is about 400-500ms. We can be conservative
|
|
10
|
-
* and choose 400 to ensure that the most slots get included in our ranges
|
|
11
|
-
*/
|
|
12
|
-
export declare const SLOT_DURATION_MS = 400;
|
|
13
|
-
/**
|
|
14
|
-
* @param spokePool SpokePool Contract instance.
|
|
15
|
-
* @param deposit V3Deopsit instance.
|
|
16
|
-
* @param repaymentChainId Optional repaymentChainId (defaults to destinationChainId).
|
|
17
|
-
* @returns An Ethers UnsignedTransaction instance.
|
|
18
|
-
*/
|
|
19
|
-
export declare function populateV3Relay(_spokePool: unknown, _deposit: Omit<Deposit, "messageHash">, _relayer: string, _repaymentChainId?: number): Promise<unknown>;
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves the chain time at a particular slot.
|
|
22
|
-
*/
|
|
23
|
-
export declare function getTimestampForSlot(provider: SVMProvider, slotNumber: number): Promise<number>;
|
|
24
|
-
/**
|
|
25
|
-
* Returns the current fill deadline buffer.
|
|
26
|
-
* @param provider SVM Provider instance
|
|
27
|
-
* @param statePda Spoke Pool's State PDA
|
|
28
|
-
* @returns fill deadline buffer
|
|
29
|
-
*/
|
|
30
|
-
export declare function getFillDeadline(provider: SVMProvider, statePda: Address): Promise<number>;
|
|
31
|
-
/**
|
|
32
|
-
* Finds the deposit id at a specific block number.
|
|
33
|
-
* @param blockTag The block number to search for the deposit ID at.
|
|
34
|
-
* @returns The deposit ID.
|
|
35
|
-
*/
|
|
36
|
-
export declare function getDepositIdAtBlock(_contract: unknown, _blockTag: number): Promise<BigNumber>;
|
|
37
|
-
/**
|
|
38
|
-
* Finds deposit events within a 2-day window ending at the specified slot.
|
|
39
|
-
*
|
|
40
|
-
* @remarks
|
|
41
|
-
* This implementation uses a slot-limited search approach because Solana PDA state has
|
|
42
|
-
* limitations that prevent directly referencing old deposit IDs. Unlike EVM chains where
|
|
43
|
-
* we might use binary search across the entire chain history, in Solana we must query within
|
|
44
|
-
* a constrained slot range.
|
|
45
|
-
*
|
|
46
|
-
* The search window is calculated by:
|
|
47
|
-
* 1. Using the provided slot (or current confirmed slot if none is provided)
|
|
48
|
-
* 2. Looking back 2 days worth of slots from that point
|
|
49
|
-
*
|
|
50
|
-
* We use a 2-day window because:
|
|
51
|
-
* 1. Most valid deposits that need to be processed will be recent
|
|
52
|
-
* 2. This covers multiple bundle submission periods
|
|
53
|
-
* 3. It balances performance with practical deposit age
|
|
54
|
-
*
|
|
55
|
-
* @important
|
|
56
|
-
* This function may return `undefined` for valid deposit IDs that are older than the search
|
|
57
|
-
* window (approximately 2 days before the specified slot). This is an acceptable limitation
|
|
58
|
-
* as deposits this old are typically not relevant to current operations.
|
|
59
|
-
*
|
|
60
|
-
* @param eventClient - SvmCpiEventsClient instance
|
|
61
|
-
* @param depositId - The deposit ID to search for
|
|
62
|
-
* @param slot - The slot to search up to (defaults to current slot). The search will look
|
|
63
|
-
* for deposits between (slot - secondsLookback) and slot.
|
|
64
|
-
* @param secondsLookback - The number of seconds to look back for deposits (defaults to 2 days).
|
|
65
|
-
* @returns The deposit if found within the slot window, undefined otherwise
|
|
66
|
-
*/
|
|
67
|
-
export declare function findDeposit(eventClient: SvmCpiEventsClient, depositId: BigNumber, slot?: bigint, secondsLookback?: number): Promise<DepositWithBlock | undefined>;
|
|
68
|
-
/**
|
|
69
|
-
* Resolves the fill status of a deposit at a specific slot or at the current confirmed one.
|
|
70
|
-
*
|
|
71
|
-
* If no slot is provided, attempts to solve the fill status using the PDA. Otherwise, it is reconstructed from PDA events.
|
|
72
|
-
*
|
|
73
|
-
* @param programId - The spoke pool program ID.
|
|
74
|
-
* @param relayData - Deposit information used to locate the fill status.
|
|
75
|
-
* @param destinationChainId - Destination chain ID (must be an SVM chain).
|
|
76
|
-
* @param provider - SVM provider instance.
|
|
77
|
-
* @param svmEventsClient - SVM events client for querying events.
|
|
78
|
-
* @param atHeight - (Optional) Specific slot number to query. Defaults to the latest confirmed slot.
|
|
79
|
-
* @returns The fill status for the deposit at the specified or current slot.
|
|
80
|
-
*/
|
|
81
|
-
export declare function relayFillStatus(programId: Address, relayData: RelayData, destinationChainId: number, svmEventsClient: SvmCpiEventsClient, atHeight?: number): Promise<FillStatus>;
|
|
82
|
-
/**
|
|
83
|
-
* Resolves fill statuses for multiple deposits at a specific or latest confirmed slot,
|
|
84
|
-
* using PDAs when possible and falling back to events if needed.
|
|
85
|
-
*
|
|
86
|
-
* @param programId The spoke pool program ID.
|
|
87
|
-
* @param relayData An array of relay data to resolve fill statuses for.
|
|
88
|
-
* @param destinationChainId The destination chain ID (must be an SVM chain).
|
|
89
|
-
* @param provider SVM Provider instance.
|
|
90
|
-
* @param svmEventsClient SVM events client instance for querying events.
|
|
91
|
-
* @param atHeight (Optional) The slot number to query at. If omitted, queries the latest confirmed slot.
|
|
92
|
-
* @returns An array of fill statuses for the specified deposits at the requested slot (or at the current confirmed slot).
|
|
93
|
-
*/
|
|
94
|
-
export declare function fillStatusArray(programId: Address, relayData: RelayData[], destinationChainId: number, svmEventsClient: SvmCpiEventsClient, atHeight?: number, logger?: Logger): Promise<(FillStatus | undefined)[]>;
|
|
95
|
-
/**
|
|
96
|
-
* Finds the `FilledRelay` event for a given deposit within the provided slot range.
|
|
97
|
-
*
|
|
98
|
-
* @param relayData - Deposit information that is used to complete a fill.
|
|
99
|
-
* @param destinationChainId - Destination chain ID (must be an SVM chain).
|
|
100
|
-
* @param svmEventsClient - SVM events client instance for querying events.
|
|
101
|
-
* @param fromSlot - Starting slot to search.
|
|
102
|
-
* @param toSlot (Optional) Ending slot to search. If not provided, the current confirmed slot will be used.
|
|
103
|
-
* @returns The fill event with block info, or `undefined` if not found.
|
|
104
|
-
*/
|
|
105
|
-
export declare function findFillEvent(relayData: RelayData, destinationChainId: number, svmEventsClient: SvmCpiEventsClient, fromSlot: number, toSlot?: number): Promise<FillWithBlock | undefined>;
|
|
106
|
-
/**
|
|
107
|
-
* @param spokePool Address (program ID) of the SvmSpoke.
|
|
108
|
-
* @param deposit V3Deopsit instance.
|
|
109
|
-
* @param relayer Address of the relayer filling the deposit.
|
|
110
|
-
* @param repaymentChainId Optional repaymentChainId (defaults to destinationChainId).
|
|
111
|
-
* @returns An Ethers UnsignedTransaction instance.
|
|
112
|
-
*/
|
|
113
|
-
export declare function fillRelayInstruction(spokePool: SvmAddress, deposit: Omit<Deposit, "messageHash">, relayer: TransactionSigner<string>, recipientTokenAccount: Address<string>, repaymentChainId?: number): Promise<SvmSpokeClient.FillRelayInstruction<Address<"JAZWcGrpSWNPTBj8QtJ9UyQqhJCDhG9GJkDeMf5NQBiq">, string, string, string, string, string, string, string, string, string, string, string, string, []>>;
|
|
114
|
-
/**
|
|
115
|
-
* @param mint Address of the token corresponding to the account being made.
|
|
116
|
-
* @param relayer Address of the relayer filling the deposit.
|
|
117
|
-
* @returns An instruction for creating a new token account.
|
|
118
|
-
*/
|
|
119
|
-
export declare function createTokenAccountsInstruction(mint: SvmAddress, relayer: TransactionSigner<string>): SvmSpokeClient.CreateTokenAccountsInstruction;
|
|
120
|
-
/**
|
|
121
|
-
* @param mint Address of the token corresponding to the account being made.
|
|
122
|
-
* @param amount Amount of the token to approve.
|
|
123
|
-
* @param relayer Address of the relayer filling the deposit.
|
|
124
|
-
* @param spokePool Address (program ID) of the SvmSpoke.
|
|
125
|
-
* @returns A token approval instruction.
|
|
126
|
-
*/
|
|
127
|
-
export declare function createApproveInstruction(mint: SvmAddress, amount: BigNumber, relayer: SvmAddress, spokePool: SvmAddress, mintDecimals?: number): Promise<import("@solana-program/token").ApproveCheckedInstruction<Address<"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA">, string, string, string, string, []>>;
|
|
128
|
-
export declare function getAssociatedTokenAddress(owner: SvmAddress, mint: SvmAddress, tokenProgramId?: Address<string>): Promise<Address<string>>;
|
|
129
|
-
export declare function getRelayDataHash(relayData: RelayData, destinationChainId: number): string;
|
|
130
|
-
//# sourceMappingURL=SpokeUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SpokeUtils.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/SpokeUt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AS,EACjB,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,UAAU,EACrB,YAAY,CAAC,EAAE,MAAM,kKAsBtB;AAED,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,UAAU,EAChB,cAAc,GAAE,OAAO,CAAC,MAAM,CAAyB,GACtD,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAU1B;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,GAAG,MAAM,CAuBzF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,IAAI,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACvF,eAAO,MAAM,cAAc,QAAY,CAAC"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Idl } from "@coral-xyz/anchor";
|
|
2
|
-
import { Address, Commitment, GetSignaturesForAddressApi, Signature } from "@solana/kit";
|
|
3
|
-
import { EventName, EventWithData, SVMProvider } from "./types";
|
|
4
|
-
import { DepositWithTime, FillWithTime } from "../../interfaces";
|
|
5
|
-
type GetSignaturesForAddressConfig = Parameters<GetSignaturesForAddressApi["getSignaturesForAddress"]>[1];
|
|
6
|
-
export type DepositEventFromSignature = Omit<DepositWithTime, "fromLiteChain" | "toLiteChain">;
|
|
7
|
-
export type FillEventFromSignature = FillWithTime;
|
|
8
|
-
export declare class SvmCpiEventsClient {
|
|
9
|
-
private rpc;
|
|
10
|
-
private programAddress;
|
|
11
|
-
private programEventAuthority;
|
|
12
|
-
private idl;
|
|
13
|
-
/**
|
|
14
|
-
* Protected constructor. Use the async create() method to instantiate.
|
|
15
|
-
*/
|
|
16
|
-
protected constructor(rpc: SVMProvider, address: Address, eventAuthority: Address, idl: Idl);
|
|
17
|
-
/**
|
|
18
|
-
* Factory method to asynchronously create an instance of SvmSpokeEventsClient.
|
|
19
|
-
*/
|
|
20
|
-
static create(rpc: SVMProvider): Promise<SvmCpiEventsClient>;
|
|
21
|
-
static createFor(rpc: SVMProvider, programId: string, idl: Idl): Promise<SvmCpiEventsClient>;
|
|
22
|
-
/**
|
|
23
|
-
* Queries events for the SvmSpoke program filtered by event name.
|
|
24
|
-
*
|
|
25
|
-
* @param eventName - The name of the event to filter by.
|
|
26
|
-
* @param fromSlot - Optional starting slot.
|
|
27
|
-
* @param toSlot - Optional ending slot.
|
|
28
|
-
* @param options - Options for fetching signatures.
|
|
29
|
-
* @returns A promise that resolves to an array of events matching the eventName.
|
|
30
|
-
*/
|
|
31
|
-
queryEvents(eventName: EventName, fromSlot?: bigint, toSlot?: bigint, options?: GetSignaturesForAddressConfig): Promise<EventWithData[]>;
|
|
32
|
-
/**
|
|
33
|
-
* Queries events for the provided derived address at instantiation filtered by event name.
|
|
34
|
-
*
|
|
35
|
-
* @param eventName - The name of the event to filter by.
|
|
36
|
-
* @param fromSlot - Optional starting slot.
|
|
37
|
-
* @param toSlot - Optional ending slot.
|
|
38
|
-
* @param options - Options for fetching signatures.
|
|
39
|
-
* @returns A promise that resolves to an array of events matching the eventName.
|
|
40
|
-
*/
|
|
41
|
-
queryDerivedAddressEvents(eventName: string, derivedAddress: Address, fromSlot?: bigint, toSlot?: bigint, options?: GetSignaturesForAddressConfig): Promise<EventWithData[]>;
|
|
42
|
-
/**
|
|
43
|
-
* Queries all events for a specific program.
|
|
44
|
-
*
|
|
45
|
-
* @param fromSlot - Optional starting slot.
|
|
46
|
-
* @param toSlot - Optional ending slot.
|
|
47
|
-
* @param options - Options for fetching signatures.
|
|
48
|
-
* @param forDerivedAddress - Whether to query events for the program or the derived address.
|
|
49
|
-
* @returns A promise that resolves to an array of all events with additional metadata.
|
|
50
|
-
*/
|
|
51
|
-
private queryAllEvents;
|
|
52
|
-
/**
|
|
53
|
-
* Reads events from a transaction signature.
|
|
54
|
-
*
|
|
55
|
-
* @param txSignature - The transaction signature.
|
|
56
|
-
* @param commitment - Commitment level.
|
|
57
|
-
* @returns A promise that resolves to an array of events.
|
|
58
|
-
*/
|
|
59
|
-
private readEventsFromSignature;
|
|
60
|
-
/**
|
|
61
|
-
* Processes events from a transaction.
|
|
62
|
-
*
|
|
63
|
-
* @param txResult - The transaction result.
|
|
64
|
-
* @returns A promise that resolves to an array of events with their data and name.
|
|
65
|
-
*/
|
|
66
|
-
private processEventFromTx;
|
|
67
|
-
/**
|
|
68
|
-
* Finds all FundsDeposited events for a given transaction signature.
|
|
69
|
-
*
|
|
70
|
-
* @param originChainId - The chain ID where the deposit originated.
|
|
71
|
-
* @param txSignature - The transaction signature to search for events.
|
|
72
|
-
* @param commitment - Optional commitment level for the transaction query.
|
|
73
|
-
* @returns A promise that resolves to an array of deposit events for the transaction, or undefined if none found.
|
|
74
|
-
*/
|
|
75
|
-
getDepositEventsFromSignature(originChainId: number, txSignature: Signature, commitment?: Commitment): Promise<DepositEventFromSignature[] | undefined>;
|
|
76
|
-
/**
|
|
77
|
-
* Finds all FilledRelay events for a given transaction signature.
|
|
78
|
-
*
|
|
79
|
-
* @param destinationChainId - The destination chain ID (must be an SVM chain).
|
|
80
|
-
* @param txSignature - The transaction signature to search for events.
|
|
81
|
-
* @returns A promise that resolves to an array of fill events for the transaction, or undefined if none found.
|
|
82
|
-
*/
|
|
83
|
-
getFillEventsFromSignature(destinationChainId: number, txSignature: Signature, commitment?: Commitment): Promise<FillEventFromSignature[] | undefined>;
|
|
84
|
-
getProgramAddress(): Address;
|
|
85
|
-
getRpc(): SVMProvider;
|
|
86
|
-
}
|
|
87
|
-
export {};
|
|
88
|
-
//# sourceMappingURL=eventsClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eventsClient.d.ts","sourceRoot":"","sources":["../../../../src/arch/svm/eventsClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CA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