-
Notifications
You must be signed in to change notification settings - Fork 4
/
quote_test.go
41 lines (38 loc) · 1.08 KB
/
quote_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package go_cowswap
import (
"context"
"testing"
)
func QuoteTestBuilder(c *Client) (*QuoteResponse, error) {
sellToken := "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6"
buyToken := "0x91056D4A53E1faa1A84306D4deAEc71085394bC8"
sellAmountBeforeFee := "10000000000000000" // 0.01 ETH
o := &QuoteReq{
SellToken: sellToken,
BuyToken: buyToken,
Receiver: Options.EthAddress,
AppData: "0x0000000000000000000000000000000000000000000000000000000000000000",
PartiallyFillable: false,
SellTokenBalance: "erc20",
BuyTokenBalance: "erc20",
PriceQuality: "fast",
SigningScheme: "eip712",
OnchainOrder: false,
Kind: "sell",
SellAmountBeforeFee: sellAmountBeforeFee,
From: Options.EthAddress,
}
quoteResp, _, err := c.Quote(context.Background(), o)
if err != nil {
return nil, err
}
return quoteResp, nil
}
func TestClient_GetQuote(t *testing.T) {
client, err := NewClient(Options)
if err != nil {
t.Fatal(err)
}
res, err := QuoteTestBuilder(client)
t.Logf("%v", res)
}