UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

2 lines 4.08 kB
var c=Object.defineProperty,w=Object.defineProperties,T=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyDescriptors,W=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var d=(n,e,o)=>e in n?c(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o,M=(n,e)=>{for(var o in e||(e={}))S.call(e,o)&&d(n,o,e[o]);if(m)for(var o of m(e))h.call(e,o)&&d(n,o,e[o]);return n},f=(n,e)=>w(n,O(e));var I=(n,e)=>{for(var o in e)c(n,o,{get:e[o],enumerable:!0})},D=(n,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of W(e))!S.call(n,i)&&i!==o&&c(n,i,{get:()=>e[i],enumerable:!(s=T(e,i))||s.enumerable});return n};var N=n=>D(c({},"__esModule",{value:!0}),n);var L={};I(L,{Token:()=>u});module.exports=N(L);var l=require("@solana/web3.js");var t=require("@solana/web3.js"),P=require("@solana/spl-token");function p({pubkey:n,isSigner:e=!1,isWritable:o=!0}){return{pubkey:n,isWritable:o,isSigner:e}}var Y=[p({pubkey:P.TOKEN_PROGRAM_ID,isWritable:!1}),p({pubkey:t.SystemProgram.programId,isWritable:!1}),p({pubkey:t.SYSVAR_RENT_PUBKEY,isWritable:!1})];function A({publicKey:n,transformSol:e}){let o=E(n.toString());if(o instanceof t.PublicKey)return e&&o.equals(a)?g:o;if(e&&o.toString()===a.toBase58())return g;if(typeof o=="string"){if(o===t.PublicKey.default.toBase58())return t.PublicKey.default;try{return new t.PublicKey(o)}catch{throw new Error("invalid public key")}}throw new Error("invalid public key")}function E(n){try{return new t.PublicKey(n)}catch{return n}}var U=new t.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),v=new t.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),B=new t.PublicKey("SysvarRent111111111111111111111111111111111"),C=new t.PublicKey("SysvarC1ock11111111111111111111111111111111"),G=new t.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),X=new t.PublicKey("Sysvar1nstructions1111111111111111111111111"),j=t.SystemProgram.programId,H=new t.PublicKey("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),z=new t.PublicKey("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),F=new t.PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),J=new t.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),V=new t.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),Q=new t.PublicKey("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),Z=new t.PublicKey("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),$=new t.PublicKey("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),e1=new t.PublicKey("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),t1=new t.PublicKey("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),o1=new t.PublicKey("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),g=new t.PublicKey("So11111111111111111111111111111111111111112"),a=t.PublicKey.default;var R=require("@solana/web3.js"),b=require("@solana/spl-token"),i1={chainId:101,address:R.PublicKey.default.toBase58(),programId:b.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"SOL",name:"solana",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}},r={chainId:101,address:"So11111111111111111111111111111111111111112",programId:b.TOKEN_PROGRAM_ID.toBase58(),decimals:9,symbol:"WSOL",name:"Wrapped SOL",logoURI:"https://img-v1.raydium.io/icon/So11111111111111111111111111111111111111112.png",tags:[],priority:2,type:"raydium",extensions:{coingeckoId:"solana"}};var y=class{constructor({mint:e,decimals:o,symbol:s,name:i,skipMint:k=!1,isToken2022:K=!1}){if(e===a.toBase58()||e instanceof l.PublicKey&&a.equals(e)){this.decimals=r.decimals,this.symbol=r.symbol,this.name=r.name,this.mint=new l.PublicKey(r.address),this.isToken2022=!1;return}this.decimals=o,this.symbol=s||e.toString().substring(0,6),this.name=i||e.toString().substring(0,6),this.mint=k?l.PublicKey.default:A({publicKey:e}),this.isToken2022=K}equals(e){return this===e?!0:this.mint.equals(e.mint)}},u=y;u.WSOL=new y(f(M({},r),{mint:r.address}));0&&(module.exports={Token}); //# sourceMappingURL=token.js.map