Skip to content

[BUG] Typescript bindings: ByteArray type #3216

Open
@rsodre

Description

@rsodre

Describe the bug

The ByteArray types should be converted to string In the TypeScript bindings.
starknet.js Calldata can candle string types, there's no need to pass as ByteArray.
I tried passing a ByteArray instead of string and it raises an error.

To Reproduce

Generate typescript bindings for a contract that contains a ByteArray argument.
(example from pistols/dev branch)

const build_duel_token_createDuel_calldata = (duelType: CairoCustomEnum, duelistId: BigNumberish, challengedAddress: string, livesStaked: BigNumberish, expireHours: BigNumberish, premise: CairoCustomEnum, message: ByteArray): DojoCall => {
	return {
		contractName: "duel_token",
		entrypoint: "create_duel",
		calldata: [duelType, duelistId, challengedAddress, livesStaked, expireHours, premise, message],
	};
};

Expected behavior

The converted type should at least work.
Even if it worked, it's not necessary to enforce this type conversion in the client.

Screenshots

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions