forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Sui Rosetta] - Delegation and balance queries (MystenLabs#7282)
MystenLabs#6423 MystenLabs#6422 This PR added 2 main features to Sui-rosetta, 1, Account balance query for `LockedSui`, `DelegatedSui` and `PendingDelegation` by using rosetta's sub account. 2, added `Delegation` operation which allow user to delegate Sui and Locked Sui to a validator using rosetta api. example rosette delegation operation request: ``` curl --location --request POST '0.0.0.0:9003/construction/preprocess' \ --header 'Content-Type: application/json' \ --data-raw '{ "network_identifier": { "blockchain": "sui", "network": "localnet" }, "operations": [ { "operation_identifier": { "index": 0 }, "type": "Delegation", "account": { "address": "0xb5e92aa6556fa0c27c4f6b5a659768b2d4141680" }, "amount": { "value": "-1000000", "currency": { "symbol": "SUI", "decimals": 9 } }, "metadata": { "Delegation": { "validator": "0x4a6f0a87a4cd4ba13184a924d8f73e8c081113cf" } } } ] }' ``` example rosetta balance query request: ``` curl --location --request POST '0.0.0.0:9002/account/balance' \ --header 'Content-Type: application/json' \ --data-raw '{ "network_identifier": { "blockchain": "sui", "network": "localnet" }, "account_identifier": { "address": "0xe357b7fb38d261eff3818337f6ba40c156b203cd", "sub_account": { "address": "PendingDelegation" } } }' ``` example rosetta balance query response: ``` { "block_identifier": { "index": 37, "hash": "7zZHnQuvMDjDeCxNt7Nb77WbWXmzE2uSaxbi5fs1pzzw" }, "balances": [ { "value": "1000000", "currency": { "symbol": "SUI", "decimals": 9 } } ] } ```
- Loading branch information
1 parent
2535c87
commit 89d2141
Showing
10 changed files
with
744 additions
and
149 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.