-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: bridge_getClaims
endpoint
#210
Conversation
174228c
to
66ab135
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ordering by descending GlobalIndex
seems not to be working properly.
cast rpc --rpc-url http://127.0.0.1:32793 bridge_getClaims 1 | jq
Note that the first entry is the one with the lower GlobalIndex
:
{
"claims": [
{
"GlobalIndex": 18446744073709551617,
"DestinationNetwork": 1,
"TxHash": "0x02152c9059502b05d5fa68cb796be72eba32c9b2504c004a775a80008cbc0766",
"Amount": 100000000000000000,
"BlockNum": 66,
"FromAddress": "0x83f138b325164b162b320f797b57f6f7e235abac",
"DestinationAddress": "0x85da99c8a7c2c95964c8efd687e95e632fc533d6",
"OriginAddress": "0xb26f25ed6bcb8dd7c1c7266e12fa4aaff48fc892",
"OriginNetwork": 0,
"BlockTimestamp": 1740130523
},
{
"GlobalIndex": 18446744073709551618,
"DestinationNetwork": 1,
"TxHash": "0x58358644bb5ca46b0d4f3e21bfc2ff85a536eddfdd21f3441a7784c9139aa734",
"Amount": 100000000000000000,
"BlockNum": 110,
"FromAddress": "0x83f138b325164b162b320f797b57f6f7e235abac",
"DestinationAddress": "0x85da99c8a7c2c95964c8efd687e95e632fc533d6",
"OriginAddress": "0x62bf798edae1b7fde524276864757cc424a5c3dd",
"OriginNetwork": 0,
"BlockTimestamp": 1740130656
}
],
"count": 2
}
Since the global index is a composite key, let's discuss with the apps team, if would it make more sense to split it into the following fields using the function
For example, this is the response for the claims endpoint of the legacy bridge service
{
"claims": [
{
"index": 2,
"orig_net": 0,
"orig_addr": "0x62bf798EdaE1B7FDe524276864757cc424A5c3dD",
"amount": "100000000000000000",
"network_id": 1,
"dest_addr": "0x85dA99c8a7C2C95964c8EfD687E95E632Fc533D6",
"block_num": "0",
"tx_hash": "0x58358644bb5ca46b0d4f3e21bfc2ff85a536eddfdd21f3441a7784c9139aa734",
"rollup_index": 0,
"mainnet_flag": true
},
{
"index": 1,
"orig_net": 0,
"orig_addr": "0xb26F25eD6bcb8dd7C1c7266E12FA4aaFF48fc892",
"amount": "100000000000000000",
"network_id": 1,
"dest_addr": "0x85dA99c8a7C2C95964c8EfD687E95E632Fc533D6",
"block_num": "0",
"tx_hash": "0x02152c9059502b05d5fa68cb796be72eba32c9b2504c004a775a80008cbc0766",
"rollup_index": 0,
"mainnet_flag": true
}
],
"total_cnt": "2"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Description
This PR exposes a JSON-RPC endpoint to fetch bridge claims. It returns all claimed transactions on the network, sorted in descending order by globalIndex, with support for pagination.
Fixes #228