HanjiClient
Overview
The HanjiClient
class is a central component for interacting with the Hanji API. It manages the connection to the Hanji API and provides methods to interact with the Hanji Spot contracts.
Constructor
constructor(options: Readonly<HanjiClientOptions>)
constructor(options: Readonly<HanjiClientOptions>)
Creates a new instance of the HanjiClient
.
Parameters:
apiBaseUrl
string
The base URL for the Hanji API.
webSocketApiBaseUrl
string
The base URL for the Hanji WebSocket API.
signer
Signer | null
The ethers signer used for signing transactions.
webSocketConnectImmediately?
boolean
Whether to connect to the WebSocket immediately after creating the HanjiClient
(default is true).
autoWaitTransaction?
boolean
Whether to automatically wait for transactions to be confirmed.
fastWaitTransaction?
boolean
Whether to use a fast algorithm for waiting for transactions to be confirmed.
fastWaitTransactionInterval?
number
Interval between requests in milliseconds when using a fast algorithm for waiting for transaction confirmations.
fastWaitTransactionTimeout?
number
Timeout in milliseconds when using a fast algorithm for waiting for transaction confirmations.
Properties
spot: HanjiSpot
spot: HanjiSpot
An instance of HanjiSpot
that provides API functions to interact with the Hanji Spot contracts.
Methods
setSigner(signer: Signer | null): void
setSigner(signer: Signer | null): void
Sets or unsets the signer for the HanjiClient
.
Parameters:
signer
(Signer): The signer to set.