Skip to main content

Class: ChromaticRouter

Represents the ChromaticRouter, which is used to interact with ChromaticRouter contracts.

Constructors

constructor

new ChromaticRouter(_client)

Creates an instance of ChromaticRouter.

Parameters

NameTypeDescription
_clientClientThe Client instance used to connect to the Chromatic contracts.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:60

Methods

addLiquidities

addLiquidities(marketAddress, params, recipient?): Promise<ContractTransactionReceipt>

Adds multiple liquidity positions to the specified market.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
paramsRouterAddLiquidityParam[]The array of parameters for adding liquidity.
recipient?stringThe recipient address for the liquidity tokens.

Returns

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the liquidity additions.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:221


addLiquidity

addLiquidity(marketAddress, param, recipient?): Promise<ContractTransactionReceipt>

Adds liquidity to the specified market.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
paramRouterAddLiquidityParamThe parameters for adding liquidity.
recipient?stringThe recipient address for the liquidity tokens.

Returns

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the liquidity addition.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:191


approvalClbTokenToRouter

approvalClbTokenToRouter(marketAddress): Promise<boolean>

Approves the CLB token for the ChromaticRouter contract.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.

Returns

Promise<boolean>

A promise that resolves to a boolean indicating whether the approval was successful.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:145


approvalSettlementTokenToRouter

approvalSettlementTokenToRouter(marketAddress, amount): Promise<boolean>

Approves the settlement token for the ChromaticRouter contract.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
amountbigintThe allowance of Chromatic Router over the caller's tokens

Returns

Promise<boolean>

A promise that resolves to a boolean indicating whether the approval was successful.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:168


claimLiquidites

claimLiquidites(marketAddress, receiptIds): Promise<ContractTransactionReceipt>

Claims multiple liquidity positions from the specified market.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
receiptIdsBigNumberish[]The array of IDs of the liquidity positions to claim.

Returns

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the liquidity positions claiming.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:359


claimLiquidity

claimLiquidity(marketAddress, receiptId): Promise<ContractTransactionReceipt>

Claims a liquidity position from the specified market.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
receiptIdBigNumberishThe ID of the liquidity position to claim.

Returns

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the liquidity position claiming.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:338


claimPosition

claimPosition(marketAddress, positionId): Promise<ContractTransactionReceipt>

Claims a position in the specified market.

Parameters

NameTypeDescription
marketAddressstring-
positionIdBigNumberishThe ID of the position to claim.

Returns

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the position claiming.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:127


closePosition

closePosition(marketAddress, positionId): Promise<ContractTransactionReceipt>

Closes an existing position in the specified market.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
positionIdBigNumberishThe ID of the position to close.

Returns

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the position closing.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:108


contracts

contracts(): Object

Retrieves the ChromaticRouter contract instance.

Returns

Object

A contract instance for the ChromaticRouter.

NameType
router(signerOrProvider?: Provider | Signer) => ChromaticRouter

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:66


openPosition

openPosition(marketAddress, param): Promise<ContractTransactionReceipt>

Opens a new position in the specified market.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
paramRouterOpenPositionParamThe parameters for opening the position.

Returns

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the position opening.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:83


removeLiquidities

removeLiquidities(marketAddress, params, recipient?): Promise<ContractTransactionReceipt>

Removes multiple liquidity positions from the specified market.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
paramsRouterRemoveLiquidityParam[]The array of parameters for removing liquidity.
recipient?stringThe recipient address for the liquidity tokens.

Returns

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the liquidity removals.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:291


removeLiquidity

removeLiquidity(marketAddress, param): Promise<ContractTransactionReceipt>

Removes liquidity from the specified market.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
paramRouterRemoveLiquidityParamThe parameters for removing liquidity.

Returns

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the liquidity removal.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:260


withdrawLiquidities

withdrawLiquidities(marketAddress, receiptIds): Promise<ContractTransactionReceipt>

Withdraws multiple liquidity positions from the specified market.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
receiptIdsBigNumberish[]The array of IDs of the liquidity positions to withdraw.

Returns

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the liquidity positions withdrawal.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:401


withdrawLiquidity

withdrawLiquidity(marketAddress, receiptId): Promise<ContractTransactionReceipt>

Withdraws a liquidity position from the specified market.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
receiptIdBigNumberishThe ID of the liquidity position to withdraw.

Returns

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the liquidity position withdrawal.

Defined in

packages/sdk-ethers-v6/src/entities/ChromaticRouter.ts:380