Here is a small example on how to get a transaction by the transaction hash.
import { PhantasmaAPI, Transaction } from"phantasma-ts";constCHAIN_NAME="main"; // This is the name of the chain, please don't change it.constNETWORK_API_URL="https://testnet.phantasma.io/rpc"; // for mainnet this should be https://pharpc1.phantasma.io/rpcconstNETWORK_PEER_URL=undefined; // this the peers URL to get the list of peers, if not provided it will use the default one "https://peers.phantasma.io/"constNEXUS_NAME="testnet"; // For mainnet use this "mainnet"constAPI=newPhantasmaAPI(NETWORK_API_URL,NETWORK_PEER_URL,NEXUS_NAME);let txHash =""; // Here should be the transaction hashlet result =awaitAPI.getTransaction(txHash);console.log({ result });