-
Notifications
You must be signed in to change notification settings - Fork 624
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
Better tx
RPC API
#1299
Comments
$ http post http://rpc.nearprotocol.com/ jsonrpc=2.0 id=dontcare method=block 'params:=[173592]'
{
"id": "dontcare",
"jsonrpc": "2.0",
"result": {
"header": {
"approval_mask": [
false,
true
],
"approval_sigs": [
"ed25519:5tn8MtX8yQ2qzdRs8W6Homz4KWS2kQcoEnLXBXEa9qRUczAfYqUD3R3QxRAoWA9AwM1niauyt6VaQFn8sijEqkhS"
],
"epoch_hash": "Di12sDSYsUH6ocaMf9NPKcBrUikEiCRPNkydKgZgEi8u",
"hash": "BZnGxodahyU3Ssuh5dVNbAeBt3wqXTu8f8mLeo5cb4cH",
"height": 173592,
"prev_hash": "HhH72gqstfm5KGW6wf8nFa1tVjfeGjhsmv1NSxLutAdQ",
"prev_state_root": "ABh7ZArZtVvEghH8SNXrDaTAMCFYzEayFFkg61j1qzc9",
"signature": "ed25519:3CA8HwcmPDSdUuCdjBeFWP8AvK36yQ1PhDRz4PgF8RLT3fgQm4GoH242j5QNJvXrdws8ASygWJtaAqrUkHjug52X",
"timestamp": 1568047128577482804,
"total_weight": 208940,
"tx_root": "11111111111111111111111111111111",
"validator_proposals": []
},
"transactions": [
{
"actions": [
"CreateAccount",
{
"Transfer": {
"deposit": "10000000000000000000"
}
},
{
"AddKey": {
"access_key": {
"nonce": 0,
"permission": "FullAccess"
},
"public_key": "ed25519:J2Jrr74mgHxL5AmHeRSesWPgCA8jqcGqcEGKC2EEu59t"
}
}
],
"hash": "2ZBygTrowP7MTeRQ8rXp8v84benMTaYbHhwFw5w85CTS",
"nonce": 110,
"public_key": "ed25519:oNCFEmRotRHTySKqmAwifNZ8VRpYS973p8cL61y7eiE",
"receiver_id": "studio-n5ubb8npy",
"signature": "ed25519:54uxKxJz5N4nzjYbeAuMKZVqUUwj2i9wXgjEeVNYx79mYXQr9bmfysDE5hGo2Smc1NNsTZ8Q6W62uymxq94TEy8J",
"signer_id": "test"
}
]
}
} $ http post http://rpc.nearprotocol.com/ jsonrpc=2.0 id=dontcare method=tx 'params:=["2ZBygTrowP7MTeRQ8rXp8v84benMTaYbHhwFw5w85CTS"]'
{
"id": "dontcare",
"jsonrpc": "2.0",
"result": {
"status": "Completed",
"transactions": [
{
"hash": "2ZBygTrowP7MTeRQ8rXp8v84benMTaYbHhwFw5w85CTS",
"result": {
"logs": [],
"receipts": [
"CdbagwttuZnTcjGT3R8Qs9fsv8GFuFeUtJVnVZeAjoop"
],
"result": null,
"status": "Completed"
}
},
{
"hash": "CdbagwttuZnTcjGT3R8Qs9fsv8GFuFeUtJVnVZeAjoop",
"result": {
"logs": [],
"receipts": [],
"result": "",
"status": "Completed"
}
}
]
}
} Notice that there is no information about the actions. |
Suggestion to fix result to be able to get the actual returned values: #1307 |
@evgenykuzyakov I must admit that I don't understand #1307 (I lack the knowledge around that area), and how it is related to this issue. |
For |
@evgenykuzyakov Yeap, Illia has already pointed that out to me, so crossing it out from the list. |
Why not just build standard API that is copies the inner structure using View conversion. E.g. expose Receipt with ActionReceipt structure, and also associated TransactionResult. |
So we have a To get the first ReceiptId from the signed transaction we can use |
@frol do we still need to do something in this issue? |
@ilblackdragon Yes, we still need to provide more information on the transaction, but it is not blocking Explorer, so it is not high priority. |
It seems that most of the items are already addressed. |
near/NEPs#1
RPC API of the transaction (
tx
) should be restructured according to the conversation near/docs#55 (comment)NOTE: It is a breaking change.
Do we have consumers of this API (except Explorer)?It seems that the only consumer is Explorer and I can fix it.The issues to address in the RPC API:
tx
RPC (there should not be less information than in theblock
RPC response)block
(thetransactions
section) andtx
responsesshard id (?)CreateAccount
action should expose the account idCover the public API with extensive tests, so it gets apparent when something gets changed when it should not.(track separately)The text was updated successfully, but these errors were encountered: