-
Notifications
You must be signed in to change notification settings - Fork 7
/
Swap.go
40 lines (35 loc) · 1.16 KB
/
Swap.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
package zksync
import (
"github.com/ethereum/go-ethereum/common"
"math/big"
)
type Order struct {
AccountId uint32 `json:"accountId"`
RecipientAddress common.Address `json:"recipient"`
Nonce uint32 `json:"nonce"`
TokenBuy uint32 `json:"tokenBuy"`
TokenSell uint32 `json:"tokenSell"`
Ratio []*big.Int `json:"ratio"`
Amount *big.Int `json:"amount"`
Signature *Signature `json:"signature"`
EthereumSignature *EthSignature `json:"ethereumSignature"`
*TimeRange
}
const (
TransactionTypeSwap TransactionType = "Swap"
)
type Swap struct {
Type string `json:"type"`
SubmitterId uint32 `json:"submitterId"`
SubmitterAddress common.Address `json:"submitterAddress"`
Nonce uint32 `json:"nonce"`
Orders []*Order `json:"orders"`
Amounts []*big.Int `json:"amounts"`
Fee string `json:"fee"`
FeeToken uint32 `json:"feeToken"`
Signature *Signature `json:"signature"`
*TimeRange
}
func (t *Swap) getType() string {
return "Swap"
}