skip-mev / skip-go Goto Github PK
View Code? Open in Web Editor NEWHelper library to send bundles to the skip relay in golang
Helper library to send bundles to the skip relay in golang
# skip-go A util for signing and sending bundles through the Skip relayer. # Usage skipjs exposes a single default export, `SkipBundleClient`. `SkipBundleClient` has two functions: `signBundle` and `sendBundle`. ``` func SignBundle(bundle [][]byte, privateKeyBytes []byte) ([]string, []byte) func SendBundle(b64EncodedSignedBundle []string, bundleSignature []byte, publicKey string, rpcURL string, desiredHeight string, sync bool) (*http.Response, error) ``` ## SignBundle `SignBundle` is used to sign a bundle of transactions. It must be provided with an array of `[]byte`, and a sepc256k1 private key (as `[]byte`), used to sign the bundle. The transactions argument should be an array of base64-encoded transaction strings. The encoded bytes can be either Cosmos SDK `TxRaw`s or Ethereum native transactions (such as those produced from `ethers`, for Ethermint EVM chains. See the examples for more details. `SignBundle` returns a (`SignedBundle`, `bundleSignature`), which can then both be passed to `SendBundle` to send the bundle to the relayer. ## SendBundle `SendBundle` sends a `b64EncodedSignedBundle` to the Sentinel for inclusion in the auction. A `b64EncodedSignedBundle` is the first output of `SignBundle` that can be reused here. A `bundleSignature` is the second output of `SignBundle` that can be reused here. The `publickey` is the address, as a `string`, that was used to sign the bundle. `desiredHeight` is the desired height for the bundle to be included on-chain. Submitted bundles will only be considered in the auction for this height. Passing `0` as `desiredHeight` will cause the Skip Sentinel to consider the bundle for the immediate next height. `sync` specifies whether to use the async or sync RPC endpoint. If set to `true`, the promise will not resolve until the bundle has been simulated. If set to `false`, the promise resolves on bundle submission, prior to its simulation. Our recommendation is to set this to `true` by default in order to debug responses (it will not affect how fast your bundle is submitted). The `rpcURL` endpoint is an `ip:port` string that depends on the chain you're using. Skip relayer endpoints for each chain can be found [here](https://www.notion.so/skip-protocol/Skip-Configurations-By-Chain-a6076cfa743f4ab38194096403e62f3c).
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.