UNPKG

test-rrr-sdk

Version:

An SDK for building applications on top of Raydium.

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