/
models.go
61 lines (52 loc) · 1.11 KB
/
models.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
package onchain
import (
"math/big"
"github.com/ethereum/go-ethereum/common"
)
type TxConfig struct {
Description string
PublicAddress common.Address
PrivateKey string
ChainId *big.Int
Value *big.Int
To string
Data []byte
}
type Erc20ApprovalConfig struct {
ChainId int
Key string
Erc20Address common.Address
PublicAddress common.Address
SpenderAddress common.Address
}
type Erc20RevokeConfig struct {
ChainId int
Key string
Erc20Address common.Address
PublicAddress common.Address
SpenderAddress common.Address
AllowanceDecreaseAmount *big.Int
}
type PermitSignatureConfig struct {
FromToken string
Name string
Version string
PublicAddress string
ChainId int
Key string
Nonce int64
Deadline int64
}
type PermitParamsConfig struct {
Owner string
Spender string
Value *big.Int
Deadline int64
Signature string
}
type ApprovalType int
const (
PermitIfPossible ApprovalType = iota
PermitAlways
ApprovalAlways
)