cosmos/tx/v1beta1/txs

Returns txs by event.

Parameters

Object NameRequiredTypeDetail
eventsArrayThe list of transaction event type.
pagination.keyStringThe value returned in PageResponse.next_key to begin querying the next page most efficiently. If provided, then pagination.offset is not allowed.
pagination.offsetIntegerA numeric offset that can be used when pagination.key is unavailable. It is less efficient than pagination.key. If provided, then pagination.key is not allowed.
pagination.limitIntegerThe total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.
pagination.count_totalBooleanIf set to true, the result will include a count of the total number of items available for pagination. count_total is only respected when offset is used. It is ignored when key is set.
pagination.reverseBooleanSet to true if results are to be returned in the descending order.
order_byStringSee Below.

order_by:

  • ORDER_BY_UNSPECIFIED: specifies an unknown sorting order. OrderBy defaults to ASC in this case.
  • ORDER_BY_ASC: ascending order
  • ORDER_BY_DESC: descending order

Available values : ORDER_BY_UNSPECIFIED, ORDER_BY_ASC, ORDER_BY_DESC

Default value: ORDER_BY_UNSPECIFIED

/cosmos/tx/v1beta1/txs?events=tx.height%3D14396202&pagination.limit=1

Result

The txs by event.

Example

Request

curl <your-rest-endpoint>/cosmos/tx/v1beta1/txs?events=tx.height%3D14396202&pagination.limit=1 \
  -X GET \
  -H "accept: application/json"

Return

{
    "txs": [
        {
            "body": {
                "messages": [
                    {
                        "@type": "/cosmos.bank.v1beta1.MsgSend",
                        "from_address": "cosmos15camcflx20rsp2sx0spt73yvqfcvuhsjdafww5",
                        "to_address": "cosmos18atv03djnzh3wruj9gyausvnc9xyxd05l2xc4q",
                        "amount": [
                            {
                                "denom": "uatom",
                                "amount": "2960000"
                            }
                        ]
                    }
                ],
                "memo": "",
                "timeout_height": "0",
                "extension_options": [],
                "non_critical_extension_options": []
            },
            "auth_info": {
                "signer_infos": [
                    {
                        "public_key": {
                            "@type": "/cosmos.crypto.secp256k1.PubKey",
                            "key": "A28gFnM74bjZkOhytznEg0L2XSsseB2yCXYJEhJDqqPZ"
                        },
                        "mode_info": {
                            "single": {
                                "mode": "SIGN_MODE_DIRECT"
                            }
                        },
                        "sequence": "69881"
                    }
                ],
                "fee": {
                    "amount": [
                        {
                            "denom": "uatom",
                            "amount": "5000"
                        }
                    ],
                    "gas_limit": "200000",
                    "payer": "",
                    "granter": ""
                }
            },
            "signatures": [
                "hf6Wjro+5LisfbgRjZwyvs3almmTgFiYB8T2lqwq6ssB3qQUdfoQgA1nY6vdhFVi9EY86QAkBSvsGYi/PlpYIg=="
            ]
        }
    ],
    "tx_responses": [
        {
            "height": "14396202",
            "txhash": "904CECA066B559E24BB9BE3C4D34D1B42B2DD788DDF9DE13A0F9195C846C33B3",
            "codespace": "",
            "code": 0,
            "data": "0A1E0A1C2F636F736D6F732E62616E6B2E763162657461312E4D736753656E64",
            "raw_log": "[{\"events\":[{\"type\":\"coin_received\",\"attributes\":[{\"key\":\"receiver\",\"value\":\"cosmos18atv03djnzh3wruj9gyausvnc9xyxd05l2xc4q\"},{\"key\":\"amount\",\"value\":\"2960000uatom\"}]},{\"type\":\"coin_spent\",\"attributes\":[{\"key\":\"spender\",\"value\":\"cosmos15camcflx20rsp2sx0spt73yvqfcvuhsjdafww5\"},{\"key\":\"amount\",\"value\":\"2960000uatom\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"/cosmos.bank.v1beta1.MsgSend\"},{\"key\":\"sender\",\"value\":\"cosmos15camcflx20rsp2sx0spt73yvqfcvuhsjdafww5\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"cosmos18atv03djnzh3wruj9gyausvnc9xyxd05l2xc4q\"},{\"key\":\"sender\",\"value\":\"cosmos15camcflx20rsp2sx0spt73yvqfcvuhsjdafww5\"},{\"key\":\"amount\",\"value\":\"2960000uatom\"}]}]}]",
            "logs": [
                {
                    "msg_index": 0,
                    "log": "",
                    "events": [
                        {
                            "type": "coin_received",
                            "attributes": [
                                {
                                    "key": "receiver",
                                    "value": "cosmos18atv03djnzh3wruj9gyausvnc9xyxd05l2xc4q"
                                },
                                {
                                    "key": "amount",
                                    "value": "2960000uatom"
                                }
                            ]
                        },
                        ...
                        {
                            "type": "transfer",
                            "attributes": [
                                {
                                    "key": "recipient",
                                    "value": "cosmos18atv03djnzh3wruj9gyausvnc9xyxd05l2xc4q"
                                },
                                {
                                    "key": "sender",
                                    "value": "cosmos15camcflx20rsp2sx0spt73yvqfcvuhsjdafww5"
                                },
                                {
                                    "key": "amount",
                                    "value": "2960000uatom"
                                }
                            ]
                        }
                    ]
                }
            ],
            "info": "",
            "gas_wanted": "200000",
            "gas_used": "71732",
            "tx": {
                "@type": "/cosmos.tx.v1beta1.Tx",
                "body": {
                    "messages": [
                        {
                            "@type": "/cosmos.bank.v1beta1.MsgSend",
                            "from_address": "cosmos15camcflx20rsp2sx0spt73yvqfcvuhsjdafww5",
                            "to_address": "cosmos18atv03djnzh3wruj9gyausvnc9xyxd05l2xc4q",
                            "amount": [
                                {
                                    "denom": "uatom",
                                    "amount": "2960000"
                                }
                            ]
                        }
                    ],
                    "memo": "",
                    "timeout_height": "0",
                    "extension_options": [],
                    "non_critical_extension_options": []
                },
                "auth_info": {
                    "signer_infos": [
                        {
                            "public_key": {
                                "@type": "/cosmos.crypto.secp256k1.PubKey",
                                "key": "A28gFnM74bjZkOhytznEg0L2XSsseB2yCXYJEhJDqqPZ"
                            },
                            "mode_info": {
                                "single": {
                                    "mode": "SIGN_MODE_DIRECT"
                                }
                            },
                            "sequence": "69881"
                        }
                    ],
                    "fee": {
                        "amount": [
                            {
                                "denom": "uatom",
                                "amount": "5000"
                            }
                        ],
                        "gas_limit": "200000",
                        "payer": "",
                        "granter": ""
                    }
                },
                "signatures": [
                    "hf6Wjro+5LisfbgRjZwyvs3almmTgFiYB8T2lqwq6ssB3qQUdfoQgA1nY6vdhFVi9EY86QAkBSvsGYi/PlpYIg=="
                ]
            },
            "timestamp": "2023-03-09T22:13:12Z",
            "events": [
                {
                    "type": "coin_spent",
                    "attributes": [
                        {
                            "key": "c3BlbmRlcg==",
                            "value": "Y29zbW9zMTVjYW1jZmx4MjByc3Ayc3gwc3B0NzN5dnFmY3Z1aHNqZGFmd3c1",
                            "index": true
                        },
                        {
                            "key": "YW1vdW50",
                            "value": "NTAwMHVhdG9t",
                            "index": true
                        }
                    ]
                },
                ...
                {
                    "type": "message",
                    "attributes": [
                        {
                            "key": "bW9kdWxl",
                            "value": "YmFuaw==",
                            "index": true
                        }
                    ]
                }
            ]
        }
    ],
    "pagination": {
        "next_key": null,
        "total": "5"
    }
}