Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.24", "1.25"]
go: ["1.25", "1.26"]
steps:
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 #v5.5.0
Expand All @@ -18,7 +18,7 @@ jobs:
- name: Check out source
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
- name: Install Linters
run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.4.0"
run: "curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.11.4"
- name: Build
run: go build ./...
- name: Test
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build
FROM golang:1.25-alpine AS builder
FROM golang:1.26-alpine AS builder

WORKDIR $GOPATH/src/github.com/decred/dcrwebapi
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ISC License

Copyright (c) 2017-2025 The Decred developers
Copyright (c) 2017-2026 The Decred developers

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
67 changes: 67 additions & 0 deletions dcrdata.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package main

// The types in this file are returned by the dcrdata API. They are copied from
// the decred/dcrdata repo to prevent having to import it and all of its
// dependencies.

// TreasuryBalance is the current balance, spent amount, and tx count for the
// treasury.
type TreasuryBalance struct {
Balance int64 `json:"balance"`
// TxCount should probably be called OutputCount.
TxCount int64 `json:"tx_count"`
AddCount int64 `json:"add_count"`
Added int64 `json:"added"`
SpendCount int64 `json:"spend_count"`
Spent int64 `json:"spent"`
TGenCount int64 `json:"tgen_count"`
TGen int64 `json:"tbase"`
ImmatureCount int64 `json:"immature_count"`
Immature int64 `json:"immature"`
}

// CoinSupply models the coin supply at a certain best block.
type CoinSupply struct {
Height int64 `json:"block_height"`
Hash string `json:"block_hash"`
Mined int64 `json:"supply_mined"`
Ultimate int64 `json:"supply_ultimate"`
}

// BlockDataBasic models primary information about a block.
type BlockDataBasic struct {
Height uint32 `json:"height"`
Size uint32 `json:"size"`
Hash string `json:"hash"`
Difficulty float64 `json:"diff"`
StakeDiff float64 `json:"sdiff"`
Time int64 `json:"time"`
NumTx uint32 `json:"txlength"`
MiningFee *int64 `json:"fees,omitempty"`
TotalSent *int64 `json:"total_sent,omitempty"`
// TicketPoolInfo may be nil for side chain blocks.
PoolInfo *TicketPoolInfo `json:"ticket_pool,omitempty"`
}

// BlockSubsidies contains the block reward proportions for a certain block
// height. The stake_reward is per vote, while total is for a certain number of
// votes.
type BlockSubsidies struct {
BlockNum int64 `json:"height"`
BlockHash string `json:"hash,omitempty"`
Work int64 `json:"work_reward"`
Stake int64 `json:"stake_reward"`
NumVotes int16 `json:"num_votes,omitempty"`
TotalStake int64 `json:"stake_reward_total,omitempty"`
Tax int64 `json:"project_subsidy"`
Total int64 `json:"total,omitempty"`
}

// TicketPoolInfo models data about ticket pool
type TicketPoolInfo struct {
Height uint32 `json:"height"`
Size uint32 `json:"size"`
Value float64 `json:"value"`
ValAvg float64 `json:"valavg"`
Winners []string `json:"winners"`
}
38 changes: 3 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,43 +1,11 @@
module github.com/decred/dcrwebapi

go 1.23.0
go 1.25.0

require (
github.com/decred/dcrd/dcrutil/v4 v4.0.2
github.com/decred/dcrdata/v6 v6.0.0
github.com/decred/vspd/types/v3 v3.0.0
github.com/gorilla/handlers v1.5.2
golang.org/x/mod v0.37.0
)

require (
decred.org/dcrwallet v1.7.1 // indirect
github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 // indirect
github.com/dchest/siphash v1.2.3 // indirect
github.com/decred/base58 v1.0.5 // indirect
github.com/decred/dcrd/blockchain/stake/v3 v3.0.1 // indirect
github.com/decred/dcrd/blockchain/standalone/v2 v2.2.0 // indirect
github.com/decred/dcrd/chaincfg/chainhash v1.0.4 // indirect
github.com/decred/dcrd/chaincfg/v3 v3.2.1 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
github.com/decred/dcrd/crypto/ripemd160 v1.0.2 // indirect
github.com/decred/dcrd/database/v2 v2.0.3 // indirect
github.com/decred/dcrd/dcrec v1.0.1 // indirect
github.com/decred/dcrd/dcrec/edwards/v2 v2.0.3 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v3 v3.0.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/decred/dcrd/dcrjson/v3 v3.1.1 // indirect
github.com/decred/dcrd/dcrutil/v3 v3.0.1 // indirect
github.com/decred/dcrd/rpc/jsonrpc/types/v2 v2.3.1 // indirect
github.com/decred/dcrd/txscript/v3 v3.0.1 // indirect
github.com/decred/dcrd/txscript/v4 v4.1.1 // indirect
github.com/decred/dcrd/wire v1.7.0 // indirect
github.com/decred/slog v1.2.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sys v0.31.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
lukechampine.com/blake3 v1.3.0 // indirect
)
require github.com/felixge/httpsnoop v1.1.0 // indirect
Loading
Loading