Skip to content

Commit 6c2c93f

Browse files
author
Yash Agrawal
committed
debug: add console.logs
1 parent 9af4101 commit 6c2c93f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devprotocol/send-transactions",
3-
"version": "1.0.0",
3+
"version": "1.0.1-beta.1",
44
"type": "module",
55
"description": "DEV protocol utility API for sending on-chain transactions.",
66
"scripts": {

src/pages/api/send-transactions/AchievementsSBT/[contract].ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const POST: APIRoute = async ({
5353
isAddress(_p.contract) ? true : new Error('Bad request data'),
5454
) ?? new Error('Bad request data'),
5555
)
56-
console.log('HERE1')
56+
console.log('HERE1', { isValidAuth, isParamValid })
5757
const data = await whenNotErrorAll(
5858
[isValidAuth, request],
5959
async ([_iVA, _request]) =>
@@ -81,7 +81,7 @@ export const POST: APIRoute = async ({
8181
.catch((err) => new Error(err))
8282
}) ?? new Error('Invalid metadata'),
8383
)
84-
console.log('HERE2')
84+
console.log('HERE2', { data })
8585
const sbtContractAddress = whenNotErrorAll(
8686
[isParamValid, params],
8787
([_iPV, _params]) =>
@@ -91,7 +91,7 @@ export const POST: APIRoute = async ({
9191
: _p.contract
9292
}) ?? new Error('Invalid sbt contract address'),
9393
)
94-
console.log('HERE3')
94+
console.log('HERE3', { sbtContractAddress })
9595
const wallet = whenNotErrorAll(
9696
[data],
9797
([{ rpcUrl }]) => createWallet({ rpcUrl }) ?? new Error('Wallet error'),
@@ -114,7 +114,7 @@ export const POST: APIRoute = async ({
114114
.then(always(db))
115115
.catch((err) => new Error(err)),
116116
)
117-
console.log('HERE6')
117+
console.log('HERE6, redis === error', redis instanceof Error)
118118
const encodedMetadata = await whenNotErrorAll(
119119
[contract, wallet, data, redis],
120120
async ([contract_, , { metadata }]) => {
@@ -130,7 +130,7 @@ export const POST: APIRoute = async ({
130130
.catch((err: Error) => err)
131131
},
132132
)
133-
console.log('HERE7')
133+
console.log('HERE7', { encodedMetadata })
134134
const tx = await whenNotErrorAll(
135135
[contract, wallet, data, redis, encodedMetadata],
136136
async ([
@@ -154,7 +154,7 @@ export const POST: APIRoute = async ({
154154
.catch((err: Error) => err)
155155
},
156156
)
157-
console.log('HERE8')
157+
console.log('HERE8', { tx })
158158
const sbtMintLog = await whenNotErrorAll(
159159
[contract, tx],
160160
async ([contract_, tx_]) => {
@@ -167,15 +167,15 @@ export const POST: APIRoute = async ({
167167
new Error('SBT Mint log not found')
168168
},
169169
)
170-
console.log('HERE9')
170+
console.log('HERE9', { sbtMintLog })
171171
const sbtToBeMinted = whenNotErrorAll(
172172
[tx, sbtMintLog],
173173
([tx_, sbtMintLog_]) =>
174174
whenDefinedAll([tx_, sbtMintLog_], ([, ml]) =>
175175
Number(ml.args.at(0).toString()),
176176
) ?? new Error('SBT minted not found'),
177177
)
178-
console.log('HERE10')
178+
console.log('HERE10', { sbtToBeMinted })
179179
const saved = await whenNotErrorAll(
180180
[tx, redis, data, sbtContractAddress, sbtToBeMinted],
181181
([_tx, db, { reqId }, ,]) =>
@@ -186,14 +186,14 @@ export const POST: APIRoute = async ({
186186
'Missing TransactionResponse field to save the transaction: .to, .data',
187187
),
188188
)
189-
console.log('HERE11')
189+
console.log('HERE11', { saved })
190190
const result = await whenNotErrorAll([redis], ([db]) =>
191191
db
192192
.quit()
193193
.then((x) => x)
194194
.catch((err: Error) => err),
195195
)
196-
console.log('HERE12')
196+
console.log('HERE12', { result })
197197
return result instanceof Error ||
198198
sbtToBeMinted instanceof Error ||
199199
saved instanceof Error

0 commit comments

Comments
 (0)