Skip to content

Commit e9896c3

Browse files
committed
feat: tx hash for send/pfb
1 parent b5aeb44 commit e9896c3

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

components/modals/PayForBlobModal.vue

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,16 +156,25 @@ const handleContinue = async () => {
156156
157157
try {
158158
isAwaiting.value = true
159-
await sendPayForBlob(appStore.network, appStore.address, proto, stdFee, decodableBlob)
159+
const txHash = await sendPayForBlob(appStore.network, appStore.address, proto, stdFee, decodableBlob)
160160
isAwaiting.value = false
161161
162-
amp.log("successfullPfb")
162+
amp.log("successfulPfb")
163163
164164
notificationsStore.create({
165165
notification: {
166166
type: "success",
167167
icon: "check-circle",
168-
title: `Successfuly submited`,
168+
title: `Successfuly sent`,
169+
actions: [
170+
{
171+
icon: "copy",
172+
name: "Copy Tx Hash",
173+
callback: () => {
174+
window.navigator.clipboard.writeText(txHash)
175+
},
176+
},
177+
],
169178
autoDestroy: true,
170179
},
171180
})

components/modals/SendModal.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import amp from "@/services/amp"
1616
import { normalizeAmount, purgeNumber, comma } from "@/services/utils/amounts"
1717
import { simulateMsgs, sendMsgs } from "@/services/keplr"
1818
import { MsgSend } from "@/services/proto/gen/msg_send"
19+
import { space } from "@/services/utils"
1920
2021
/** Store */
2122
import { useAppStore } from "@/store/app"
@@ -255,16 +256,25 @@ const handleContinue = async () => {
255256
256257
try {
257258
isAwaiting.value = true
258-
await sendMsgs(appStore.network, key.bech32Address, proto, stdFee)
259+
const txHash = await sendMsgs(appStore.network, key.bech32Address, proto, stdFee)
259260
isAwaiting.value = false
260261
261-
amp.log("successfullSend")
262+
amp.log("successfulSend")
262263
263264
notificationsStore.create({
264265
notification: {
265266
type: "success",
266267
icon: "check-circle",
267268
title: `Successfuly sent`,
269+
actions: [
270+
{
271+
icon: "copy",
272+
name: "Copy Tx Hash",
273+
callback: () => {
274+
window.navigator.clipboard.writeText(txHash)
275+
},
276+
},
277+
],
268278
autoDestroy: true,
269279
},
270280
})

services/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const useServerURL = () => {
3333
return Server.API.dev
3434

3535
default:
36-
return Server.API.dev
36+
return Server.API.arabica
3737
}
3838
}
3939

services/keplr.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export const sendPayForBlob = async (network, sender, proto, fee, blob) => {
107107
}
108108

109109
const txHash = await broadcastTxSync(network.chainId, signedTx.tx)
110-
return txHash
110+
return Buffer.from(txHash).toString("hex")
111111
}
112112
}
113113

@@ -225,6 +225,7 @@ export const sendMsgs = async (network, sender, proto, fee) => {
225225
}
226226

227227
const txHash = await broadcastTxSync(network.chainId, signedTx.tx)
228+
return Buffer.from(txHash).toString("hex")
228229
}
229230
}
230231

0 commit comments

Comments
 (0)