@sega-so/sega-sdk
Version:
An SDK for building applications on top of SEGA.
2 lines • 3 kB
JavaScript
import{PublicKey as w}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as C}from"@solana/spl-token";import{ComputeBudgetProgram as B,Keypair as k,PublicKey as d,Transaction as I,TransactionMessage as E,VersionedTransaction as W}from"@solana/web3.js";import{get as m,set as g}from"lodash";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 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 n=e.map(o=>typeof o=="object"?JSON.stringify(o):o).join(", ");throw new Error(n)}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}},u={},p={};function l(r){let e=m(u,r);if(!e){let n=m(p,r);e=new i({name:r,logLevel:n}),g(u,r,e)}return e}import{TOKEN_PROGRAM_ID as q}from"@solana/spl-token";var _=l("Sega_txUtil");function a(r,e){let[n,o]=d.findProgramAddressSync(r,e);return{publicKey:n,nonce:o}}import{PublicKey as t,SystemProgram as f,SYSVAR_RENT_PUBKEY as y}from"@solana/web3.js";import{TOKEN_PROGRAM_ID as h}from"@solana/spl-token";function s({pubkey:r,isSigner:e=!1,isWritable:n=!0}){return{pubkey:r,isWritable:n,isSigner:e}}var H=[s({pubkey:h,isWritable:!1}),s({pubkey:f.programId,isWritable:!1}),s({pubkey:y,isWritable:!1})];var j=new t("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),X=new t("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),J=new t("SysvarRent111111111111111111111111111111111"),Z=new t("SysvarC1ock11111111111111111111111111111111"),c=new t("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),Q=new t("Sysvar1nstructions1111111111111111111111111"),$=f.programId,ee=new t("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),te=new t("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),re=new t("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),ne=new t("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),oe=new t("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),ie=new t("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),ae=new t("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),se=new t("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),ce=new t("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),me=new t("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),ue=new t("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),le=new t("So11111111111111111111111111111111111111112"),fe=t.default;function we(r,e,n){return a([r.toBuffer(),(n!=null?n:C).toBuffer(),e.toBuffer()],new w("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"))}function Ce(r){return a([Buffer.from("metadata","utf8"),c.toBuffer(),r.toBuffer()],c)}export{we as getATAAddress,Ce as getPdaMetadataKey};
//# sourceMappingURL=pda.mjs.map