UNPKG

@symmetry-hq/baskets-v2-sdk

Version:

Symmetry Baskets V2 SDK

34 lines (33 loc) 1.6 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.addLamportsForAutomationIx = addLamportsForAutomationIx; // Core dependencies const anchor_1 = require("@coral-xyz/anchor"); const web3_js_1 = require("@solana/web3.js"); // Local imports const constants_1 = require("../../utils/constants"); function addLamportsForAutomationIx(params) { return __awaiter(this, void 0, void 0, function* () { // Destructure all params const { program, basket, manager, amount } = params; // Build and return instruction return yield program.methods .addLamportsForAutomation(new anchor_1.BN(amount)) .accountsStrict({ manager, basket, automationFeeWallet: constants_1.AUTOMATION_FEE_WALLET, systemProgram: web3_js_1.SystemProgram.programId, }) .instruction(); }); }