UNPKG

goosefx-amm-sdk

Version:

SDK for the GooseFx AMM

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