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
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [unreleased]

## [0.45.0] - 2026-02-23

- Add `GET` endpoint `/v0/genesisHash` for getting the genesis block hash for the connected network.

## [0.44.2] - 2026-01-28

- Revise `cost`/`subtotal`/`total` display for sponsored transactions.
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ cooldowns and the available balance) and get the info if an account is on any al
* `GET /v0/plt/tokenInfo/{tokenId}`: get info about a given plt token and its module state (with metadata url).
* `GET /v0/keyAccounts/{public key}`: get accounts associated with a given public key. Optionally filter the result for simple accounts.
* `POST /v0/transakOnRamp`: create a URL to initiate purchasing CCDs through the Transak on-ramp.
* `GET /v0/genesisHash`: get the genesis block hash for the connected network.

### Errors

Expand Down Expand Up @@ -1482,6 +1483,20 @@ does not behave in the expected manner or times out. (The proxy will time out a
Note: per [Transak's documentation](https://docs.transak.com/reference/create-widget-url), the `widgetUrl` is valid only for 5 minutes from the time of creation.



## Genesis block hash

A GET request to `/v0/genesisHash` returns the genesis block hash for the connected network.

Example response:

```json
{
"genesis_block":"853288fa5a45554d3cbbf8a756b85abcbfddf28e752b13223eb747209a4d0d3c"
}
```


# Deployment

The wallet proxy must have access to
Expand Down
2 changes: 1 addition & 1 deletion package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: wallet-proxy
version: 0.44.2
version: 0.45.0
github: "Concordium/concordium-wallet-proxy"
author: "Concordium"
maintainer: "developers@concordium.com"
Expand Down
8 changes: 8 additions & 0 deletions src/Proxy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ mkYesod
/v0/plt/tokenInfo/#Text PltTokenInfoR GET
/v0/keyAccounts/#Text KeyAccounts GET
/v0/transakOnRamp TransakOnRamp POST
/v0/genesisHash GenesisHash GET
|]

instance Yesod Proxy where
Expand Down Expand Up @@ -2971,6 +2972,13 @@ getPltTokenInfoR tokenId =
runGRPC (getTokenInfoFromText tokenId LastFinal) $ \tokenInfo -> do
sendResponse $ toJSON tokenInfo

-- | Returns the genesis block hash for the connected network.
getGenesisHash :: Handler TypedContent
getGenesisHash =
runGRPC getConsensusInfo $ \cInfo -> do
let genesisBlock = object ["genesis_block" .= csGenesisBlock cInfo]
sendResponse $ toJSON genesisBlock

-- | Create a Transak on-ramp session. This requires an "address" parameter to be specified, which
-- will be the address of the account to which the purchased funds will be sent.
postTransakOnRamp :: Handler TypedContent
Expand Down
Loading