UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

2 lines 1.52 kB
import{PublicKey as p}from"@solana/web3.js";import{PublicKey as f,ComputeBudgetProgram as S,Transaction as P,TransactionMessage as B,Keypair as T,VersionedTransaction as R}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as k}from"@solana/spl-token";import{get as s,set as c}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(i=>typeof i=="object"?JSON.stringify(i):i).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={},g={};function l(t){let e=s(m,t);if(!e){let r=s(g,t);e=new n({name:t,logLevel:r}),c(m,t,e)}return e}var K=l("Raydium_txUtil");function u(t,e){let[r,i]=f.findProgramAddressSync(t,e);return{publicKey:r,nonce:i}}import{TOKEN_PROGRAM_ID as h}from"@solana/spl-token";function D(t,e,r){return u([t.toBuffer(),(r!=null?r:h).toBuffer(),e.toBuffer()],new p("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}export{D as getATAAddress}; //# sourceMappingURL=pda.mjs.map