Skip to content

Typed data signing doesn't work for 'string' addresses #251

@DarthMike

Description

@DarthMike

What happened

Encountered an issue when signing a specific typed data. Signing this typed data results in decodingError

The issue seems related to wallet type in the data, which is implicitly decoded as felt instead of string.

See steps to reproduce

Typed data:

{"types":{"StarknetDomain":[{"name":"name","type":"shortstring"},{"name":"version","type":"shortstring"},{"name":"chainId","type":"shortstring"},{"name":"revision","type":"shortstring"}],"AccountCreation":[{"name":"accountIndex","type":"felt"},{"name":"wallet","type":"string"},{"name":"tosAccepted","type":"bool"}]},"primaryType":"AccountCreation","message":{"tosAccepted":true,"accountIndex":0,"wallet":"0x2a7877881132f27cbfff1021f0ca82ffbcadd14e7599f55e03e891c01edc534"},"domain":{"name":"Perpetuals","version":"v0","chainId":"SN_MAIN","revision":"1"}}

Stack trace

Image

Steps to reproduce

  1. Receive Typed data in JSON format (see issue description for example)
  2. Initialized TypedData with JSON
  3. Call StarknetAccount sign(typedData: StarknetTypedData) method

SDK Version

0.14.0

Language version

Swift 6

Is there an existing issue for this?

  • I have searched the existing issues and verified no issue exits for this problem.

Metadata

Metadata

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