/
interaction.go
64 lines (49 loc) · 1.59 KB
/
interaction.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
package model
import (
"database/sql"
"github.com/jackc/pgtype"
"github.com/warp-contracts/syncer/src/utils/arweave"
"github.com/warp-contracts/syncer/src/utils/smartweave"
"github.com/lib/pq"
)
const (
TableInteraction = "interactions"
)
type Interaction struct {
ID int `json:"id" gorm:"primaryKey"`
InteractionId arweave.Base64String
Interaction pgtype.JSONB `json:"interaction"`
BlockHeight int64
BlockId arweave.Base64String
ContractId string `json:"contractId"`
Function string
Input string
ConfirmationStatus string
InteractWrite pq.StringArray `gorm:"type:text[]"`
SortKey string
LastSortKey pgtype.Text
// Time when interaction was synced to te database
SyncTimestamp pgtype.Int8
// https://github.com/warp-contracts/gateway/blob/main/src/gateway/tasks/syncTransactions.ts#L175
Evolve sql.NullString
// https://github.com/warp-contracts/gateway/blob/ef7aad549045943f0127542cce36cd94a966bdc7/src/gateway/tasks/syncTransactions.ts#L187
Testnet sql.NullString
// Hardcoded arsyncer
Source string
// Wallet address, 44 characters
Owner string
// Those fields aren't used anymore, currenct version waits 10 blocks with the synchronization
// ConfirmingPeer string
// ConfirmedAtHeight int64
// Confirmations string
// Not needed:
BundlerTxId string
// LastSortKey string
BlockTimestamp int64
}
func (self *Interaction) GetInteraction() *smartweave.Interaction {
return &smartweave.Interaction{}
}
func (Interaction) TableName() string {
return TableInteraction
}