UNPKG

@drift-labs/sdk

Version:
11 lines (10 loc) 515 B
"use strict"; 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;