@sega-so/sega-sdk
Version:
An SDK for building applications on top of SEGA.
2 lines • 4.1 kB
JavaScript
;var c=Object.defineProperty,K=Object.defineProperties,w=Object.getOwnPropertyDescriptor,T=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertyNames,m=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,W=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))W.call(e,o)&&d(n,o,e[o]);return n},f=(n,e)=>K(n,T(e));var h=(n,e)=>{for(var o in e)c(n,o,{get:e[o],enumerable:!0})},I=(n,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of O(e))!S.call(n,i)&&i!==o&&c(n,i,{get:()=>e[i],enumerable:!(s=w(e,i))||s.enumerable});return n};var D=n=>I(c({},"__esModule",{value:!0}),n);var E={};h(E,{Token:()=>y});module.exports=D(E);var l=require("@solana/web3.js");var t=require("@solana/web3.js"),x=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:x.TOKEN_PROGRAM_ID,isWritable:!1}),p({pubkey:t.SystemProgram.programId,isWritable:!1}),p({pubkey:t.SYSVAR_RENT_PUBKEY,isWritable:!1})];function P({publicKey:n,transformSol:e}){let o=N(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(s){throw new Error("invalid public key")}}throw new Error("invalid public key")}function N(n){try{return new t.PublicKey(n)}catch(e){return n}}var _=new t.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),U=new t.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),v=new t.PublicKey("SysvarRent111111111111111111111111111111111"),B=new t.PublicKey("SysvarC1ock11111111111111111111111111111111"),C=new t.PublicKey("metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"),G=new t.PublicKey("Sysvar1nstructions1111111111111111111111111"),X=t.SystemProgram.programId,j=new t.PublicKey("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),H=new t.PublicKey("Ea5SjE2Y6yvCeW5dYTn7PYMuW5ikXkvbGdcmSnXeaLjS"),z=new t.PublicKey("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt"),F=new t.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),J=new t.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),V=new t.PublicKey("mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So"),Q=new t.PublicKey("7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj"),Z=new t.PublicKey("USDH1SM1ojwWUga67PGrgFWUHibbjqMvuMaDkRJTgkX"),$=new t.PublicKey("NRVwhjBQiUPYtfDT5zRBVJajzFQHaBUNtC7SNVvqRFa"),e1=new t.PublicKey("ANAxByE6G2WjFp7A4NqtWYXb3mgruyzZYg3spfxe6Lbo"),t1=new t.PublicKey("7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs"),g=new t.PublicKey("So11111111111111111111111111111111111111112"),a=t.PublicKey.default;var A=require("@solana/web3.js"),b=require("@solana/spl-token"),n1={chainId:101,address:A.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:"sega",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:"sega",extensions:{coingeckoId:"solana"}};var u=class u{constructor({mint:e,decimals:o,symbol:s,name:i,skipMint:R=!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=R?l.PublicKey.default:P({publicKey:e}),this.isToken2022=k}equals(e){return this===e?!0:this.mint.equals(e.mint)}};u.WSOL=new u(f(M({},r),{mint:r.address}));var y=u;0&&(module.exports={Token});
//# sourceMappingURL=token.js.map