diff --git a/package.json b/package.json index 720b2901..440ad478 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devprotocol/send-transactions", - "version": "1.0.0", + "version": "1.0.1-beta.1", "type": "module", "description": "DEV protocol utility API for sending on-chain transactions.", "scripts": { diff --git a/src/pages/api/send-transactions/AchievementsSBT/[contract].ts b/src/pages/api/send-transactions/AchievementsSBT/[contract].ts index 365908c2..d61bd5c0 100644 --- a/src/pages/api/send-transactions/AchievementsSBT/[contract].ts +++ b/src/pages/api/send-transactions/AchievementsSBT/[contract].ts @@ -53,7 +53,7 @@ export const POST: APIRoute = async ({ isAddress(_p.contract) ? true : new Error('Bad request data'), ) ?? new Error('Bad request data'), ) - console.log('HERE1') + console.log('HERE1', { isValidAuth, isParamValid }) const data = await whenNotErrorAll( [isValidAuth, request], async ([_iVA, _request]) => @@ -81,7 +81,7 @@ export const POST: APIRoute = async ({ .catch((err) => new Error(err)) }) ?? new Error('Invalid metadata'), ) - console.log('HERE2') + console.log('HERE2', { data }) const sbtContractAddress = whenNotErrorAll( [isParamValid, params], ([_iPV, _params]) => @@ -91,7 +91,7 @@ export const POST: APIRoute = async ({ : _p.contract }) ?? new Error('Invalid sbt contract address'), ) - console.log('HERE3') + console.log('HERE3', { sbtContractAddress }) const wallet = whenNotErrorAll( [data], ([{ rpcUrl }]) => createWallet({ rpcUrl }) ?? new Error('Wallet error'), @@ -114,7 +114,7 @@ export const POST: APIRoute = async ({ .then(always(db)) .catch((err) => new Error(err)), ) - console.log('HERE6') + console.log('HERE6, redis === error', redis instanceof Error) const encodedMetadata = await whenNotErrorAll( [contract, wallet, data, redis], async ([contract_, , { metadata }]) => { @@ -130,7 +130,7 @@ export const POST: APIRoute = async ({ .catch((err: Error) => err) }, ) - console.log('HERE7') + console.log('HERE7', { encodedMetadata }) const tx = await whenNotErrorAll( [contract, wallet, data, redis, encodedMetadata], async ([ @@ -154,7 +154,7 @@ export const POST: APIRoute = async ({ .catch((err: Error) => err) }, ) - console.log('HERE8') + console.log('HERE8', { tx }) const sbtMintLog = await whenNotErrorAll( [contract, tx], async ([contract_, tx_]) => { @@ -167,7 +167,7 @@ export const POST: APIRoute = async ({ new Error('SBT Mint log not found') }, ) - console.log('HERE9') + console.log('HERE9', { sbtMintLog }) const sbtToBeMinted = whenNotErrorAll( [tx, sbtMintLog], ([tx_, sbtMintLog_]) => @@ -175,7 +175,7 @@ export const POST: APIRoute = async ({ Number(ml.args.at(0).toString()), ) ?? new Error('SBT minted not found'), ) - console.log('HERE10') + console.log('HERE10', { sbtToBeMinted }) const saved = await whenNotErrorAll( [tx, redis, data, sbtContractAddress, sbtToBeMinted], ([_tx, db, { reqId }, ,]) => @@ -186,14 +186,14 @@ export const POST: APIRoute = async ({ 'Missing TransactionResponse field to save the transaction: .to, .data', ), ) - console.log('HERE11') + console.log('HERE11', { saved }) const result = await whenNotErrorAll([redis], ([db]) => db .quit() .then((x) => x) .catch((err: Error) => err), ) - console.log('HERE12') + console.log('HERE12', { result }) return result instanceof Error || sbtToBeMinted instanceof Error || saved instanceof Error