Skip to content

Commit 6e6b077

Browse files
author
Andrey
committed
canonical_name -> name.
1 parent 2e515f6 commit 6e6b077

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

nodebalancer/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ The endpoint returns a JSON object with the following structure:
145145
{
146146
"1": {
147147
"chain_id": "1",
148-
"canonical_name": "ethereum",
148+
"name": "ethereum",
149149
"image_url": "https://example.com/eth.png",
150150
"balances": {
151151
"0x0000000000000000000000000000000000000000": "1000000000000000000",
@@ -155,7 +155,7 @@ The endpoint returns a JSON object with the following structure:
155155
},
156156
"137": {
157157
"chain_id": "137",
158-
"canonical_name": "polygon",
158+
"name": "polygon",
159159
"image_url": "https://example.com/matic.png",
160160
"balances": {
161161
"0x0000000000000000000000000000000000000000": "4000000000000000000",
@@ -170,7 +170,7 @@ Where:
170170
- The top-level keys are chain IDs (e.g. "1" for Ethereum, "137" for Polygon)
171171
- Each chain object contains:
172172
- `chain_id`: The chain identifier as a string
173-
- `canonical_name`: The human-readable name of the chain
173+
- `name`: The human-readable name of the chain
174174
- `image_url`: URL to the chain's logo/image
175175
- `balances`: Map of token addresses to their balances
176176
- Native token (ETH, MATIC etc) is represented by the zero address: `0x0000000000000000000000000000000000000000`

nodebalancer/cmd/nodebalancer/balances.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ type TokenBalance struct {
2323
type ChainBalances map[string]string
2424

2525
type ChainInfo struct {
26-
ChainID string `json:"chain_id"`
27-
CanonicalName string `json:"canonical_name"`
28-
ImageURL string `json:"image_url"`
29-
Balances ChainBalances `json:"balances"`
26+
ChainID string `json:"chain_id"`
27+
Name string `json:"name"`
28+
ImageURL string `json:"image_url"`
29+
Balances ChainBalances `json:"balances"`
3030
}
3131

3232
// Map of blockchain -> token balances
@@ -200,10 +200,10 @@ func getBalances(ctx context.Context, address string) (BalancesResponse, error)
200200
}
201201
if len(result.balances) > 0 {
202202
response[contractsConfig[result.blockchain].ChainID] = ChainInfo{
203-
ChainID: contractsConfig[result.blockchain].ChainID,
204-
CanonicalName: result.blockchain,
205-
ImageURL: contractsConfig[result.blockchain].ImageURL,
206-
Balances: result.balances,
203+
ChainID: contractsConfig[result.blockchain].ChainID,
204+
Name: result.blockchain,
205+
ImageURL: contractsConfig[result.blockchain].ImageURL,
206+
Balances: result.balances,
207207
}
208208
}
209209
}

0 commit comments

Comments
 (0)