Post
Share your knowledge.
Are there TypeScript bindings for Move?
Is there a way to auto-generate TypeScript types or interfaces from my Move modules to simplify frontend integration?
- Sui
Answers
1Yes, you can generate TypeScript bindings for your Move modules using Sui’s developer tooling. This allows you to simplify how your frontend interacts with your smart contracts by having pre-defined types, function signatures, and object schemas in TypeScript. You do this by using the sui move generate-typescript
command, which takes your compiled Move modules (from .mv
files) and converts them into usable TypeScript classes and interfaces. This helps reduce manual coding errors and gives you autocompletion when calling entry functions or accessing object fields in tools like VS Code.
After compiling your Move package with sui move build
, run the generator like this:
sui move generate-typescript --path <your_move_package> --output <ts_output_folder>
This will output structured types based on the module layouts. You can then import those types into your React or Node frontend for a smoother integration with the Sui blockchain.
Do you know the answer?
Please log in and share it.
Sui is a Layer 1 protocol blockchain designed as the first internet-scale programmable blockchain platform.
- Why does BCS require exact field order for deserialization when Move structs have named fields?53
- Multiple Source Verification Errors" in Sui Move Module Publications - Automated Error Resolution43
- Sui Transaction Failing: Objects Reserved for Another Transaction25
- How do ability constraints interact with dynamic fields in heterogeneous collections?05