```sh npm install @jup-ag/lend ```
``sh`
npm install @jup-ag/lend
#### Earning
`ts
import { getDepositIxs, getWithdrawIxs } from "@jup-ag/lend/earn";
const connection = new Connection("https://api.mainnet-beta.solana.com");
const signer = new PublicKey("signerAddress");
const usdc = new PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
const { ixs: depositIxs } = await getDepositIxs({
amount: new BN(1000000),
asset: usdc,
signer,
connection,
});
const { ixs: withdrawIxs } = await getWithdrawIxs({
amount: new BN(10000),
asset: usdc,
signer,
connection,
});
`
#### Borrowing
`ts
import { getOperateIx } from "@jup-ag/lend/borrow";
const connection = new Connection("https://api.mainnet-beta.solana.com");
const signer = new PublicKey("signerAddress");
const { ixs, addressLookupTableAccounts } = await getOperateIx({
vaultId: 1,
positionId: 0,
colAmount: new BN(1000000),
debtAmount: new BN(1000),
signer,
connection,
});
`
#### API
`ts
import { Client } from "@jup-ag/lend/api";
const client = new Client(); // or new Client({ apiKey: "my-api-key" });
const lendingTokens = await client.earn.getTokens();
``