UNPKG

@raydium-io/raydium-sdk-v2

Version:

An SDK for building applications on top of Raydium.

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