# Quick Start

## Install the SDK

{% tabs %}
{% tab title="npm" %}

```
# Install via NPM
npm i lit-listener-sdk ethers
```

{% endtab %}

{% tab title="yarn" %}

```
# Install via yarn
yarn add lit-listener-sdk ethers
```

{% endtab %}
{% endtabs %}

<pre class="language-typescript" data-overflow="wrap" data-full-width="true"><code class="lang-typescript">import { ethers, BigNumber } from "ethers";
import { Circuit } from "lit-listener-sdk";

const chronicleProvider = new ethers.providers.JsonRpcProvider("https://chain-rpc.litprotocol.com/http", 175177);
const chronicleSigner = new ethers.Wallet(YOUR_PRIVATE_KEY, chronicleProvider);

const quickStartCircuit = new Circuit(chronicleSigner);
<strong>
</strong><strong>quickStartCircuit.setConditions([
</strong> new ContractCondition(
    "0x6968105460f67c3bf751be7c15f92f5286fd0ce5", // contract address
    [
     {
      "anonymous": false,
      "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "to",
        "type": "address"
       },
       {
        "indexed": false,
        "internalType": "uint256",
        "name": "value",
        "type": "uint256"
        }
          ],
          "name": "Transfer",
          "type": "event"
        },
      ], // abi
      "Transfer", // event name
      CHAIN_NAME.polygon, // chainId
      "https://your_provider_url_for_this_network", // provider URL
      ["to", "value"], // event name args
      ["0x6968105460f67c3bf751be7c15f92f5286fd0ce5",   
<strong>      BigNumber.from("500000")], // expected value
</strong>      "===", // match operator
      async () => { console.log("Matched!"); }, // onMatched function
      async () => { console.log("Unmatched!"); }, // onUnMatched function
      (error: Error) => { console.log("Error:", error); } // onError function,
), ]);
        
const {unsignedTransactionDataObject, litActionCode} = await quickStartCircuit.setActions([{
  type: "contract", 
  priority: 2, 
  contractAddress: "0x6968105460f67c3bf751be7c15f92f5286fd0ce5", 
  abi: [
     {
      constant: true,
      inputs: [{ name: "numberValue", type: "uint256" }],
      name: "your_function_name",
      outputs: [{ name: "", type: "uint256" }],
      payable: false,
      stateMutability: "external",
      type: "function",
      },
  ], 
  functionName: "your_function_name", 
  chainId: "polygon", 
  nonce: 1, 
  gasLimit: 100000,
  value: 0, 
  maxPriorityFeePerGas: 1000, 
  maxFeePerGas: 10000, 
  args: [20], 
};
]);

// Assuming you have already uploaded the Lit Action Code to IPFS and just need to retrieve the hash
const ipfsCID = await quickStartCircuit.getIPFSHash(litActionCode);
const { publicKey, tokenId, address } = await quickStartCircuit.mintGrantBurnPKP(ipfsCID);

await quickStartCircuit.start({publicKey, ipfsCID});
</code></pre>


---

# 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://docs.irrevocable.dev/quick-start.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.
