import { Rain } from "@rainfi/rain" export function handleErrorTx(error: any) { const rain = new Rain() const message = rain.errors.errorFromCode(parseInt(error?.message?.replace('failed to send transaction: Transaction simulation failed: Error processing Instruction 0: custom program error: ', '')))?.message return message ? message : null }