UNPKG

snapper-sdk

Version:

An SDK for building applications on top of Snapper.

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