kamino-sdk-beta
Version:
Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol
52 lines • 2.8 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.invest = invest;
const web3_js_1 = require("@solana/web3.js"); // eslint-disable-line @typescript-eslint/no-unused-vars
const programId_1 = require("../programId");
function invest(accounts, programId = programId_1.PROGRAM_ID) {
const keys = [
{ pubkey: accounts.payer, isSigner: true, isWritable: true },
{ pubkey: accounts.strategy, isSigner: false, isWritable: true },
{ pubkey: accounts.globalConfig, isSigner: false, isWritable: false },
{ pubkey: accounts.tokenAVault, isSigner: false, isWritable: true },
{ pubkey: accounts.tokenBVault, isSigner: false, isWritable: true },
{ pubkey: accounts.tokenAMint, isSigner: false, isWritable: false },
{ pubkey: accounts.tokenBMint, isSigner: false, isWritable: false },
{ pubkey: accounts.baseVaultAuthority, isSigner: false, isWritable: true },
{ pubkey: accounts.pool, isSigner: false, isWritable: true },
{ pubkey: accounts.tokenATokenProgram, isSigner: false, isWritable: false },
{ pubkey: accounts.tokenBTokenProgram, isSigner: false, isWritable: false },
{ pubkey: accounts.memoProgram, isSigner: false, isWritable: false },
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false },
{ pubkey: accounts.tokenProgram2022, isSigner: false, isWritable: false },
{ pubkey: accounts.position, isSigner: false, isWritable: true },
{
pubkey: accounts.raydiumProtocolPositionOrBaseVaultAuthority,
isSigner: false,
isWritable: true,
},
{
pubkey: accounts.positionTokenAccount,
isSigner: false,
isWritable: true,
},
{ pubkey: accounts.poolTokenVaultA, isSigner: false, isWritable: true },
{ pubkey: accounts.poolTokenVaultB, isSigner: false, isWritable: true },
{ pubkey: accounts.tickArrayLower, isSigner: false, isWritable: true },
{ pubkey: accounts.tickArrayUpper, isSigner: false, isWritable: true },
{ pubkey: accounts.scopePrices, isSigner: false, isWritable: false },
{ pubkey: accounts.tokenInfos, isSigner: false, isWritable: false },
{ pubkey: accounts.poolProgram, isSigner: false, isWritable: false },
{
pubkey: accounts.instructionSysvarAccount,
isSigner: false,
isWritable: false,
},
{ pubkey: accounts.eventAuthority, isSigner: false, isWritable: false },
];
const identifier = Buffer.from([13, 245, 180, 103, 254, 182, 121, 4]);
const data = identifier;
const ix = new web3_js_1.TransactionInstruction({ keys, programId, data });
return ix;
}
//# sourceMappingURL=invest.js.map