raydium-sdk-v2-custody
Version:
An SDK for building applications on top of Raydium.
2 lines • 1.94 kB
JavaScript
import{ComputeBudgetProgram as b,Keypair as S,PublicKey as g,Transaction as A,TransactionMessage as T,VersionedTransaction as I}from"@solana/web3.js";import{get as u,set as l}from"lodash";var n=class{constructor(e){this.logLevel=e.logLevel!==void 0?e.logLevel:0,this.name=e.name}set level(e){this.logLevel=e}get time(){return Date.now().toString()}get moduleName(){return this.name}isLogLevel(e){return e<=this.logLevel}error(...e){return this.isLogLevel(0)?(console.error(this.time,this.name,"sdk logger error",...e),this):this}logWithError(...e){let r=e.map(o=>typeof o=="object"?JSON.stringify(o):o).join(", ");throw new Error(r)}warning(...e){return this.isLogLevel(1)?(console.warn(this.time,this.name,"sdk logger warning",...e),this):this}info(...e){return this.isLogLevel(2)?(console.info(this.time,this.name,"sdk logger info",...e),this):this}debug(...e){return this.isLogLevel(3)?(console.debug(this.time,this.name,"sdk logger debug",...e),this):this}},m={},f={};function c(t){let e=u(m,t);if(!e){let r=u(f,t);e=new n({name:t,logLevel:r}),l(m,t,e)}return e}import{TOKEN_PROGRAM_ID as k}from"@solana/spl-token";var x=c("Raydium_txUtil");function i(t,e){let[r,o]=g.findProgramAddressSync(t,e);return{publicKey:r,nonce:o}}function O(t,e,r){return i([e.toBuffer(),Buffer.from("registrar","utf8"),r.toBuffer()],t)}function W(t,e){return i([e.toBuffer(),Buffer.from("voting_mint_seed","utf8")],t)}function D(t,e){return i([e.toBuffer()],t)}function M(t,e,r){return i([e.toBuffer(),Buffer.from("voter","utf8"),r.toBuffer()],t)}function q(t,e,r){return i([e.toBuffer(),Buffer.from("voter-weight-record","utf8"),r.toBuffer()],t)}function U(t,e,r,o){return i([Buffer.from("governance","utf8"),e.toBuffer(),r.toBuffer(),o.toBuffer()],t)}export{O as getRegistrarAddress,U as getTokenOwnerRecordAddress,M as getVoterAddress,q as getVoterWeightRecordAddress,D as getVotingMintAuthority,W as getVotingTokenMint};
//# sourceMappingURL=pda.mjs.map