npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sentre/otc-sdk

v1.0.12

Published

Solana OTC Service SDK

Downloads

28

Readme

OTC SDK

https://img.shields.io/npm/v/@sentre/otc-sdk https://img.shields.io/npm/dw/@sentre/otc-sdk https://img.shields.io/bundlephobia/min/@sentre/otc-sdk https://img.shields.io/github/issues-raw/descartesnetwork/otc-sdk https://img.shields.io/github/license/descartesnetwork/otc-sdk

https://img.shields.io/twitter/follow/SentreProtocol?style=social

Solana OTC Service SDK. Users can exchange SPL tokens for SOL even with no SOL for transaction fees. Currently, the service is available on mainnet ONLY.

✨ Receive exactly desired amount of SOL. No slippage. No price impact.

✨ Never care about transaction fees.

✨ Zero down time.

Installation

npm i @sentre/otc-sdk

or,

yarn add @sentre/otc-sdk

Who are using?

  1. Any Arts - Buy NFTs on Magic Eden by your SPL tokens.
  2. Sen Assets - Feel annoying to withdraw SOL from Binance for transaction fees on Solana? This app will let you exchange SPL tokens to SOL with no transaction fees.

Usage

import { OTC } from '@sentre/otc-sdk'

const otc = new OTC()

/**
 * Get whitelisted spl tokens
 * You can quick review whitelist by: https://cors.sentre.io/otc/whitelist
 */
const whitelist = await otc.getWhitelist()
// {
//   usdc: {
//     address: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
//     symbol: 'USDC',
//     decimals: 6,
//     url: 'https://www.circle.com/en/usdc',
//   },
//   uxd: {
//     address: '7kbnvuGBxxj8AG9qp8Scn56muWGaRaFqxg1FsRp3PaFT',
//     symbol: 'UXD',
//     decimals: 6,
//     url: 'https://uxd.fi/',
//   }
// }

/**
 * Get SOL price based on USDC or UXD
 */
const solPriceBasedOnUSDC = await otc.getSolPrice({ tokenSymbol: 'usdc' })
// {
//   data: {
//     id: 'So11111111111111111111111111111111111111112',
//     mintSymbol: 'SOL',
//     vsToken: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v',
//     vsTokenSymbol: 'USDC',
//     price: 34.968693228,
//   },
//   timeTaken: 0.047694273001980036,
// }
const solPriceBasedOnUXD = await otc.getSolPrice({ tokenSymbol: 'uxd' })
// {
//   data: {
//     id: 'So11111111111111111111111111111111111111112',
//     mintSymbol: 'SOL',
//     vsToken: '7kbnvuGBxxj8AG9qp8Scn56muWGaRaFqxg1FsRp3PaFT',
//     vsTokenSymbol: 'UXD',
//     price: 34.972632341,
//   },
//   timeTaken: 0.010716108001361135,
// }

/**
 * Get exchange tx of usdc for 1 sol
 */
const wallet = <Your_Wallet_Instance_Here>
const tx = await otc.exchange({
  walletAddress: wallet.publicKey.toBase58(),
  tokenSymbol: 'usdc',
  solAmount: 1
})
const signedTx = await wallet.signTransaction(tx)
const txId = await sendTransaction(signedTx) // This function is just a pseudo-code and should replaced it by yours.

Whitelist

👉 Current whitelist: https://cors.sentre.io/otc/whitelist

👉 Wanna support more SPL tokens? Let's create a proposal here: https://github.com/DescartesNetwork/otc-sdk