1.4.0 • Published 3 years ago

@senswap/sen-js v1.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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

1.4.0

3 years ago

1.3.5

3 years ago

1.2.0

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.3

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.37

3 years ago

0.0.32

3 years ago

0.0.33

3 years ago

0.0.34

3 years ago

0.0.35

3 years ago

0.0.36

3 years ago

0.0.31

3 years ago

0.0.30

3 years ago

0.0.29

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.19

3 years ago

0.0.26

3 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.17

3 years ago

0.0.18

3 years ago

0.0.13

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.16

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.10

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago