NethermindEth / starknet.go

Golang Library for StarkNet/Cairo
MIT License
143 stars 95 forks source link

Support for ByteArray Serialization #580

Open krishnateja262 opened 1 week ago

krishnateja262 commented 1 week ago

When interacting with a contract which takes in ByteArray as input, the FunctionCall takes only felt types as input. There is no support or I dont seem to find any utility for converting ByteArray to felt type.

krishnateja262 commented 1 week ago

@thiagodeev I was able to do this and interact with the contract for taking byte arrays, happy to raise a PR for your review

thiagodeev commented 1 week ago

That's great @krishnateja262! Are you talking about creating an example or a new feature?

krishnateja262 commented 1 week ago

@thiagodeev thinking of it as a feature, i can write one helper function in utils/Felt.go file which will take a string and convert it to array of felts

thiagodeev commented 1 week ago

This would be very welcome! Please feel free to submit the PR. Good resource: https://docs.starknet.io/architecture-and-concepts/smart-contracts/serialization-of-cairo-types/#serialization_of_byte_arrays

krishnateja262 commented 1 week ago

@thiagodeev Raised #583