to be
a problem slover

simple go flashbot request

    request := ethRequest{
        ID:      1,
        JSONRPC: "2.0",
        Method:  "eth_sendBundle",
        Params:  []interface{}{encodedTxs, "latest", 0, 0},
    }

    body, err := json.Marshal(request)
    if err != nil {
        return err
    }
    req, err := http.NewRequest("POST", mevRelayServer, bytes.NewBuffer(body))
    if err != nil {
        log.Fatalf("%s", err)
    }

    req.Header.Set("Content-Type", "application/json")
    sig, err := crypto.Sign(crypto.Keccak256(body), pk)
    signature := addr.Hex() + ":" + hexutil.Encode(sig)
    req.Header.Set("X-Flashbots-Signature", signature)
赞(2) 打赏
欢迎转载,注明出处:刘世明的博客 » simple go flashbot request

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下作者

支付宝扫一扫打赏

微信扫一扫打赏