Skip to main content

SwapperFactory<T>

Defined in: atomiq-sdk/src/swapper/SwapperFactory.ts:181

Factory class for creating and initializing Swapper instances with typed chain support

Type Parameters​

Type Parameter
T extends readonly ChainInitializer<any, ChainType, any>[]

Constructors​

Constructor​

new SwapperFactory<T>(initializers): SwapperFactory<T>;

Defined in: atomiq-sdk/src/swapper/SwapperFactory.ts:196

Parameters​

ParameterType
initializersT

Returns​

SwapperFactory<T>

Properties​

initializers​

readonly initializers: T;

Defined in: atomiq-sdk/src/swapper/SwapperFactory.ts:196


TokenResolver​

TokenResolver: TypedTokenResolvers<T>;

Defined in: atomiq-sdk/src/swapper/SwapperFactory.ts:192

Token resolvers for various smart chains supported by the SDK, allow fetching tokens based on their addresses


Tokens​

Tokens: TypedTokens<T>;

Defined in: atomiq-sdk/src/swapper/SwapperFactory.ts:186

All available tokens for the atomiq SDK

Methods​

newSwapper()​

newSwapper(options): TypedSwapper<T>;

Defined in: atomiq-sdk/src/swapper/SwapperFactory.ts:234

Returns a new swapper instance with the passed options.

The swapper returned here is not yet initialized, be sure to call Swapper.init, before calling any other functions in the swapper instance.

Parameters​

ParameterTypeDescription
optionsTypedSwapperOptions<T>Options for customizing the swapper instance

Returns​

TypedSwapper<T>


newSwapperInitialized()​

newSwapperInitialized(options): Promise<TypedSwapper<T>>;

Defined in: atomiq-sdk/src/swapper/SwapperFactory.ts:301

Returns a new and already initialized swapper instance with the passed options. There is no need to call Swapper.init anymore.

Parameters​

ParameterTypeDescription
optionsTypedSwapperOptions<T>Options for customizing the swapper instance

Returns​

Promise<TypedSwapper<T>>