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{TOKEN_PROGRAM_ID as d}from"@solana/spl-token";import{ComputeBudgetProgram as A,Keypair as V,PublicKey as f,Transaction as B,TransactionMessage as v,VersionedTransaction as R}from"@solana/web3.js";import{get as s,set as u}from"lodash";var o=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 o({name:t,logLevel:r}),u(m,t,e)}return e}import{TOKEN_PROGRAM_ID as F}from"@solana/spl-token";var W=l("Raydium_txUtil");function c(t,e){let[r,i]=f.findProgramAddressSync(t,e);return{publicKey:r,nonce:i}}function D(t,e,r){return c([t.toBuffer(),(r!=null?r:d).toBuffer(),e.toBuffer()],new p("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}export{D as getATAAddress}; //# sourceMappingURL=pda.mjs.map