UNPKG

@sega-so/sega-sdk

Version:

An SDK for building applications on top of SEGA.

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