# L1X Typescript SDK

Utilize this tool to engage with accounts and programs on the L1X Network via the L1X Network JSON RPC API.

## Installation

For use in Node.js or a web application (Invited Members)

* Login via CLI using invited credentials

```bash
npm login
```

For use in Node.js or a web application

```bash
npm install --save @l1x/l1x-wallet-sdk
```

## Documentation and examples

For more detail on individual functions, see the latest [API Documentation](https://github.com/L1X-Foundation/l1x-wallet-sdk/blob/master/docs/index.html)

## Environment Setup

Requirements:

* Node Version >= v16.19.1

To Build from source run

```bash
npm install
npm run build
```

## Running Tests

To run tests, run the following command

```bash
npm run test
```

## Usage/Examples

[More Details on L1XProvider](https://dev9378.d3j4qg1i3nb5w3.amplifyapp.com/classes/L1XProvider.html)

```javascript

const {L1XProvider} = require("@l1x/l1x-wallet-sdk")

OR 

import {L1XProvider} from "@l1x/l1x-wallet-sdk"

function getL1XProvider(){
    return new L1XProvider({
        clusterType:"mainnet"
    })
}

(async() => {
    const l1xProvider = getL1XProvider();
    await l1xProvider.core.getChainState().then(console.log)
})();
```


---

# Agent Instructions: 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://l1x-sdk.gitbook.io/l1x-wallet-sdk/4BgPf6WH50hnVEUCHE22/readme.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.
