-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot fetch offers - getOfferUTxOs #8
Comments
Can you provide the read permission for this repo? |
We generally solve this common serialization issue with bigint using a replacer function https://github.com/Anastasia-Labs/direct-offer-offchain/blob/main/src/core/utils/utils.ts#L187 |
Thanks for your swift reply! I can share the code snippet maybe, pretty much it is just directly calling the function, do i miss anything? class GetAllOffersController implements Controller {
public path = '/contracts/directSwap/getOffers'
public router = Router()
// placeholder for when/if we want to store these in a database
// private getAllOffers = getAllOffersModel;
constructor() {
this.initializeRoutes()
}
private initializeRoutes() {
this.router.get(this.path, this.createGetAllOffers)
}
private createGetAllOffers = async (
request: Request,
response: Response
) => {
const acceptOfferConfig: FetchOfferConfig = {
scripts: {
spending: contracts.directOfferSpending.cborHex,
staking: contracts.directOfferStaking.cborHex,
},
}
try {
const allOffers = await getOfferUTxOs(
lucidSession,
acceptOfferConfig
)
response.json(allOffers)
return
} catch (error) {
response.status(400)
const errMessageClean = error.message.toLowerCase()
response.send(errMessageClean)
console.log(error.message)
return
}
}
} |
I believe the issue is occurring at |
Calling this instance with implementation on here:
https://github.com/maestro-org/midi/blob/feature/direct-swap-single-asset-staking-apis/src/controllers/directSwap.controller/getAllOffers.controller.ts
Getting the error message of
do not know how to serialize a bigint
The text was updated successfully, but these errors were encountered: