Initializes a new instance of the PairProvider.
Private
_cachePrivate
_cachePrivate
_networkOptional
getReturns pairs wether from backend or blockchain If the network is testnet or public and shouldUseBackend is true, it will try to fetch from the backend first, and if it fails, it will fetch from the blockchain If the network is standalone or futurenet, it will fetch from the blockchain
The address of the first token in the pair.
The address of the second token in the pair.
The address of the factory contract.
The Soroban context to use for the contract invocation.
(Optional) The protocols to fetch pairs for, defaulting to SOROSWAP.
A promise that resolves to an array of Pair instances representing the pair fetched from the backend or blockchain, or null in case of an error.
Fetches a pair from the blockchain, caching it to reduce API calls. If cached pair is still valid, returns it instead of fetching anew.
The address of the first token in the pair.
The address of the second token in the pair.
The address of the factory contract.
The Soroban context to use for the contract invocation.
A promise that resolves to an array of Pair instances representing the pair fetched from the blockchain, or null in case of an error.
Provides functionality to fetch and cache pairs from a backend API, based on the specified blockchain network.