test-raydium-sdk-v2
Version:
An SDK for building applications on top of Raydium.
2 lines • 1.61 kB
JavaScript
import{PublicKey as d}from"@solana/web3.js";import{PublicKey as h,ComputeBudgetProgram as B,Transaction as T,TransactionMessage as v,Keypair as k,VersionedTransaction as E}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as K}from"@solana/spl-token";import{get as s,set as g}from"lodash";import l from"dayjs";import f from"dayjs/plugin/utc";l.extend(f);var i=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 l().utc().format("YYYY/MM/DD HH:mm:ss UTC")}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={},p={};function u(t){let e=s(m,t);if(!e){let r=s(p,t);e=new i({name:t,logLevel:r}),g(m,t,e)}return e}var O=u("Raydium_txUtil");function c(t,e){let[r,o]=h.findProgramAddressSync(t,e);return{publicKey:r,nonce:o}}import{TOKEN_PROGRAM_ID as y}from"@solana/spl-token";function z(t,e,r){return c([t.toBuffer(),(r!=null?r:y).toBuffer(),e.toBuffer()],new d("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}export{z as getATAAddress};
//# sourceMappingURL=pda.mjs.map