func (b *BTCE) Orders() (orders []s.Order, err error) {
	var reply map[string]struct {
		Pair             s.Pair
		Type             s.TradeType
		Amount           float64
		Rate             float64
		TimestampCreated int64 `json:"timestamp_created"`
		Status           int
	}
	err = b.request("ActiveOrders", map[string]interface{}{}, &reply)
	for id, order := range reply {
		var o s.Order
		o.Id, _ = strconv.ParseInt(id, 10, 64)
		o.Pair = order.Pair
		o.Type = order.Type
		o.Price = order.Rate
		o.Remain = order.Amount
		o.Amount = order.Amount
		o.Timestamp = order.TimestampCreated
		orders = append(orders, o)
	}
	return
}
Orders will return your active orders for all pairs.
package btce
import (
	"bytes"
	"crypto/hmac"
	"crypto/sha512"
	"encoding/hex"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	"strconv"
	"strings"
	"time"
	s "github.com/thinxer/coincross"
)
const (
	PRIVATE_API = "https://btc-e.com/tapi"
	PUBLIC_API  = "https://btc-e.com/api"
)
type BTCE struct {
	key    string
	secret []byte
	client *http.Client
}
func New(apikey, secret string, transport *http.Transport) *BTCE {
	return &BTCE{apikey, []byte(secret), &http.Client{
		Transport: transport,
	}}
}
func (b *BTCE) request(method string, params map[string]interface{}, v interface{}) (err error) {
	params["method"] = method
	params["nonce"] = time.Now().Unix()
	form := url.Values{}
	for key, value := range params {
		form.Set(key, fmt.Sprintf("%v", value))
	}
	data := []byte(form.Encode())
	h := hmac.New(sha512.New, b.secret)
	h.Write(data)
	sign := hex.EncodeToString(h.Sum(nil))
	request, _ := http.NewRequest("POST", PRIVATE_API, bytes.NewReader(data))
	request.Header.Set("Content-Type", "application/x-www-form-urlencoded")
	request.Header.Set("Key", b.key)
	request.Header.Set("Sign", sign)
	response, err := b.client.Do(request)
	if err == nil {
		var body struct {
			Success int
			Return  interface{}
			Error   string
		}
		body.Return = v
		err = decode(response.Body, &body)
		if err == nil {
			if body.Success == 0 {
				return fmt.Errorf("BTC-E Error: %v", body.Error)
			}
		}
	}
	return
}
type Funds map[string]float64
type AccountInfo struct {
	Funds  Funds
	Rights struct {
		Info     int
		Trade    int
		Withdraw int
	}
	TransactionCount int   `json:"transaction_count"`
	OpenOrders       int   `json:"open_orders"`
	ServerTime       int64 `json:"server_time"`
}
func (b *BTCE) AccountInfo() (info *AccountInfo, err error) {
	info = new(AccountInfo)
	err = b.request("getInfo", map[string]interface{}{}, info)
	return
}
func (b *BTCE) Balance() (balance map[s.Symbol]float64, err error) {
	if info, err := b.AccountInfo(); err == nil {
		balance = make(map[s.Symbol]float64)
		for symbol, amount := range info.Funds {
			balance[s.Symbol(strings.ToUpper(symbol))] = amount
		}
	}
	return
}
func (b *BTCE) Trade(tradeType s.TradeType, pair s.Pair, price, amount float64) (orderId int64, err error) {
	var reply struct {
		Received float64
		Remains  float64
		OrderId  int64 `json:"order_id"`
		Funds    Funds
	}
	err = b.request("Trade", map[string]interface{}{
		"pair":   pair.LowerString(),
		"type":   strings.ToLower(tradeType.String()),
		"rate":   price,
		"amount": amount,
	}, &reply)
	if err == nil {
		orderId = reply.OrderId
	}
	return
}
func (b *BTCE) Cancel(orderId int64) (success bool, err error) {
	var reply struct {
		OrderId int64 `json:"order_id"`
		Funds   Funds
	}
	err = b.request("CancelOrder", map[string]interface{}{"order_id": orderId}, &reply)
	success = reply.OrderId == orderId
	return
}
func (b *BTCE) Transactions(limit int) (transactions []s.Transaction, err error) {
	var reply map[string]struct {
		Type      int
		Amount    float64
		Currency  string
		Desc      string
		Status    int
		Timestamp int64
	}
	if err = b.request("TransHistory", map[string]interface{}{"count": limit, "order": "DESC"}, &reply); err != nil {
		return
	}
	for id, tr := range reply {
		var t s.Transaction
		t.Id, _ = strconv.ParseInt(id, 10, 64)
		t.Timestamp = tr.Timestamp
		t.Amounts = map[s.Symbol]float64{
			s.Symbol(strings.ToUpper(tr.Currency)): tr.Amount,
		}
		t.Descritpion = tr.Desc
		transactions = append(transactions, t)
	}
	return
}