@accessprotocol/distributor
Version:
Access Protocol Distributor Library
15 lines (14 loc) • 588 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.stakeCustodySol = stakeCustodySol;
const programId_1 = require("../programId");
const web3_js_1 = require("@solana/web3.js");
const SolCustody_1 = require("../accounts/SolCustody");
function stakeCustodySol(amountLamports, owner, programId = programId_1.PROGRAM_ID) {
const solCustody = SolCustody_1.SolCustody.getAddress(owner, programId);
return web3_js_1.SystemProgram.transfer({
fromPubkey: owner,
toPubkey: solCustody,
lamports: amountLamports.toNumber(),
});
}