Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tzkt/api/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ func (tzkt *API) GetSetDepositsLimit(ctx context.Context, filters map[string]str
return
}

// GetSetDelegateParameters -
func (tzkt *API) GetSetDelegateParameters(ctx context.Context, filters map[string]string) (operations []data.SetDelegateParameters, err error) {
err = tzkt.json(ctx, "/v1/operations/set_delegate_parameters", filters, false, &operations)
return
}

// GetTxRollupCommit -
func (tzkt *API) GetTxRollupCommit(ctx context.Context, filters map[string]string) (operations []data.TxRollupCommit, err error) {
err = tzkt.json(ctx, "/v1/operations/tx_rollup_commit", filters, false, &operations)
Expand Down Expand Up @@ -258,6 +264,12 @@ func (tzkt *API) GetDalPublishCommitment(ctx context.Context, filters map[string
return
}

// GetDalAttestationReward -
func (tzkt *API) GetDalAttestationReward(ctx context.Context, filters map[string]string) (operations []data.DalAttestationReward, err error) {
err = tzkt.json(ctx, "/v1/operations/dal_attestation_reward", filters, false, &operations)
return
}

// GetStaking -
func (tzkt *API) GetStaking(ctx context.Context, filters map[string]string) (operations []data.Staking, err error) {
err = tzkt.json(ctx, "/v1/operations/staking", filters, false, &operations)
Expand Down
2 changes: 2 additions & 0 deletions tzkt/data/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
KindRollupReturnBond = "tx_rollup_return_bond"
KindRollupSubmitBatch = "tx_rollup_submit_batch"
KindSetDepositsLimit = "set_deposits_limit"
KindSetDelegateParameters = "set_delegate_parameters"
KindRevelationPenalty = "revelation_penalty"
KindBaking = "baking"
KindAttestationReward = "attestation_reward "
Expand All @@ -41,6 +42,7 @@ const (
KindSrRecoverBond = "sr_recover_bond"
KindSrRefute = "sr_refute"
KindDalPublishCommitment = "dal_publish_commitment"
KindDalAttestationReward = "dal_attestation_reward"
KindStaking = "staking"
)

Expand Down
44 changes: 41 additions & 3 deletions tzkt/data/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ type OperationConstraint interface {
Ballot | Proposal | Activation | TransferTicket | TxRollupCommit | TxRollupDispatchTicket |
TxRollupFinalizeCommitment | TxRollupOrigination | TxRollupRejection | TxRollupRemoveCommitment |
TxRollupReturnBond | TxRollupSubmitBatch | NonceRevelation | DoubleBaking | DoubleConsensus | SetDepositsLimit |
Baking | RevelationPenalty | AttestationReward | VdfRevelation | IncreasePaidStorage | DrainDelegate |
UpdateSecondaryKey | SmartRollupAddMessage | SmartRollupCement | SmartRollupExecute | SmartRollupOriginate |
SmartRollupPublish | SmartRollupRefute | SmartRollupRecoverBond | DalPublishCommitment | Staking
SetDelegateParameters | Baking | RevelationPenalty | AttestationReward | VdfRevelation | IncreasePaidStorage |
DrainDelegate | UpdateSecondaryKey | SmartRollupAddMessage | SmartRollupCement | SmartRollupExecute |
SmartRollupOriginate | SmartRollupPublish | SmartRollupRefute | SmartRollupRecoverBond | DalPublishCommitment |
DalAttestationReward | Staking
}

// Operation -
Expand Down Expand Up @@ -492,6 +493,27 @@ type SetDepositsLimit struct {
Quote *Quote `json:"quote,omitempty"`
}

// SetDelegateParameters -
type SetDelegateParameters struct {
ID uint64 `json:"id"`
Level uint64 `json:"level"`
Timestamp time.Time `json:"timestamp"`
Type string `json:"type"`
Hash string `json:"hash"`
Sender Address `json:"sender"`
Counter uint64 `json:"counter"`
GasLimit uint64 `json:"gasLimit"`
GasUsed uint64 `json:"gasUsed"`
StorageLimit uint64 `json:"storageLimit"`
BakerFee uint64 `json:"bakerFee"`
LimitOfStakingOverBaking uint64 `json:"limitOfStakingOverBaking"`
EdgeOfBakingOverStaking uint64 `json:"edgeOfBakingOverStaking"`
ActivationCycle uint64 `json:"activationCycle"`
Status string `json:"status"`
Errors []Error `json:"errors,omitempty"`
Quote *Quote `json:"quote,omitempty"`
}

// Migration -
type Migration struct {
Type string `json:"type"`
Expand Down Expand Up @@ -874,6 +896,22 @@ type DalPublishCommitment struct {
Status string `json:"status"`
}

// DalAttestationReward -
type DalAttestationReward struct {
Type string `json:"type"`
ID uint64 `json:"id"`
Level uint64 `json:"level"`
Timestamp time.Time `json:"timestamp"`
Block string `json:"block"`
Baker *Address `json:"baker"`
Expected int64 `json:"expected"`
RewardDelegated int64 `json:"rewardDelegated"`
RewardStakedOwn int64 `json:"rewardStakedOwn"`
RewardStakedEdge int64 `json:"rewardStakedEdge"`
RewardStakedShared int64 `json:"rewardStakedShared"`
Quote *Quote `json:"quote,omitempty"`
}

// Staking -
type Staking struct {
Type string `json:"type"`
Expand Down
4 changes: 4 additions & 0 deletions tzkt/events/tzkt.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ func parseOperations(data []byte) (any, error) {
result = append(result, &tzktData.RegisterConstant{})
case tzktData.KindSetDepositsLimit:
result = append(result, &tzktData.SetDepositsLimit{})
case tzktData.KindSetDelegateParameters:
result = append(result, &tzktData.SetDelegateParameters{})
case tzktData.KindRollupDispatchTickets:
result = append(result, &tzktData.TxRollupDispatchTicket{})
case tzktData.KindRollupFinalizeCommitment:
Expand Down Expand Up @@ -369,6 +371,8 @@ func parseOperations(data []byte) (any, error) {
result = append(result, &tzktData.SmartRollupRefute{})
case tzktData.KindDalPublishCommitment:
result = append(result, &tzktData.DalPublishCommitment{})
case tzktData.KindDalAttestationReward:
result = append(result, &tzktData.DalAttestationReward{})
case tzktData.KindStaking:
result = append(result, &tzktData.Staking{})
default:
Expand Down