Cipher parsing

This commit is contained in:
Sosthene 2024-10-12 23:20:07 +02:00
parent 2593676fae
commit fbf20ab5d5

View File

@ -189,23 +189,23 @@ export default class Services {
}
async parseCipher(message: string) {
// try {
// JSON.parse(message)
// const router = await Routing.getInstance();
// router.closeLoginModal()
// this.injectProcessListPage()
// } catch {
// console.log('Not proper format for cipher')
// }
try {
const services = await Services.getInstance();
try {
JSON.parse(message)
const router = await Routing.getInstance();
router.closeLoginModal()
this.injectProcessListPage()
} catch {
console.log('Not proper format for cipher')
}
const parsedTx = await services.sdkClient.parse_cipher(message, 0.00001)
console.log("🚀 ~ Services ~ parseCipher ~ parsedTx:", parsedTx)
await this.handleApiReturn(parsedTx)
// await this.saveCipherTxToDb(parsedTx)
console.log('parsing new cipher');
const apiReturn = await this.sdkClient.parse_cipher(message, 0.00001);
console.log("🚀 ~ Services ~ parseCipher ~ apiReturn:", apiReturn);
await this.handleApiReturn(apiReturn)
} catch (e) {
console.log(e)
console.log("Cipher isn't for us");
}
// await this.saveCipherTxToDb(parsedTx)
}
async parseNewTx(tx: string) {