# Importing The widget

Install dependencies:

```bash
npm i @0xsquid/staking-widget @0xsquid/sdk ethers
```

And import the widget in your app:

```typescript
import { SquidStakingWidget } from "@0xsquid/staking-widget";
import { SquidCallType } from "@0xsquid/sdk";
import { ethers } from "ethers";

import erc20Abi from "./abi/erc20Abi";
import pinjamStakingPoolAbi from "./abi/pinjamStakingPoolAbi";

const pinjamStakingPoolInterface = new ethers.Interface(
  pinjamStakingPoolAbi
);

const kavaId = 2222;
const pinjamAxlUsdcPoolAddress = "0x11c3d91259b1c2bd804344355c6a255001f7ba1e";
const axlUsdcKavaAddress = "0xeb466342c4d449bc9f53a865d5cb90586f405215";
const pAxlUsdcAddress = "0x5c91f5d2b7046a138c7d1775bffea68d5e95d68d";
const erc20Interface = new ethers.Interface(erc20Abi);

export default function App() {
  const stakeConfig = {
    tokensConfig: [
      {
        stakedTokenExchangeRateGetter: async () => {
          return 1;
        },
        unstakeLink: "https://app.pinjamlabs.com/staking",
        customContractCalls: [
          {
            callType: SquidCallType.FULL_TOKEN_BALANCE,
            target: axlUsdcKavaAddress,
            value: "0",
            callData: () => {
              return erc20Interface.encodeFunctionData("approve", [
                pinjamAxlUsdcPoolAddress,
                "0",
              ]);
            },
            payload: {
              tokenAddress: axlUsdcKavaAddress,
              inputPos: 1,
            },
            estimatedGas: "50000",
          },
          {
            callType: SquidCallType.FULL_TOKEN_BALANCE,
            target: pinjamAxlUsdcPoolAddress,
            value: "0",
            callData: (route: any) => {
              if (route.destinationAddress) {
                return pinjamStakingPoolInterface.encodeFunctionData(
                  "deposit",
                  [axlUsdcKavaAddress, "0", route.destinationAddress, true]
                );
              }
              return "0x0000000000000000000000000000000000000000";
            },
            payload: {
              tokenAddress: axlUsdcKavaAddress,
              inputPos: 1,
            },
            estimatedGas: "250000",
          },
        ],

        stakedToken: {
          chainId: kavaId,
          address: pAxlUsdcAddress,
          name: "paxlUSDC",
          symbol: "paxlUSDC",
          decimals: 6,
          logoURI:
            "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png?1547042389",
          coingeckoId: "usd-coin",
        },
        tokenToStake: {
          chainId: kavaId,
          address: axlUsdcKavaAddress,
        },
        stakingContract: {
          address: "0xe5274e38e91b615d8822e8512a29a16ff1b9c4af",
          explorerLink: "https://kava.mintscan.io/account/",
        },
        logoUrl: "https://app.pinjamlabs.com/icons/pinkav.svg",
      },
    ],

    introPage: {
      title: "Stake paxlUSDC on Kava",
      description: "Stake paxlUSDC on Kava to earn rewards",
    },
  };

  return (
    <SquidStakingWidget
      config={{
        apiUrl: "https://v2.api.squidrouter.com",
        integratorId: "<your integrator id>",
        stakeConfig,
      }}
    />
  );
}
```


---

# 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.squidrouter.com/old-v2-documentation-deprecated/add-a-widget/stake-widget/importing-the-widget.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.
