@@ -3,6 +3,8 @@ package api
33import (
44 stdJSON "encoding/json"
55 "time"
6+
7+ "github.com/shopspring/decimal"
68)
79
810const (
@@ -39,12 +41,112 @@ type Parameters struct {
3941 Value stdJSON.RawMessage `json:"value"`
4042}
4143
44+ // Origination -
45+ type Origination struct {
46+ Type string `json:"type"`
47+ ID uint64 `json:"id"`
48+ Level uint64 `json:"level"`
49+ Timestamp time.Time `json:"timestamp"`
50+ Block string `json:"block"`
51+ Hash string `json:"hash"`
52+ Counter uint64 `json:"counter"`
53+ Sender Address `json:"sender"`
54+ Initiator Address `json:"initiator"`
55+ Nonce * uint64 `json:"nonce,omitempty"`
56+ GasLimit uint64 `json:"gasLimit"`
57+ GasUsed uint64 `json:"gasUsed"`
58+ StorageLimit uint64 `json:"storageLimit"`
59+ StorageUsed uint64 `json:"storageUsed"`
60+ BakerFee uint64 `json:"bakerFee"`
61+ StorageFee uint64 `json:"storageFee"`
62+ AllocationFee uint64 `json:"allocationFee"`
63+ ContractBalance uint64 `json:"contractBalance"`
64+ ContractManager Address `json:"contractManager"`
65+ ContractDelegate Address `json:"contractDelegate"`
66+ Status string `json:"status"`
67+ Originated Contract `json:"originatedContract"`
68+ Errors []Error `json:"errors,omitempty"`
69+ }
70+
71+ // Transaction -
72+ type Transaction struct {
73+ Type string `json:"type"`
74+ Sender Address `json:"sender"`
75+ Target Address `json:"target"`
76+ Initiator Address `json:"initiator"`
77+ Amount decimal.Decimal `json:"amount"`
78+ Parameter * Parameters `json:"parameter"`
79+ Timestamp time.Time `json:"timestamp"`
80+ ID uint64 `json:"id"`
81+ Level uint64 `json:"level"`
82+ Counter uint64 `json:"counter"`
83+ GasLimit uint64 `json:"gasLimit"`
84+ GasUsed uint64 `json:"gasUsed"`
85+ StorageLimit uint64 `json:"storageLimit"`
86+ StorageUsed uint64 `json:"storageUsed"`
87+ BakerFee uint64 `json:"bakerFee"`
88+ StorageFee uint64 `json:"storageFee"`
89+ AllocationFee uint64 `json:"allocationFee"`
90+ Status string `json:"status"`
91+ Parameters string `json:"parameters"`
92+ Block string `json:"block"`
93+ Hash string `json:"hash"`
94+ HasInternals bool `json:"hasInternals"`
95+ }
96+
97+ // Delegation -
98+ type Delegation struct {
99+ Block string `json:"block"`
100+ Hash string `json:"hash"`
101+ Type string `json:"type"`
102+ Status string `json:"status"`
103+ Sender Address `json:"sender"`
104+ NewDelegate Address `json:"newDelegate"`
105+ Timestamp time.Time `json:"timestamp"`
106+ Amount decimal.Decimal `json:"amount"`
107+ ID uint64 `json:"id"`
108+ Level uint64 `json:"level"`
109+ Counter uint64 `json:"counter"`
110+ GasLimit uint64 `json:"gasLimit"`
111+ GasUsed uint64 `json:"gasUsed"`
112+ BakerFee uint64 `json:"bakerFee"`
113+ }
114+
115+ // Reveal -
116+ type Reveal struct {
117+ Type string `json:"type"`
118+ Status string `json:"status"`
119+ Block string `json:"block"`
120+ Hash string `json:"hash"`
121+ Timestamp time.Time `json:"timestamp"`
122+ Sender Address `json:"sender"`
123+ ID uint64 `json:"id"`
124+ Level uint64 `json:"level"`
125+ Counter uint64 `json:"counter"`
126+ GasLimit uint64 `json:"gasLimit"`
127+ GasUsed uint64 `json:"gasUsed"`
128+ BakerFee uint64 `json:"bakerFee"`
129+ }
130+
131+ // Error -
132+ type Error struct {
133+ Type string `json:"type"`
134+ }
135+
42136// Address -
43137type Address struct {
44138 Alias string `json:"alias"`
45139 Address string `json:"address"`
46140}
47141
142+ // Contract -
143+ type Contract struct {
144+ Kind string `json:"kind"`
145+ Address string `json:"address"`
146+ TypeHash int `json:"typeHash"`
147+ CodeHash int `json:"codeHash"`
148+ }
149+
48150// Block -
49151type Block struct {
50152 Level uint64 `json:"level"`
0 commit comments