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
Name | Type | Description |
---|---|---|
_client | Client | The 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
Name | Type | Description |
---|---|---|
token | string | The address of the token. |
accountAddress? | string | The 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
Name | Type | Description |
---|---|---|
tokens | string [] | An array of token addresses. |
accountAddress? | string | The 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.
Name | Type |
---|---|
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
Name | Type | Description |
---|---|---|
marketAddress | string | The address of the market. |
accountAddress? | string | The address of the account (optional). |
Returns
Promise
<bigint
[]>
A promise that resolves to an array of position IDs.