@hubbleprotocol/farms-sdk
Version:
27 lines • 1.51 kB
JavaScript
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.refreshFarmCommand = refreshFarmCommand;
const web3_js_1 = require("@solana/web3.js");
const Farms_1 = require("../Farms");
const utils_1 = require("../utils");
const utils_2 = require("./utils");
function refreshFarmCommand(farm) {
return __awaiter(this, void 0, void 0, function* () {
const admin = process.env.ADMIN;
const rpc = process.env.RPC;
const env = (0, utils_2.initializeClient)(rpc, admin, (0, utils_1.getFarmsProgramId)(rpc), false);
const farmsClient = new Farms_1.Farms(env.provider.connection);
const sig = yield farmsClient.refreshFarm(env.initialOwner, new web3_js_1.PublicKey(farm), 1);
console.log("Signature", sig);
});
}
//# sourceMappingURL=refresh_farm.js.map
;