From ed9105684cde653c0370c93aa38bc8a93ce25901 Mon Sep 17 00:00:00 2001 From: Serkan Reis Date: Mon, 17 Jun 2024 22:17:04 +0300 Subject: [PATCH] Update parser for createVendingMinter transaction result --- contracts/vendingFactory/contract.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contracts/vendingFactory/contract.ts b/contracts/vendingFactory/contract.ts index d50f054..35e87e0 100644 --- a/contracts/vendingFactory/contract.ts +++ b/contracts/vendingFactory/contract.ts @@ -63,8 +63,10 @@ export const vendingFactory = (client: SigningCosmWasmClient, txSigner: string): const result = await client.execute(senderAddress, contractAddress, msg, 'auto', '', funds) return { - vendingMinterAddress: result.logs[0].events[16].attributes[0].value, - sg721Address: result.logs[0].events[18].attributes[0].value, + vendingMinterAddress: result.logs[0].events.filter((e) => e.type === 'instantiate')[0].attributes[0].value, + sg721Address: result.logs[0].events + .filter((e) => e.type === 'wasm') + .filter((e) => e.attributes[2]?.key === 'sg721_address')[0].attributes[2].value, transactionHash: result.transactionHash, logs: result.logs, }