From 9c48c814a49107b2a5307b812b556e75db2dd699 Mon Sep 17 00:00:00 2001 From: xdeq Date: Sat, 19 Oct 2024 13:27:39 +0300 Subject: [PATCH 1/4] fix --- components/modals/PayForBlobModal.vue | 17 +++++++++++++++-- services/wallet.js | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/components/modals/PayForBlobModal.vue b/components/modals/PayForBlobModal.vue index c30859db..a5888107 100644 --- a/components/modals/PayForBlobModal.vue +++ b/components/modals/PayForBlobModal.vue @@ -165,6 +165,19 @@ const handleContinue = async () => { const txHash = await sendPayForBlob(appStore.network, appStore.address, proto, stdFee, decodableBlob) isAwaiting.value = false + if (!txHash) { + notificationsStore.create({ + notification: { + type: "warning", + icon: "danger", + title: `Looks like your account is fresh`, + description: 'Top up your balance to submit the blob', + autoDestroy: true, + }, + }) + return + } + amp.log("successfulPfb") cacheStore.tx.hash = txHash @@ -186,7 +199,7 @@ const handleContinue = async () => { notification: { type: "warning", icon: "danger", - title: `The request in Kepler was denied`, + title: `The request in wallet was denied`, autoDestroy: true, }, }) @@ -212,7 +225,7 @@ const handleContinue = async () => { icon: "danger", title: `Something went wrong`, description: e.message, - autoDestroy: true, + autoDestroy: false, }, }) } diff --git a/services/wallet.js b/services/wallet.js index 2673c4f9..40c45dbd 100644 --- a/services/wallet.js +++ b/services/wallet.js @@ -103,7 +103,7 @@ export const sendPayForBlob = async (network, sender, proto, fee, blob) => { accountNumber: Long.fromString(account.account_number), } - const signed = await keplr.signDirect(network.chainId, sender, signDoc) + const signed = await window.wallet.signDirect(network.chainId, sender, signDoc) const body = buildPayForBlob( TxRaw.encode({ From 510dbe09e5f920e3799a24809b63054683eb9140 Mon Sep 17 00:00:00 2001 From: xdeq Date: Sat, 19 Oct 2024 13:39:11 +0300 Subject: [PATCH 2/4] test --- components/modals/PayForBlobModal.vue | 2 ++ services/config.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/modals/PayForBlobModal.vue b/components/modals/PayForBlobModal.vue index a5888107..31036013 100644 --- a/components/modals/PayForBlobModal.vue +++ b/components/modals/PayForBlobModal.vue @@ -143,6 +143,8 @@ const handleContinue = async () => { let gasPrice = appStore.gas.slow let fee = gasPrice * estimatedGas > 1 ? Math.trunc(gasPrice * estimatedGas) : 10000 + console.log(fee); + console.log(estimatedGas) const proto = [ { diff --git a/services/config.js b/services/config.js index ee4e44a3..ff9a0bb9 100644 --- a/services/config.js +++ b/services/config.js @@ -37,7 +37,7 @@ export const useServerURL = () => { return Server.API.dev default: - return Server.API.mainnet + return Server.API.arabica } } From 6cf51817db845ce8082d61bb7c3bf66b8b5e823e Mon Sep 17 00:00:00 2001 From: xdeq Date: Sat, 19 Oct 2024 13:40:29 +0300 Subject: [PATCH 3/4] localhost wss arabica --- services/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/config.js b/services/config.js index ff9a0bb9..5ff1cda0 100644 --- a/services/config.js +++ b/services/config.js @@ -61,7 +61,7 @@ export const useSocketURL = () => { return Server.WSS.dev default: - return Server.WSS.mainnet + return Server.WSS.arabica } } From 6b4c9bc13592c0bc9546672687ba46c005e7e838 Mon Sep 17 00:00:00 2001 From: xdeq Date: Sat, 19 Oct 2024 14:06:52 +0300 Subject: [PATCH 4/4] rm log --- components/modals/PayForBlobModal.vue | 4 +--- components/modals/SendModal.vue | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/components/modals/PayForBlobModal.vue b/components/modals/PayForBlobModal.vue index 31036013..7823373d 100644 --- a/components/modals/PayForBlobModal.vue +++ b/components/modals/PayForBlobModal.vue @@ -143,8 +143,6 @@ const handleContinue = async () => { let gasPrice = appStore.gas.slow let fee = gasPrice * estimatedGas > 1 ? Math.trunc(gasPrice * estimatedGas) : 10000 - console.log(fee); - console.log(estimatedGas) const proto = [ { @@ -227,7 +225,7 @@ const handleContinue = async () => { icon: "danger", title: `Something went wrong`, description: e.message, - autoDestroy: false, + autoDestroy: true, }, }) } diff --git a/components/modals/SendModal.vue b/components/modals/SendModal.vue index 1e9e3719..daffb2d5 100644 --- a/components/modals/SendModal.vue +++ b/components/modals/SendModal.vue @@ -187,6 +187,7 @@ const runGasLimitEstimation = async () => { [protoMsgs], [{ denom: "utia", amount: "1" }], ) + estimatedGasLimit.value = parseInt(gasUsed) }