> For the complete documentation index, see [llms.txt](https://docs.protocolink.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.protocolink.com/protocolink-sdk/common-sdk-interfaces/web3toolkit.md).

# Web3Toolkit

The `Web3Toolkit` class is used to interact with RPC in order to simplify the development process. It has the following properties and methods.

* Properties:
  * `chainId`: A readonly property that returns the current chain ID.
  * `network`: A readonly property that returns the `Network` object for the current chain.
  * `provider`: A readonly property that returns the web3 provider.
  * `nativeToken`: A readonly property that returns the `Token` class instance for the native token of the current chain.
  * `wrappedNativeToken`: A readonly property that returns the `Token` class instance for the wrapped native token of the current chain.
* Constructor:
  * `constructor(chainId, provider?)`: A constructor that initializes the `Web3Toolkit` object with a specified `chainId` and optional `provider`.
* Instance methods:
  * `getToken`: A method that returns a `Token` class instance for the specified token or token address.
  * `getTokens`: A method that returns an array of `Token` class instances for the specified array of token addresses.
  * `getBalance`: A method that returns the balance of the specified account for the specified token or token address.
  * `getAllowance`: A method that returns the allowance of the specified account for the specified token or token address and spender.
  * `getAllowances`: A method that returns an array of allowances for the specified account, array of token addresses, and spender.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.protocolink.com/protocolink-sdk/common-sdk-interfaces/web3toolkit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
