Git Product home page Git Product logo

jet-engine's Introduction

@jet-lab/jet-engine

Version Docs Discord License

Install

Add the package as a dependency to your project:

$ npm i @jet-lab/jet-engine

...or with yarn

$ yarn add @jet-lab/jet-engine

Usage

View the typedocs for the full package documentation and available API.

Instantiate the Client

import { JetClient } from '@jet-lab/jet-engine'
import { Provider, Wallet } from '@project-serum/anchor'
import { clusterApiUrl, Connection, Keypair } from '@solana/web3.js'

const provider = new Provider(new Connection(clusterApiUrl('devnet')), new Wallet(Keypair.generate()), {})
const client = await JetClient.connect(provider, true)

Examples

Fetching a position

Contributors ❤️

jet-engine's People

Contributors

callensm avatar charlieyou avatar davide-scalzo avatar ghesericsu avatar jetjake avatar kelonye avatar loganjross avatar partiallysorted avatar qiqicodes avatar rhubarbgarden avatar tristyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jet-engine's Issues

RangeError in JetClient.allMarkets()

I'm trying to use jetClient.allMarkets() to fetch all Market accounts, and always get this range error when it's decoding.

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 8703. Received 8704
    at boundsError (internal/buffer.js:83:9)
    at Buffer.readUInt8 (internal/buffer.js:249:5)
    at Buffer.readUIntLE (internal/buffer.js:179:17)
    at UInt.decode (./node_modules/buffer-layout/lib/Layout.js:570:14)
    at Sequence.decode (./node_modules/buffer-layout/lib/Layout.js:1090:34)
    at Structure.decode (./node_modules/buffer-layout/lib/Layout.js:1234:32)
    at WrappedLayout.decode (./node_modules/@project-serum/borsh/dist/lib/index.js:62:41)
    at Structure.decode (./node_modules/buffer-layout/lib/Layout.js:1234:32)
    at AccountsCoder.decode (./node_modules/@project-serum/anchor/dist/cjs/coder/accounts.js:42:23)
    at ./node_modules/@project-serum/anchor/dist/cjs/program/namespace/account.js:163:47

The similar methods jetClient.allObligations() & jetClient.allReserves() function as expected.

Here's my setup reduced to a minimal TS example: compile with tsc and run to reproduce.

import { JetClient } from '@jet-lab/jet-engine';
import { Provider, Wallet } from '@project-serum/anchor';
import * as solW3 from '@solana/web3.js';

const rpc = new solW3.Connection('https://api.devnet.solana.com');
const wallet = new Wallet(solW3.Keypair.generate());
const provider = new Provider(rpc, wallet, {});

JetClient.connect(provider, true)
.then(jet => {
    jet.allMarkets()
    .then(markets => { console.log(markets) }, 
          reason => { console.error(reason) });
});

I'm using jet-engine v0.1.7, running on MacOS & Node v14.x.

Cannot claim and stake

Hi, I'm trying to claim and stake the retroactive airdrop but once i hit the claim button it just stays there and no transaction shows up in my wallet to confirm it. I tried it on 3 different browsers and 2 different wallets. Thanks

Qualification

Please i used both mainnet and devnet before the given period and wasn't able to claim, please help.Thanks in advance Jetprotocol to the moon

4zPDrJH5m5kmrQnCoQGzSrzrR9zA1fyaCoKFZTS1G1wo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.