Class for interacting with Synthetix V3 core contracts

Constructors

Properties

accountIds: bigint[]
defaultAccountId?: bigint

Methods

  • Parameters

    • accountId: undefined | bigint = undefined
    • submit: boolean = false

    Returns Promise<string | CallParameters>

  • Parameters

    • tokenAddress: string
    • amount: number
    • poolId: bigint
    • leverage: number
    • accountId: undefined | bigint = undefined
    • submit: boolean = false

    Returns Promise<string | CallParameters>

  • Parameters

    • tokenAddress: string
    • amount: number
    • decimals: number = 18
    • accountId: undefined | bigint = undefined
    • submit: boolean = false

    Returns Promise<string | CallParameters>

  • Get the core account IDs owned by an address. Fetches the account IDs for the given address by checking the balance of the AccountProxy contract, which is an NFT owned by the address. If no address is provided, uses the connected wallet address.

    Parameters

    • address: undefined | string = undefined

      The address to get accounts for. Uses connected address if not provided.

    • defaultAccountId: undefined | bigint = undefined

      The default account ID to set after fetching.

    Returns Promise<bigint[]>

    A list of account IDs owned by the address

  • Returns the Owner wallet address for an account ID

    Parameters

    • accountId: number

      Account ID

    Returns Promise<`0x${string}`>

    string - Address of the account owning the accountId

  • Get the available collateral for an account for a specified collateral type of token_address Fetches the amount of undelegated collateral available for withdrawal for a given token and account.

    Parameters

    • tokenAddress: string

      The address of the collateral token

    • accountId: undefined | bigint = undefined

      The ID of the account to check. Uses default if not provided.

    Returns Promise<string>

    The available collateral as an ether value.

  • Retrieves the unique system preferred pool

    Returns Promise<bigint>

    poolId The id of the pool that is currently set as preferred in the system.

  • Get the address of the USD stablecoin token

    Returns Promise<`0x${string}`>

    Address of the USD stablecoin token

  • Parameters

    • tokenAddress: string
    • amount: number
    • poolId: bigint
    • accountId: undefined | bigint = undefined
    • submit: boolean = false

    Returns Promise<string | CallParameters>

  • Parameters

    • tokenAddress: string
    • amount: number
    • decimals: number = 18
    • accountId: undefined | bigint = undefined
    • submit: boolean = false

    Returns Promise<string | CallParameters>