Skip to main content

Class: ChromaticAccount

Represents a Chromatic Account and provides methods to interact with it.

Constructors​

constructor​

• new ChromaticAccount(_client)

Creates a new instance of ChromaticAccount.

Parameters​

NameTypeDescription
_clientClientThe Chromatic Client instance.

Defined in​

packages/sdk-ethers-v6/src/entities/ChromaticAccount.ts:22

Methods​

balance​

▸ balance(token, accountAddress?): Promise<bigint>

Retrieves the balance of a specific token in the Chromatic Account.

Parameters​

NameTypeDescription
tokenstringThe address of the token.
accountAddress?stringThe address of the account (optional).

Returns​

Promise<bigint>

A promise that resolves to the balance of the token.

Defined in​

packages/sdk-ethers-v6/src/entities/ChromaticAccount.ts:81


balances​

▸ balances(tokens, accountAddress?): Promise<TokenBalancesResult[]>

Retrieves the balances of multiple tokens in the Chromatic Account.

Parameters​

NameTypeDescription
tokensstring[]An array of token addresses.
accountAddress?stringThe address of the account (optional).

Returns​

Promise<TokenBalancesResult[]>

A promise that resolves to an array of TokenBalancesResult objects.

Defined in​

packages/sdk-ethers-v6/src/entities/ChromaticAccount.ts:98


contracts​

▸ contracts(): Object

Retrieves the contract instances associated with the Chromatic Account.

Returns​

Object

An object containing the contract instances.

NameType
account(address?: string) => ChromaticAccount
router(signerOrProvider?: Provider | Signer) => ChromaticRouter

Defined in​

packages/sdk-ethers-v6/src/entities/ChromaticAccount.ts:28


createAccount​

▸ createAccount(): Promise<ContractTransactionReceipt>

Creates a new Chromatic Account.

Returns​

Promise<ContractTransactionReceipt>

A promise that resolves to the transaction receipt of the account creation.

Defined in​

packages/sdk-ethers-v6/src/entities/ChromaticAccount.ts:40


getAccount​

▸ getAccount(): Promise<string>

Retrieves the current Chromatic Account.

Returns​

Promise<string>

A promise that resolves to the Chromatic Account details.

Defined in​

packages/sdk-ethers-v6/src/entities/ChromaticAccount.ts:51


getPositionIds​

▸ getPositionIds(marketAddress, accountAddress?): Promise<bigint[]>

Retrieves the position IDs associated with a specific market.

Parameters​

NameTypeDescription
marketAddressstringThe address of the market.
accountAddress?stringThe address of the account (optional).

Returns​

Promise<bigint[]>

A promise that resolves to an array of position IDs.

Defined in​

packages/sdk-ethers-v6/src/entities/ChromaticAccount.ts:63