You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.9KB

  1. package main
  2. import "encoding/json"
  3. import "github.com/joeshaw/iso8601"
  4. type BlockNumber uint64
  5. type OperationObject struct {
  6. BlockNumber BlockNumber `json:"block"`
  7. OpInTx int `json:"op_in_trx"`
  8. Operation []json.RawMessage `json:"op"`
  9. Timestamp iso8601.Time `json:"timestamp"`
  10. TransactionID string `json:"trx_id"`
  11. TransactionInBlock BlockNumber `json:"trx_in_block"`
  12. VirtualOperation int `json:"virtual_op"`
  13. }
  14. type GetOpsInBlockRequestParams struct {
  15. BlockNum BlockNumber
  16. VirtualOps bool
  17. }
  18. func (r *GetOpsInBlockRequestParams) MarshalJSON() ([]byte, error) {
  19. arr := []interface{}{r.BlockNum, r.VirtualOps}
  20. return json.Marshal(arr)
  21. }
  22. type DynamicGlobalProperties struct {
  23. ConfidentialSbdSupply string `json:"confidential_sbd_supply"`
  24. ConfidentialSupply string `json:"confidential_supply"`
  25. CurrentAslot int `json:"current_aslot"`
  26. CurrentSbdSupply string `json:"current_sbd_supply"`
  27. CurrentSupply string `json:"current_supply"`
  28. CurrentWitness string `json:"current_witness"`
  29. DelegationReturnPeriod int `json:"delegation_return_period"`
  30. HeadBlockID string `json:"head_block_id"`
  31. HeadBlockNumber int `json:"head_block_number"`
  32. LastIrreversibleBlockNum BlockNumber `json:"last_irreversible_block_num"`
  33. MaximumBlockSize int `json:"maximum_block_size"`
  34. NumPowWitnesses int `json:"num_pow_witnesses"`
  35. ParticipationCount int `json:"participation_count"`
  36. PendingRewardedVestingShares string `json:"pending_rewarded_vesting_shares"`
  37. PendingRewardedVestingSteem string `json:"pending_rewarded_vesting_steem"`
  38. RecentSlotsFilled string `json:"recent_slots_filled"`
  39. ReverseAuctionSeconds int `json:"reverse_auction_seconds"`
  40. SbdInterestRate int `json:"sbd_interest_rate"`
  41. SbdPrintRate int `json:"sbd_print_rate"`
  42. SbdStartPercent int `json:"sbd_start_percent"`
  43. SbdStopPercent int `json:"sbd_stop_percent"`
  44. Time string `json:"time"`
  45. TotalPow int `json:"total_pow"`
  46. TotalRewardFundSteem string `json:"total_reward_fund_steem"`
  47. TotalRewardShares2 string `json:"total_reward_shares2"`
  48. TotalVestingFundSteem string `json:"total_vesting_fund_steem"`
  49. TotalVestingShares string `json:"total_vesting_shares"`
  50. VirtualSupply string `json:"virtual_supply"`
  51. VotePowerReserveRate int `json:"vote_power_reserve_rate"`
  52. }
  53. type GetOpsInBlockResponse *[]OperationObject
  54. type GetDynamicGlobalPropertiesResponse *DynamicGlobalProperties