/
swap.go
147 lines (118 loc) · 3.87 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
package metaswap
import (
"github.com/ethereum/go-ethereum/common"
ethTypes "github.com/ethereum/go-ethereum/core/types"
"github.com/synapsecns/sanguine/core"
"github.com/synapsecns/sanguine/services/explorer/types/swap"
"math/big"
)
// GetRaw gets the raw event logs.
func (s MetaSwapTokenSwapUnderlying) GetRaw() ethTypes.Log {
return s.Raw
}
// GetTxHash gets the unique identifier (txhash) for the event.
func (s MetaSwapTokenSwapUnderlying) GetTxHash() common.Hash {
return s.Raw.TxHash
}
// GetBlockNumber gets the block number for the event.
func (s MetaSwapTokenSwapUnderlying) GetBlockNumber() uint64 {
return s.Raw.BlockNumber
}
// GetContractAddress gets the contract address the event occurred on.
func (s MetaSwapTokenSwapUnderlying) GetContractAddress() common.Address {
return s.Raw.Address
}
// GetEventType gets the type of the swap event.
func (s MetaSwapTokenSwapUnderlying) GetEventType() swap.EventType {
return swap.TokenSwapUnderlyingEvent
}
// GetBuyer gets the buyer.
func (s MetaSwapTokenSwapUnderlying) GetBuyer() *common.Address {
return &s.Buyer
}
// GetTokensSold gets the tokens sold.
func (s MetaSwapTokenSwapUnderlying) GetTokensSold() *big.Int {
return core.CopyBigInt(s.TokensSold)
}
// GetTokensBought gets the tokens bought.
func (s MetaSwapTokenSwapUnderlying) GetTokensBought() *big.Int {
return core.CopyBigInt(s.TokensBought)
}
// GetSoldID gets the solid id.
func (s MetaSwapTokenSwapUnderlying) GetSoldID() *big.Int {
return core.CopyBigInt(s.SoldId)
}
// GetBoughtID gets the bought id.
func (s MetaSwapTokenSwapUnderlying) GetBoughtID() *big.Int {
return core.CopyBigInt(s.BoughtId)
}
// GetLPTokenAmount gets the LP token supply.
func (s MetaSwapTokenSwapUnderlying) GetLPTokenAmount() *big.Int {
return nil
}
// GetAmount puts the amount in a map with it's associated token index.
func (s MetaSwapTokenSwapUnderlying) GetAmount() map[uint8]string {
output := map[uint8]string{uint8(s.SoldId.Int64()): core.CopyBigInt(s.TokensSold).String(), uint8(s.BoughtId.Int64()): core.CopyBigInt(s.TokensBought).String()}
return output
}
// GetAmountFee gets the amount.
func (s MetaSwapTokenSwapUnderlying) GetAmountFee() map[uint8]string {
return map[uint8]string{}
}
// GetProtocolFee gets the protocol fee of the tx.
func (s MetaSwapTokenSwapUnderlying) GetProtocolFee() *big.Int {
return nil
}
// GetProvider gets the provider removing liquidity.
func (s MetaSwapTokenSwapUnderlying) GetProvider() *common.Address {
return nil
}
// GetInvariant gets the invariant.
func (s MetaSwapTokenSwapUnderlying) GetInvariant() *big.Int {
return nil
}
// GetLPTokenSupply gets LP token supply.
func (s MetaSwapTokenSwapUnderlying) GetLPTokenSupply() *big.Int {
return nil
}
// GetNewAdminFee gets the new admin fee.
func (s MetaSwapTokenSwapUnderlying) GetNewAdminFee() *big.Int {
return nil
}
// GetNewSwapFee gets the new swap fee.
func (s MetaSwapTokenSwapUnderlying) GetNewSwapFee() *big.Int {
return nil
}
// GetOldA gets the old A.
func (s MetaSwapTokenSwapUnderlying) GetOldA() *big.Int {
return nil
}
// GetNewA gets the new A.
func (s MetaSwapTokenSwapUnderlying) GetNewA() *big.Int {
return nil
}
// GetInitialTime gets the initial time.
func (s MetaSwapTokenSwapUnderlying) GetInitialTime() *big.Int {
return nil
}
// GetFutureTime gets the future time.
func (s MetaSwapTokenSwapUnderlying) GetFutureTime() *big.Int {
return nil
}
// GetCurrentA gets the current A.
func (s MetaSwapTokenSwapUnderlying) GetCurrentA() *big.Int {
return nil
}
// GetTime gets the current time.
func (s MetaSwapTokenSwapUnderlying) GetTime() *big.Int {
return nil
}
// GetReceiver gets the receiver.
func (s MetaSwapTokenSwapUnderlying) GetReceiver() *common.Address {
return nil
}
// GetEventIndex gets the index of the event in the block.
func (s MetaSwapTokenSwapUnderlying) GetEventIndex() uint64 {
return uint64(s.Raw.Index)
}
var _ swap.EventLog = &MetaSwapTokenSwapUnderlying{}