Skip to content

node-real/bundle-go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bundle Go SDK

Instruction

The BUNDLE-GO-SDK provides enhanced transaction privacy and atomicity for the BNB Smart Chain (BSC) network. By implementing the BEP322 standard, the following capabilities are provided:

  1. Privacy. All transactions sent through this API will not be propagated on the P2P network, hence, they won't be detected by any third parties. This effectively prevents transactions from being targeted by sandwich attacks.
  2. Batch transaction. Multiple transactions can be consolidated into a single 'bundle', which can then be transmitted through just one API call. The sequence of transactions within a block, as well as the order within a bundle, can be assured to maintain impeccable consistency.
  3. Atomicity. Transactions within a bundle either all get included on the chain, or none at all. There's no such scenario where only a portion of the transactions are included on chain.
  4. Gas protection. If a single transaction within a bundle fails, the entire bundle is guaranteed not to be packaged onto the blockchain. This mechanism safeguards users from unnecessary gas expenditure.

Requirement

Go version above 1.21

Getting started

To get started working with the SDK setup your project for Go modules, and retrieve the SDK dependencies with go get. This example shows how you can use the bundle go SDK to interact with the bundle apis on bsc,

Initialize Project

$ mkdir ~/hello_bundle
$ cd ~/hello_bundle
$ go mod init hello_bundle

Add SDK Dependencies

$ go get github.com/node-real/bundle-go-sdk
package main

import (
	"context"
	"log"

	"github.com/ethereum/go-ethereum/ethclient"
	"github.com/ethereum/go-ethereum/rpc"
)

func main() {
	endpointUrl := "https://bsc-testnet.nodereal.io/v1/{{your api key}}"

	rpcCli, err := rpc.Dial(endpointUrl)
	if err != nil {
		panic(err)
	}

	bundleCli := bundleclient.New(rpcCli)
}

Quick Start Examples

The examples directory provides a wealth of examples to guide users in using the SDK's various features

Config Examples

You need to modify the ENV variables to use the example:

APIKEY: your meganode apikey with growth tier and bundle-package subscribed refer here to subscribe Address: your wallet address which used as toAddress of transaction PrivateKey: your privateKey which used to sign transactions

Run Examples

The steps to run example are as follows

make examples
cd example
./example 

Reference

BSC MEV

Meganode API Marketplace: subscribe those Apis and explore more packages.

Api introduction: to get details about those Apis

About

No description, website, or topics provided.

Resources

License

MIT, LGPL-3.0 licenses found

Licenses found

MIT
LICENSE
LGPL-3.0
COPYING

Stars

Watchers

Forks

Packages

No packages published