UNPKG

test-raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

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