@senswap/sen-js
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

SEN JS

Introduction

This library is to help developers can integrate their projects to Sentre Ecosystem easily.

Sentre is an open liquidity protocol built on Solana. It's aiming to build and open, friendly, and free environment for both DApps developers, and DeFi users.

Npm package version Npm package monthly downloads GitHub license

Installation

npm i @senswap/sen-js

Usage

import { Swap } from '@senswap/sen-js'
// Or
// const { Swap } = require('@senswap/sen-js')

const swapProgramAddress = '4erFSLP7oBFSVC1t35jdxmbfxEhYCKfoM6XdG2BLR3UF'
const spltProgramAddress = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
const splataProgramAddress = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL'
const nodeUrl = 'https://api.devnet.solana.com'
const swap = new Swap(
  swapProgramAddress,
  spltProgramAddress,
  splataProgramAddress,
  nodeUrl
)

// Should be placed in an async wrapper
const poolData = await swap.getPoolData('9NodRcEmSxg2KMtPnFfzSvXGbBFXkRA4zgejhSGVpt9F')
console.log(poolData)
// {
//   owner: "8UaZw2jDhJzv5V53569JbCd3bD4BnyCfBH3sjwgajGS9"
//   state: 1
//   mint_lpt: "EsPTPmXhwpp5XjzCms6juqgrGCAhsTEaC47Lvm29RwTF"
//   taxman: "8UaZw2jDhJzv5V53569JbCd3bD4BnyCfBH3sjwgajGS9"
//   mint_a: "5YwUkPdXLoujGkZuo9B4LsLKj3hdkDcfP4derpspifSJ"
//   treasury_a: "J9aSEQkAF3Umy6mipq9EppLLrKWS26q5m4HaV2KG8atv"
//   reserve_a: 3110702644000n
//   mint_b: "27hdcZv7RtuMp75vupThR3T4KLsL61t476eosMdoec4c"
//   treasury_b: "9s2NgRPn4f7X6Kng4x8JEDcZ9kwphFg1kPD4oLQFEbM7"
//   reserve_b: 4570811590939n
//   fee_ratio: 2500000n
//   tax_ratio: 0n
// }

Testing

npm test

Related works

Soprox ABI

SenHub

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.4.00latest

Version History

VersionDownloads (Last 7 Days)Published
1.4.00
1.3.50
1.3.40
1.3.30
1.3.20
1.3.10
1.2.50
1.2.40
1.2.30
1.2.20
1.2.10
1.2.00
1.1.30
1.1.20
1.1.10
1.1.00
1.0.91
1.0.80
1.0.70
1.0.60
1.0.51
1.0.40
1.0.30
1.0.20
1.0.10
1.0.00
0.1.30
0.1.20
0.1.10
0.1.00
0.0.370
0.0.360
0.0.350
0.0.340
0.0.330
0.0.320
0.0.310
0.0.300
0.0.290
0.0.280
0.0.270
0.0.260
0.0.250
0.0.240
0.0.230
0.0.220
0.0.210
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.141
0.0.130
0.0.120
0.0.111
0.0.100
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i @senswap/sen-js

Weekly Downloads

4

Version

1.4.0

License

MIT

Unpacked Size

696 kB

Total Files

82

Last publish

Collaborators

  • tphanson