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-v5/src/entities/ChromaticRouter.ts:61

Methods

addLiquidities

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

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<ContractReceipt>

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:231


addLiquidity

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

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<ContractReceipt>

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:201


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-v5/src/entities/ChromaticRouter.ts:151


approvalSettlementTokenToRouter

approvalSettlementTokenToRouter(marketAddress, amount): Promise<boolean>

Approves the settlement token for the ChromaticRouter contract.

Parameters

NameTypeDescription
marketAddressstringThe address of the Chromatic Market contract.
amountBigNumberishThe 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-v5/src/entities/ChromaticRouter.ts:174


claimLiquidites

claimLiquidites(marketAddress, receiptIds): Promise<ContractReceipt>

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<ContractReceipt>

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:365


claimLiquidity

claimLiquidity(marketAddress, receiptId): Promise<ContractReceipt>

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<ContractReceipt>

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:345


claimPosition

claimPosition(marketAddress, positionId): Promise<ContractReceipt>

Claims a position in the specified market.

Parameters

NameTypeDescription
marketAddressstring-
positionIdBigNumberishThe ID of the position to claim.

Returns

Promise<ContractReceipt>

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:132


closePosition

closePosition(marketAddress, positionId): Promise<ContractReceipt>

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<ContractReceipt>

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:112


contracts

contracts(): Object

Retrieves the ChromaticRouter contract instance.

Returns

Object

A contract instance for the ChromaticRouter.

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:67


openPosition

openPosition(marketAddress, param): Promise<ContractReceipt>

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<ContractReceipt>

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:84


removeLiquidities

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

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<ContractReceipt>

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:299


removeLiquidity

removeLiquidity(marketAddress, param): Promise<ContractReceipt>

Removes liquidity from the specified market.

Parameters

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

Returns

Promise<ContractReceipt>

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:269


withdrawLiquidities

withdrawLiquidities(marketAddress, receiptIds): Promise<ContractReceipt>

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<ContractReceipt>

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:405


withdrawLiquidity

withdrawLiquidity(marketAddress, receiptId): Promise<ContractReceipt>

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<ContractReceipt>

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

Defined in

packages/sdk-ethers-v5/src/entities/ChromaticRouter.ts:385