a2d3d:
So, How can I check this hash id confirmed or rejected?
I use this code but does not work for me:
cardanocliJs.transactionView({ txBody: req.body.trxId });
If you really want to do it with cardanocli-js, I would do it with cardanocliJs.queryUtxo(address)
on one of the addresses that you sent something to.
If the transaction went through, then the transaction ID has to be in the set of UTxOs.
Or you could use one of the available APIs – https://blockfrost.io/ or https://www.koios.rest/ – to query the blockchain:
$ curl --silent "https://testnet.koios.rest/api/v0/tx_info?_tx_hashes=\{984dffd6fa432b8d7dc8bc392410a210d79343ece79e76a392557026838196a0\}" | jq
[
{
"tx_hash": "984dffd6fa432b8d7dc8bc392410a210d79343ece79e76a392557026838196a0",
"block_hash": "f64b992ec91148cb493091da1861e73871b1e316aeeb369123135fa1b7b0dfff",
"block_height": 3591926,
"epoch": 208,
"epoch_slot": 54186,
"absolute_slot": 59540586,
"tx_timestamp": "2022-05-30T11:23:22",
"tx_block_index": 4,
"tx_size": 365,
"total_output": "22445769",
"fee": "180285",
"deposit": "0",
"invalid_before": 0,
"invalid_after": 59550445,
"collaterals": [],
"inputs": [
{
"payment_addr": {
"bech32": "addr_test1qze9g6yg9yyflay4g34jp58t4jcnh699fd8dltnfgpde746cw3p6ta58mjzld2rkh4a009rurhfl88zc96k5uumr9h8scjc3pm",
"cred": "b254688829089ff495446b20d0ebacb13be8a54b4edfae69405b9f57"
},
"stake_addr": "stake_test1upv8gsa976raep0k4pmt67hhj37pm5lnn3vzat2wwd3jmnca2rltt",
"tx_hash": "8d20a703d174db544054737494d7a630d02cf5127506ac6777a8d2f7accc0617",
"tx_index": 0,
"value": "22626054",
"asset_list": []
}
],
"outputs": [
{
"payment_addr": {
"bech32": "addr_test1qzasmg7w3eudfxyffzqyy6w2m68fmk645rwdmhvj3ga4gwr3ask84f4t9nwul9v6tgxpnmk8d7j6gwatv568xh7vd0ns8q4jvp",
"cred": "bb0da3ce8e78d4988948804269cade8e9ddb55a0dcdddd928a3b5438"
},
"stake_addr": "stake_test1upc7ctr6564jehw0jkd95rqeamrklfdy8w4k2drntlxxhecwj4sms",
"tx_hash": "984dffd6fa432b8d7dc8bc392410a210d79343ece79e76a392557026838196a0",
"tx_index": 1,
"value": "1000000",
"asset_list": []
},
{
"payment_addr": {
"bech32": "addr_test1qze9g6yg9yyflay4g34jp58t4jcnh699fd8dltnfgpde746cw3p6ta58mjzld2rkh4a009rurhfl88zc96k5uumr9h8scjc3pm",
"cred": "b254688829089ff495446b20d0ebacb13be8a54b4edfae69405b9f57"
},
"stake_addr": "stake_test1upv8gsa976raep0k4pmt67hhj37pm5lnn3vzat2wwd3jmnca2rltt",
"tx_hash": "984dffd6fa432b8d7dc8bc392410a210d79343ece79e76a392557026838196a0",
"tx_index": 0,
"value": "21445769",
"asset_list": []
}
],
"withdrawals": [],
"assets_minted": [],
"metadata": [
{
"key": "1",
"json": {
"cardanocliJs": "From main site"
}
}
],
"certificates": [],
"native_scripts": [],
"plutus_contracts": []
}
]
(What I have done with curl here, you can, of course, do from inside Javascript. I’m sure you know that better than me. I’m not even a Javascript developer.)