Skip to main content

Intermediary

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:48

Represents an intermediary (liquidity provider)

Constructors

Constructor

new Intermediary(
url,
addresses,
services,
reputation): Intermediary;

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:98

Parameters

ParameterType
urlstring
addresses{ [chainIdentifier: string]: string; }
servicesServicesType
reputation{ [chainIdentifier: string]: SingleChainReputationType; }

Returns

Intermediary

Properties

addresses

readonly addresses: object;

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:57

Addresses of the intermediary on smart chains, used for checking the provided signatures

Index Signature

[chainIdentifier: string]: string

liquidity

liquidity: object = {};

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:90

Liquidity of the intermediary across different smart chains, this is only fetched on-demand when creating a swap where intermediary's liquidity is checked

Index Signature

[chainIdentifier: string]: SCLiquidity

lnData?

optional lnData: LNNodeLiquidity;

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:96

Data about a lightning network node used by this intermediary, if it offers lightning network swaps, this is only fetched on-demand when creating a Bitcoin Lightning -> Smart chain swap through the intermediary (which necessitates checking intermediary's channel capacities)


reputation

reputation: object = {};

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:85

Reputation of the intermediary on different smart chains, this is only fetched on-demand when creating a swap where reputation is checked

Index Signature

[chainIdentifier: string]: SingleChainReputationType

services

readonly services: ServicesType;

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:61

Swap protocol services offered by the intermediary


swapBounds

readonly swapBounds: object;

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:65

Input/output swap bounds for various swap protocols offered by the intermediary

0?

optional 0: object;
Index Signature
[chainIdentifier: string]: object

1?

optional 1: object;
Index Signature
[chainIdentifier: string]: object

2?

optional 2: object;
Index Signature
[chainIdentifier: string]: object

3?

optional 3: object;
Index Signature
[chainIdentifier: string]: object

4?

optional 4: object;
Index Signature
[chainIdentifier: string]: object

5?

optional 5: object;
Index Signature
[chainIdentifier: string]: object

6?

optional 6: object;
Index Signature
[chainIdentifier: string]: object

7?

optional 7: object;
Index Signature
[chainIdentifier: string]: object

url

readonly url: string;

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:53

Base URL where the intermediary is listening for HTTP requests

Methods

getAddress()

getAddress(chainIdentifier): string;

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:246

Returns intermediary's address on a given smart chain

Parameters

ParameterTypeDescription
chainIdentifierstringChain identifier of the smart chain

Returns

string


getLiquidity()

getLiquidity(
chainIdentifier,
swapContract,
token,
abortSignal?): Promise<bigint>;

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:213

Fetches, returns and saves the liquidity of the intermediary for a specific token

Parameters

ParameterTypeDescription
chainIdentifierstringChain identifier of the chain on which to fetch the reputation
swapContractSwapContract<any>Swap contract for the requested smart chain
tokenstringToken address of the token to fetch the liquidity for
abortSignal?AbortSignal

Returns

Promise<bigint>


getReputation()

getReputation(
chainIdentifier,
swapContract,
tokens?,
abortSignal?): Promise<SingleChainReputationType>;

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:172

Fetches, returns and saves the reputation of the intermediary, either for all or just for a single token

Parameters

ParameterTypeDescription
chainIdentifierstringChain identifier of the chain on which to fetch the reputation
swapContractSwapContract<any>Swap contract for the requested smart chain
tokens?string[]An optional array of tokens to fetch the data for (by default it uses all tokens supported by the intermediary)
abortSignal?AbortSignal

Returns

Promise<SingleChainReputationType>


getSwapLimits()

getSwapLimits(
swapType,
chainId,
tokenAddress): object;

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:135

Returns the input/output swap limit for given swap type, chain and token

Parameters

ParameterTypeDescription
swapTypeSwapTypeSwap protocol service to check
chainIdstringChain identifier of the smart chain to check
tokenAddressstringAddress of the token to check

Returns

object

NameTypeDefined in
inputobjectatomiq-sdk/src/intermediaries/Intermediary.ts:135
input.max?bigintatomiq-sdk/src/intermediaries/Intermediary.ts:135
input.min?bigintatomiq-sdk/src/intermediaries/Intermediary.ts:135
outputobjectatomiq-sdk/src/intermediaries/Intermediary.ts:135
output.max?bigintatomiq-sdk/src/intermediaries/Intermediary.ts:135
output.min?bigintatomiq-sdk/src/intermediaries/Intermediary.ts:135

supportsChain()

supportsChain(chainIdentifier): boolean;

Defined in: atomiq-sdk/src/intermediaries/Intermediary.ts:236

Checks whether the intermediary supports swaps of any tokens on the smart chain

Parameters

ParameterTypeDescription
chainIdentifierstringChain identifier of the smart chain

Returns

boolean