@drift-labs/sdk
Version:
SDK for Drift Protocol
11 lines (10 loc) • 515 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getGuardianSetPda = void 0;
const web3_js_1 = require("@solana/web3.js");
const getGuardianSetPda = (guardianSetIndex, wormholeProgramId) => {
const guardianSetIndexBuf = Buffer.alloc(4);
guardianSetIndexBuf.writeUInt32BE(guardianSetIndex, 0);
return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from('GuardianSet'), guardianSetIndexBuf], wormholeProgramId)[0];
};
exports.getGuardianSetPda = getGuardianSetPda;