DipDupClient
public class DipDupClient
This client exposes functions to allow communication to the indexer platform DipDup ( https://dipdup.net/ ). DipDup is composed of many small, dedicated indexers, powered by GraphQL. This client tries to exposes userflow functions, allowing users to accomplish tasks without having to worry about the underlying complexities
-
Max enteries to return per request
Declaration
Swift
public static let dexMaxQuerySize: Int
-
Init a
DipDupClientwith aNetworkServiceand aTezosNodeClientConfig.Declaration
Swift
public init(networkService: NetworkService, config: TezosNodeClientConfig)Parameters
networkServiceNetworkServiceused to manage network communication.configTezosNodeClientConfigused to apss in settings.
-
Get a list of all the tokens available and on what excahnges (including their prices and pool data)
Declaration
Swift
public func getExchangesAndTokens(limit: Int = DipDupClient.dexMaxQuerySize, offset: Int = 0, completion: @escaping ((Result<GraphQLResponse<DipDupExchangesAndTokensResponse>, KukaiError>) -> Void))Parameters
limitInt, How many results to reuturn 100 Max)
offsetInt, How many positions to move the cursor
completionBlock returning a GraphQL response or an KukaiError
-
Recurrsively call
getExchangesAndTokens(...)until we have found all the tokensDeclaration
Swift
public func getAllExchangesAndTokens(completion: @escaping ((Result<[DipDupExchangesAndTokens], KukaiError>) -> Void))Parameters
completionBlock returning a GraphQL response or an KukaiError
-
Query a given addresses liquidity token balances
Declaration
Swift
public func getLiquidityFor(address: String, completion: @escaping ((Result<GraphQLResponse<DipDupPosition>, KukaiError>) -> Void))Parameters
addressThe TZ address to query for
completionBlock returning a GraphQL response or an KukaiError
-
Query a given contract address for pricing data for the given token
Declaration
Swift
public func getChartDataFor(exchangeContract: String, nowDate: Date = Date(), completion: @escaping ((Result<GraphQLResponse<DipDupChartData>, KukaiError>) -> Void))Parameters
exchangeContractThe KT address of the dex contract to query data for
completionBlock returning a GraphQL response or an KukaiError
Install in Dash