jito-labs / jito-ts Goto Github PK
View Code? Open in Web Editor NEWJito Typescript SDK
License: Other
Jito Typescript SDK
License: Other
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.
Hi there, when will 4.0.0 be published?
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
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
The interceptor which provides the auth expires after an hour. The SearcherClient doesn't automatically refetch new auth interceptors nor does it expose a function to pass in new auth parameters
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.
Hi. Could admin be so nice and update it? As it has problem with transaction confirming from about 3-4 weeks. Thx!
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.
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)
I want to get the response of the submitted bundle through the bundle id, can anyone help how to do it
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?
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
Hi everyone! I was hoping to use Jito-sdk in my React project but facing this issue with one of the packages inside:
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.