docs
docs copied to clipboard
Type conversion from BigInt to Bytes
https://thegraph.com/docs/en/developing/assemblyscript-api/#type-conversions-reference
@schmidsi are you saying this needs to be added to the docs?
@azf20 Yes. Or maybe even better support it in TS. Sorry for not better speccing this out since I was focusing on something else but wanted to leave the note here.
I ended up with something like:
Bytes.fromI32(event.params.tokenId.toI32()
But to transform a BigInt to I32 is removing info and should be avoided. Better would be Bytes.fromBigInt or BigInt.toBytes(). But for now, we could document the code above.