From f5acea51273f52363182fb79b7249364315f9fa6 Mon Sep 17 00:00:00 2001 From: Sameh Abouel-saad Date: Tue, 13 Aug 2024 20:29:14 +0300 Subject: [PATCH] Add new billing events to go client --- clients/tfchain-client-go/contract_events.go | 30 ++++++++++++++++++++ clients/tfchain-client-go/events.go | 4 +++ 2 files changed, 34 insertions(+) diff --git a/clients/tfchain-client-go/contract_events.go b/clients/tfchain-client-go/contract_events.go index 556f33c9b..45a4e1c64 100644 --- a/clients/tfchain-client-go/contract_events.go +++ b/clients/tfchain-client-go/contract_events.go @@ -242,3 +242,33 @@ type NodeExtraFeeSet struct { ExtraFee types.U64 `json:"extra_fee"` Topics []types.Hash } + +type RentWaived struct { + Phase types.Phase + ContractID types.U64 `json:"contract_id"` + Topics []types.Hash +} + +type ContractGracePeriodElapsed struct { + Phase types.Phase + ContractID types.U64 `json:"contract_id"` + GracePeriod types.U64 `json:"grace_period"` + Topics []types.Hash +} + +type ContractPaymentOverdrafted struct { + Phase types.Phase + ContractID types.U64 `json:"contract_id"` + Timestamp types.U64 `json:"timestamp"` + PartialBilledAmount types.U128 `json:"partial_billed_amount"` + OverdraftedAmount types.U128 `json:"overdrafted_amount"` + Topics []types.Hash +} + +type RewardDistributed struct { + Phase types.Phase + ContractID types.U64 `json:"contract_id"` + StandardRewards types.U128 `json:"standard_rewards"` + AdditionalRewards types.U128 `json:"additional_rewards"` + Topics []types.Hash +} diff --git a/clients/tfchain-client-go/events.go b/clients/tfchain-client-go/events.go index 0910e780a..2fac4c367 100644 --- a/clients/tfchain-client-go/events.go +++ b/clients/tfchain-client-go/events.go @@ -389,6 +389,10 @@ type EventRecords struct { SmartContractModule_ServiceContractBilled []ServiceContractBilled //nolint:stylecheck,golint SmartContractModule_BillingFrequencyChanged []BillingFrequencyChanged //nolint:stylecheck,golint SmartContractModule_NodeExtraFeeSet []NodeExtraFeeSet //nolint:stylecheck,golint + SmartContractModule_RentWaived []RentWaived //nolint:stylecheck,golint + SmartContractModule_ContractGracePeriodElapsed []ContractGracePeriodElapsed //nolint:stylecheck,golint + SmartContractModule_ContractPaymentOverdrafted []ContractPaymentOverdrafted //nolint:stylecheck,golint + SmartContractModule_RewardDistributed []RewardDistributed //nolint:stylecheck,golint // farm events TfgridModule_FarmStored []FarmStored //nolint:stylecheck,golint