Skip to content

Commit 8cafb8a

Browse files
committed
Added SetDelegateParameters and DalAttestationReward ops
1 parent 6091b95 commit 8cafb8a

File tree

4 files changed

+59
-3
lines changed

4 files changed

+59
-3
lines changed

tzkt/api/operations.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ func (tzkt *API) GetSetDepositsLimit(ctx context.Context, filters map[string]str
114114
return
115115
}
116116

117+
// GetSetDelegateParameters -
118+
func (tzkt *API) GetSetDelegateParameters(ctx context.Context, filters map[string]string) (operations []data.SetDelegateParameters, err error) {
119+
err = tzkt.json(ctx, "/v1/operations/set_delegate_parameters", filters, false, &operations)
120+
return
121+
}
122+
117123
// GetTxRollupCommit -
118124
func (tzkt *API) GetTxRollupCommit(ctx context.Context, filters map[string]string) (operations []data.TxRollupCommit, err error) {
119125
err = tzkt.json(ctx, "/v1/operations/tx_rollup_commit", filters, false, &operations)
@@ -258,6 +264,12 @@ func (tzkt *API) GetDalPublishCommitment(ctx context.Context, filters map[string
258264
return
259265
}
260266

267+
// GetDalAttestationReward -
268+
func (tzkt *API) GetDalAttestationReward(ctx context.Context, filters map[string]string) (operations []data.DalAttestationReward, err error) {
269+
err = tzkt.json(ctx, "/v1/operations/dal_attestation_reward", filters, false, &operations)
270+
return
271+
}
272+
261273
// GetStaking -
262274
func (tzkt *API) GetStaking(ctx context.Context, filters map[string]string) (operations []data.Staking, err error) {
263275
err = tzkt.json(ctx, "/v1/operations/staking", filters, false, &operations)

tzkt/data/consts.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const (
2626
KindRollupReturnBond = "tx_rollup_return_bond"
2727
KindRollupSubmitBatch = "tx_rollup_submit_batch"
2828
KindSetDepositsLimit = "set_deposits_limit"
29+
KindSetDelegateParameters = "set_delegate_parameters"
2930
KindRevelationPenalty = "revelation_penalty"
3031
KindBaking = "baking"
3132
KindAttestationReward = "attestation_reward "
@@ -41,6 +42,7 @@ const (
4142
KindSrRecoverBond = "sr_recover_bond"
4243
KindSrRefute = "sr_refute"
4344
KindDalPublishCommitment = "dal_publish_commitment"
45+
KindDalAttestationReward = "dal_attestation_reward"
4446
KindStaking = "staking"
4547
)
4648

tzkt/data/operations.go

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ type OperationConstraint interface {
1414
Ballot | Proposal | Activation | TransferTicket | TxRollupCommit | TxRollupDispatchTicket |
1515
TxRollupFinalizeCommitment | TxRollupOrigination | TxRollupRejection | TxRollupRemoveCommitment |
1616
TxRollupReturnBond | TxRollupSubmitBatch | NonceRevelation | DoubleBaking | DoubleConsensus | SetDepositsLimit |
17-
Baking | RevelationPenalty | AttestationReward | VdfRevelation | IncreasePaidStorage | DrainDelegate |
18-
UpdateSecondaryKey | SmartRollupAddMessage | SmartRollupCement | SmartRollupExecute | SmartRollupOriginate |
19-
SmartRollupPublish | SmartRollupRefute | SmartRollupRecoverBond | DalPublishCommitment | Staking
17+
SetDelegateParameters | Baking | RevelationPenalty | AttestationReward | VdfRevelation | IncreasePaidStorage |
18+
DrainDelegate | UpdateSecondaryKey | SmartRollupAddMessage | SmartRollupCement | SmartRollupExecute |
19+
SmartRollupOriginate | SmartRollupPublish | SmartRollupRefute | SmartRollupRecoverBond | DalPublishCommitment |
20+
DalAttestationReward | Staking
2021
}
2122

2223
// Operation -
@@ -492,6 +493,27 @@ type SetDepositsLimit struct {
492493
Quote *Quote `json:"quote,omitempty"`
493494
}
494495

496+
// SetDelegateParameters -
497+
type SetDelegateParameters struct {
498+
ID uint64 `json:"id"`
499+
Level uint64 `json:"level"`
500+
Timestamp time.Time `json:"timestamp"`
501+
Type string `json:"type"`
502+
Hash string `json:"hash"`
503+
Sender Address `json:"sender"`
504+
Counter uint64 `json:"counter"`
505+
GasLimit uint64 `json:"gasLimit"`
506+
GasUsed uint64 `json:"gasUsed"`
507+
StorageLimit uint64 `json:"storageLimit"`
508+
BakerFee uint64 `json:"bakerFee"`
509+
LimitOfStakingOverBaking uint64 `json:"limitOfStakingOverBaking"`
510+
EdgeOfBakingOverStaking uint64 `json:"edgeOfBakingOverStaking"`
511+
ActivationCycle uint64 `json:"activationCycle"`
512+
Status string `json:"status"`
513+
Errors []Error `json:"errors,omitempty"`
514+
Quote *Quote `json:"quote,omitempty"`
515+
}
516+
495517
// Migration -
496518
type Migration struct {
497519
Type string `json:"type"`
@@ -874,6 +896,22 @@ type DalPublishCommitment struct {
874896
Status string `json:"status"`
875897
}
876898

899+
// DalAttestationReward -
900+
type DalAttestationReward struct {
901+
Type string `json:"type"`
902+
ID uint64 `json:"id"`
903+
Level uint64 `json:"level"`
904+
Timestamp time.Time `json:"timestamp"`
905+
Block string `json:"block"`
906+
Baker *Address `json:"baker"`
907+
Expected int64 `json:"expected"`
908+
RewardDelegated int64 `json:"rewardDelegated"`
909+
RewardStakedOwn int64 `json:"rewardStakedOwn"`
910+
RewardStakedEdge int64 `json:"rewardStakedEdge"`
911+
RewardStakedShared int64 `json:"rewardStakedShared"`
912+
Quote *Quote `json:"quote,omitempty"`
913+
}
914+
877915
// Staking -
878916
type Staking struct {
879917
Type string `json:"type"`

tzkt/events/tzkt.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ func parseOperations(data []byte) (any, error) {
321321
result = append(result, &tzktData.RegisterConstant{})
322322
case tzktData.KindSetDepositsLimit:
323323
result = append(result, &tzktData.SetDepositsLimit{})
324+
case tzktData.KindSetDelegateParameters:
325+
result = append(result, &tzktData.SetDelegateParameters{})
324326
case tzktData.KindRollupDispatchTickets:
325327
result = append(result, &tzktData.TxRollupDispatchTicket{})
326328
case tzktData.KindRollupFinalizeCommitment:
@@ -369,6 +371,8 @@ func parseOperations(data []byte) (any, error) {
369371
result = append(result, &tzktData.SmartRollupRefute{})
370372
case tzktData.KindDalPublishCommitment:
371373
result = append(result, &tzktData.DalPublishCommitment{})
374+
case tzktData.KindDalAttestationReward:
375+
result = append(result, &tzktData.DalAttestationReward{})
372376
case tzktData.KindStaking:
373377
result = append(result, &tzktData.Staking{})
374378
default:

0 commit comments

Comments
 (0)