Skip to content

Commit 8790fc5

Browse files
add&improve logs
1 parent d320872 commit 8790fc5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

explorer/src/app/api/log/[...params]/route.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@ import { sendSlackMessage } from 'utils/slack'
44
export const POST = async (req: NextRequest) => {
55
try {
66
const logData = await req.json()
7-
const slackMessage = await sendSlackMessage('Astral Error', [
7+
const pathname = req.nextUrl.pathname.replace('/api/log/', '')
8+
const type = pathname.split('/')[0]
9+
const slackMessage = await sendSlackMessage('Astral ' + type, [
810
{
911
type: 'header',
1012
text: {
1113
type: 'plain_text',
12-
text: 'Astral Error',
14+
text: 'Astral ' + type,
1315
},
1416
},
1517
{
1618
type: 'section',
1719
text: {
1820
type: 'mrkdwn',
19-
text: `Path: ${req.nextUrl.pathname.replace('/api/log/', '')}`,
21+
text: `Path: ${pathname}`,
2022
},
2123
},
2224
{

explorer/src/components/Transfer/index.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ export const Transfer: FC = () => {
7979
position: 'bottom-center',
8080
})
8181
log('transfer', 'handleSubmit', 'injector', injector)
82+
log('transfer', 'handleSubmit', 'injector.signer', injector.signer)
83+
log('transfer', 'handleSubmit', 'injector.accounts', injector.accounts)
8284
log('transfer', 'handleSubmit', 'api', api)
8385

8486
const to = values.receiver || subspaceAccount
@@ -111,13 +113,15 @@ export const Transfer: FC = () => {
111113
}
112114
try {
113115
const tx = await transfer(api, to, amount)
116+
log('transfer', 'handleSubmit', 'tx', tx)
114117
const hash = await sendAndSaveTx({
115118
call: 'balances.transferKeepAlive',
116119
tx,
117120
signer: injector.signer,
118121
to,
119122
amount,
120123
})
124+
log('transfer', 'handleSubmit', 'hash', hash)
121125
if (hash) {
122126
setHash(hash)
123127
toast.success('The transaction was sent successfully', { position: 'bottom-center' })

0 commit comments

Comments
 (0)