Giter VIP home page Giter VIP logo

jito-ts's People

Contributors

ebin-mathews avatar esemeniuc avatar futurekarol avatar segfaultdoc avatar zhelezkov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar

jito-ts's Issues

Error when compiling: issues in connection.ts and fetch-impl.ts

Hi, I am having errors when trying to run the examples, is the sdk broken on a certain version of a package?

Output:
src/sdk/rpc/connection.ts:38:20 - error TS2614: Module '"./fetch-impl"' has no exported member 'Response'. Did you mean to use 'import Response from "./fetch-impl"' instead?

38 import fetchImpl, {Response} from './fetch-impl';
~~~~~~~~

src/sdk/rpc/connection.ts:264:5 - error TS2322: Type '(info: RequestInfo | URL, init: RequestInit) => Promise<Response | Response>' is not assignable to type '(input: RequestInfo | URL, init?: RequestInit) => Promise'.
Type 'Promise<Response | Response>' is not assignable to type 'Promise'.
Type 'Response | Response' is not assignable to type 'Response'.
Property 'formData' is missing in type 'import("/Users/admin/Documents/Documents/Projects/solanastuff/jito-ts/node_modules/@types/node-fetch/index").Response' but required in type 'Response'.

264 fetchWithMiddleware = async (info, init) => {
~~~~~~~~~~~~~~~~~~~

node_modules/typescript/lib/lib.dom.d.ts:3159:5
3159 formData(): Promise;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'formData' is declared here.

src/sdk/rpc/connection.ts:276:26 - error TS2345: Argument of type 'RequestInfo | URL' is not assignable to parameter of type '(RequestInfo | URL) & RequestInfo'.
Type 'Request' is not assignable to type '(RequestInfo | URL) & RequestInfo'.
Type 'Request' is not assignable to type '(string & Request) | (Request & string) | (Request & URLLike) | (Request & Request) | (URL & Request)'.
Type 'Request' is not assignable to type 'Request & Request'.
Type 'Request' is missing the following properties from type 'Request': context, compress, counter, follow, and 6 more.

276 return await fetch(...modifiedFetchArgs);
~~~~~~~~~~~~~~~~~~~~

src/sdk/rpc/connection.ts:385:45 - error TS2339: Property 'commitment' does not exist on type 'Commitment | ConnectionConfig'.
Property 'commitment' does not exist on type '"finalized"'.

385 this._commitment = commitmentOrConfig.commitment;
~~~~~~~~~~

src/sdk/rpc/connection.ts:387:28 - error TS2339: Property 'confirmTransactionInitialTimeout' does not exist on type 'Commitment | ConnectionConfig'.
Property 'confirmTransactionInitialTimeout' does not exist on type '"finalized"'.

387 commitmentOrConfig.confirmTransactionInitialTimeout;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/sdk/rpc/connection.ts:388:40 - error TS2339: Property 'httpHeaders' does not exist on type 'Commitment | ConnectionConfig'.
Property 'httpHeaders' does not exist on type '"finalized"'.

388 httpHeaders = commitmentOrConfig.httpHeaders;
~~~~~~~~~~~

src/sdk/rpc/connection.ts:389:34 - error TS2339: Property 'fetch' does not exist on type 'Commitment | ConnectionConfig'.
Property 'fetch' does not exist on type '"finalized"'.

389 fetch = commitmentOrConfig.fetch;
~~~~~

src/sdk/rpc/connection.ts:390:44 - error TS2339: Property 'fetchMiddleware' does not exist on type 'Commitment | ConnectionConfig'.
Property 'fetchMiddleware' does not exist on type '"finalized"'.

390 fetchMiddleware = commitmentOrConfig.fetchMiddleware;
~~~~~~~~~~~~~~~

src/sdk/rpc/connection.ts:391:52 - error TS2339: Property 'disableRetryOnRateLimit' does not exist on type 'Commitment | ConnectionConfig'.
Property 'disableRetryOnRateLimit' does not exist on type '"finalized"'.

391 disableRetryOnRateLimit = commitmentOrConfig.disableRetryOnRateLimit;
~~~~~~~~~~~~~~~~~~~~~~~

src/sdk/rpc/connection.ts:392:38 - error TS2339: Property 'httpAgent' does not exist on type 'Commitment | ConnectionConfig'.
Property 'httpAgent' does not exist on type '"finalized"'.

392 httpAgent = commitmentOrConfig.httpAgent;
~~~~~~~~~

Found 10 errors in the same file, starting at: src/sdk/rpc/connection.ts:38

Stream error: 12 UNIMPLEMENTED: subscribe_mempool is deprecated

yarn run:backrun

Stream error: 12 UNIMPLEMENTED: subscribe_mempool is deprecated
    at ClientReadableStreamImpl.<anonymous> (/.../jito-ts/dist/sdk/block-engine/searcher.js:171:27)
    at ClientReadableStreamImpl.emit (node:events:515:28)
    at Object.onReceiveStatus (/.../jito-ts/node_modules/@grpc/grpc-js/build/src/client.js:358:28)
    at Object.onReceiveStatus (/.../jito-ts/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:323:181)
    at /.../jito-ts/node_modules/@grpc/grpc-js/build/src/resolving-call.js:129:78
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)

Node.js v21.1.0

Any Idea how I can solve it? Thanks

`url` in seacherClient constructor is misleading as it only accepts a hostname

According to the constructor signature searcherClient(url: string, authKeypair: Keypair) and the example const c = searcherClient(blockEngineUrl, keypair); the constructor expects a url for the block engine.

It errors when using BLOCK_ENGINE_URL=https://frankfurt.mainnet.block-engine.jito.wtf.
Instead, it expects just the hostname, like BLOCK_ENGINE_URL=frankfurt.mainnet.block-engine.jito.wtf.

Proposed solution:
make sure it accepts urls and not just hostnames to make it consistent with the signature, example and jito docs (https://jito-labs.gitbook.io/mev/searcher-resources/block-engine/mainnet-addresses)

`onProgramUpdate` fails when receiving versioned transactions

Error log:

Error: Versioned messages must be deserialized with VersionedMessage.deserialize()
    at Function.from (/node_modules/@solana/web3.js/lib/index.cjs.js:856:13)
    at Function.from (/node_modules/@solana/web3.js/lib/index.cjs.js:1800:41)
    at /node_modules/jito-ts/dist/sdk/block-engine/utils.js:11:38
    at Array.map (<anonymous>)
    at deserializeTransactions (/node_modules/jito-ts/dist/sdk/block-engine/utils.js:10:20)
    at ClientReadableStreamImpl.<anonymous> (node_modules/jito-ts/dist/sdk/block-engine/searcher.js:78:69

Cannot catch RESOURCE_EXHAUSTED

I try to catch RESOURCE_EXHAUSTED when sendBundle but can't, i need catch this because i will retry with normal transaction, any suggest.

.sendBundle(maybeBundle) .then((bundleId) => console.log("bundleid", bundleId)) .catch((err) => { //Not working with RESOURCE_EXHAUSTED });
Thanks.

Number.MAX_SAFE_INTEGER

Having parsing errors while listening to onAccountupdate or onProgramUpdate.

Error: Stream error: Error: 13 INTERNAL: Response message parsing error: Value is larger than Number.MAX_SAFE_INTEGER

Why's that error or such a large number getting pushed?

TypeError: The "original" argument must be of type Function | @grpc/grpc-js/build/src/resolver-dns.js

I am currently using jito-ts for my React TypeScript project.
When I start importing { searcherClient } from './jito/sdk/block-engine/searcher', I encounter the following error:

TypeError: The "original" argument must be of type Function at Object.promisify (http://localhost:3000/node_modules/.vite/deps/chunk-3OND6XRJ.js?v=90d6346d:2055:15) at node_modules/@grpc/grpc-js/build/src/resolver-dns.js (http://localhost:3000/node_modules/.vite/deps/@grpc_grpc-js.js?v=dd2ab8cd:9845:34) at __require2 (http://localhost:3000/node_modules/.vite/deps/chunk-KK4SFAKU.js?v=90d6346d:27:50) at node_modules/@grpc/grpc-js/build/src/http_proxy.js (http://localhost:3000/node_modules/.vite/deps/@grpc_grpc-js.js?v=dd2ab8cd:10088:26) at __require2 (http://localhost:3000/node_modules/.vite/deps/chunk-KK4SFAKU.js?v=90d6346d:27:50) at node_modules/@grpc/grpc-js/build/src/transport.js (http://localhost:3000/node_modules/.vite/deps/@grpc_grpc-js.js?v=dd2ab8cd:10773:24) at __require2 (http://localhost:3000/node_modules/.vite/deps/chunk-KK4SFAKU.js?v=90d6346d:27:50) at node_modules/@grpc/grpc-js/build/src/subchannel-pool.js (http://localhost:3000/node_modules/.vite/deps/@grpc_grpc-js.js?v=dd2ab8cd:11253:23) at __require2 (http://localhost:3000/node_modules/.vite/deps/chunk-KK4SFAKU.js?v=90d6346d:27:50) at node_modules/@grpc/grpc-js/build/src/internal-channel.js (http://localhost:3000/node_modules/.vite/deps/@grpc_grpc-js.js?v=dd2ab8cd:13056:29)

This error originates from TypeScript due to passing the wrong type of Function. I tried using it with React JS and it works very well.
How can I fix this error with TypeScript?

"typescript": "^5.2.2",
"vite": "^5.2.0",
jito-ts: lastest version.

Can't run package in a react project

Hi everyone! I was hoping to use Jito-sdk in my React project but facing this issue with one of the packages inside: photo_2024-02-06_03-12-06

Already tried to add:

"browser" :{
 "tls" : false,
 ...
}

to my package.json and it didnt help me. Also tried to use different node.js versions and still no success. Maybe someone could help with this?

Update jito-ts

Hi. Could admin be so nice and update it? As it has problem with transaction confirming from about 3-4 weeks. Thx!

[Question] How to get authorized keypair

I am trying to develop and use Jito, but I always keep getting "The supplied pubkey is not authorized to generate a token." . How does one authorize a pubkey? Please add to the Readme.md if possible.

Cannot find module inside lib

image

I trying this fix through remove node_modules and package-lock.json after which run command "npm install", and this not help me.

How to fix it?

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.