trades

command
v0.0.0-...-2a4f382 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

README

Fetch User Trades

package main

import (
	"context"
	"fmt"
	cowswap "github.com/itsahedge/go-cowswap"
)

func main() {
	network := "goerli"
	rpc := "https://eth-goerli-rpc.gateway.pokt.network"
	host := "https://api.cow.fi/goerli/api/v1"
	
	options := cowswap.ConfigOpts{
		Network: network,
		Host:    host,
		RpcUrl:  rpc,
	}
	client, err := cowswap.NewClient(options)
	owner := "0xcea7fb5b582c07129b8dc2fec4d4e5435b0968ff"
	opts := &cowswap.GetTrades{
		Owner: owner,
	}
	res, code, err := client.GetTrades(context.Background(), opts)
	if err != nil {
		fmt.Printf("GetTrades err: %v", err)
	}
	fmt.Printf("statusCode: %v \n", code)
	fmt.Printf("%v \n", res)
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL