* clear

* feat: Add everything

* fix: Commenht
This commit is contained in:
Prad Nukala
2025-10-03 14:45:52 -04:00
committed by GitHub
parent 43b4a11c06
commit 13e6c3e84d
1935 changed files with 655061 additions and 40058 deletions
+21
View File
@@ -0,0 +1,21 @@
import {
type CosmosTxV1beta1GetTxResponse as GetTxResponse,
CosmosTxV1beta1ServiceGetTxService as GetTxService,
} from '@sonr.io/es/protobufs';
import { RpcClient } from '../clients/RpcClient';
export type GetTxParams = {
hash: string;
};
/**
* Returns the tx matching the given hash. Throws if the tx is not found.
*/
export async function getTx(endpoint: string, params: GetTxParams) {
const res = await RpcClient.query(endpoint, GetTxService, params);
if (!res.tx || !res.txResponse) {
throw new Error('Tx not found');
}
return res as Required<GetTxResponse>;
}