Problem: The moralis auth api /challenge/request/solana
endpoint only allows 44 character Sol addresses, but valid Sol addresses range from 32 to 44 characters.
Questions:
- Is there a reason for this (and if not can a fix be made)?
- Is there a way I can lift this validation manually in the SDK? I’m assuming not since it seems like the validation happens in the api.
API Error Message:
{
"statusCode": 400,
"name": "BadRequestException",
"message": [
"address must be longer than or equal to 44 characters"
]
}
Javascript SDK Error Message:
error - TypeError: Converting circular structure to JSON
--> starting at object with constructor 'ClientRequest'
| property 'socket' -> object with constructor 'TLSSocket'
--- property '_httpMessage' closes the circle
at JSON.stringify (<anonymous>)
at sendJson (/Users/tylerspagnolo/test-auth/node_modules/next/dist/server/api-utils/node.js:197:19)
at apiRes.json (/Users/tylerspagnolo/test-auth/node_modules/next/dist/server/api-utils/node.js:350:31)
at __WEBPACK_DEFAULT_EXPORT__ (webpack-internal:///(api)/./pages/api/auth/request-message.ts:36:25)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.apiResolver (/Users/tylerspagnolo/test-auth/node_modules/next/dist/server/api-utils/node.js:366:9)
at async DevServer.runApi (/Users/tylerspagnolo/test-auth/node_modules/next/dist/server/next-server.js:481:9)
at async Object.fn (/Users/tylerspagnolo/test-auth/node_modules/next/dist/server/next-server.js:735:37)
at async Router.execute (/Users/tylerspagnolo/test-auth/node_modules/next/dist/server/router.js:247:36)
at async DevServer.run (/Users/tylerspagnolo/test-auth/node_modules/next/dist/server/base-server.js:347:29) {
page: '/api/auth/request-message'
}