Peera.

Unanswered

Share your insights and expertise.

Posts

56
  • HaGiang.Peera.
    ForSuiJul 26, 2025
    Expert Q&A

    How can I set it up so that user does not need to manually enable popup?

    I integrated Slush wallet to my code with Sui dapp-kit SDK, it connects with the Google ZK wallet in IOS and Android browsers but when I try to interact with contract and executes a function I am getting error Failed to open new window. After I manually enable pop up for the mobile browser it works. How can I set it up so that user does not need to manually enable popup?

    • Sui
    0
    0
  • HaGiang.Peera.
    ForSuiJul 26, 2025
    Expert Q&A

    Does anyone know if a Move Registry API currently exist?

    Does anyone know if a Move Registry API currently exist?

    • Sui
    • Architecture
    0
    0
  • HaGiang.Peera.
    ForSuiJul 26, 2025
    Expert Q&A

    Could anyone have the same issue and kindly tell me why i get this error?

    I found I pass tx to build on sdk and i'll get error "No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.

    • Sui
    0
    0
  • HaGiang.Peera.
    ForSuiJul 26, 2025
    Expert Q&A

    what's weird is that the Problems tab

    what's weird is that the Problems tab does show the same error as sui move build, but nothing appears in the editor itself

    • Sui
    0
    0
  • Meaning.Sui.Peera.
    ForSuiJul 26, 2025
    Expert Q&A

    Is anyone familiar with the SDK and how I can handle this?

    I am having some trouble with the Sui Rust SDK. I am using .read_api().get_normalized_move_struct function which returns an SuiMoveNormalizedStruct. I want then to decode bcs bytes of an object using this, but I have only found how to do that using a MoveStructLayout. Although the two types are similar, there is no built in way to convert between the two. Is anyone familiar with the SDK and how I can handle this?

    • Sui
    0
    0
  • MoonBags.Peera.
    ForSuiJul 26, 2025
    Expert Q&A

    Question about MoveStdlib and Sui?

    does anybody know if there's a reference for all of the Move items from MoveStdlib and Sui that are auto-imported? I know of sui::object, sui::object::ID, sui::object::UID, std::option, etc, from experience. But I wonder if there's an authoritative source on that

    • Sui
    0
    0
  • MoonBags.Peera.
    ForSuiJul 25, 2025
    Expert Q&A

    Have a question about shared objects versioning

    As far as I can see, there are 2 general approaches of versioning implementation: version field inside of a shared object structure or sui::versioned module usage. From my perspective, the first one is simpler, while the second one is more sophisticated. At the same time, the second approach provides more flexibility. Besides that, could you tell please, are there any best practices in the shared objects versioning? Are there maybe any pitfalls or advantages which are not seen from the first look? Would appreciate any help, thank you!

    • Sui
    • SDKs and Developer Tools
    0
    0
  • MoonBags.Peera.
    ForSuiJul 25, 2025
    Expert Q&A

    Do we have number of dependecies restriction that we can import in sui move ?

    'VMError with status LINKER_ERROR at location UNDEFINED and message Cannot find ModuleId { address: cffcf0347987e02e617af864f42a4eb964ba94465abf0875053db4ec3c2b2f81, name: Identifier("cc") } in data cache I am getting this error what is this error ? can someone help here ?

    • Sui
    • SDKs and Developer Tools
    0
    0
  • MoonBags.Peera.
    ForSuiJul 25, 2025
    Expert Q&A

    How can I call from a node js app using SUI TS SDK?

    Here is a snippet of a Sui move codbase public enum Category has copy, drop, store { A, B, C } public entry fun process_categories(categories: vector, ctx: &mut TxContext) How can I call from a node js app using SUI TS SDK, to call the process_categories function, specifically send categories as an argument?

    • Sui
    0
    0
  • Owen.Peera.
    Owen626
    ForSuiJul 25, 2025
    Expert Q&A

    Working with Dynamic Fields and Programmable Transactions in Sui Move

    The Sui blockchain introduces a revolutionary approach to smart contract development through its customized version of the Move programming language—Sui Move. Unlike traditional blockchain platforms that rely on rigid storage models, Sui Move empowers developers with flexible, expressive tools that enable dynamic data structures and complex transaction logic. Two of the most powerful features in Sui Move are dynamic fields and programmable transactions. Together, they unlock new levels of composability, efficiency, and developer creativity, making Sui an ideal platform for building next-generation decentralized applications (dApps) such as games, social networks, and advanced DeFi protocols. Understanding Dynamic Fields in Sui Move In most smart contract languages, the structure of data is fixed at compile time. For example, a contract might define a User struct with predefined fields like name, balance, and level. While this works for simple use cases, it limits flexibility when building applications that need to evolve or store heterogeneous data. Sui Move solves this limitation with dynamic fields—a feature that allows objects to have fields added or removed at runtime. A dynamic field is essentially a key-value pair attached to an object, where the key can be any type (e.g., string, UID, or custom struct), and the value is another object or primitive. This capability is particularly useful for: Game inventories**: Players can own a variable number of items, each stored as a dynamic field. Social profiles**: Users can attach metadata like "bio", "avatar", or "followers" dynamically. DAO governance**: Proposals can include custom data payloads without modifying the core contract. Syntax and Usage In Sui Move, dynamic fields are accessed via the dynamic_field module. Here’s a basic example: use sui::dynamic_field as df; struct Profile has key { id: UID, name: String, } To add a dynamic field to a Profile object: public entry fun add_bio(profile: &mut Profile, bio: String, ctx: &mut TxContext) { let bio_field = df::new_dynamic_field(b"bio", bio, ctx); df::add(&mut profile.id, bio_field); } This code attaches a bio string to the profile object under the key "bio". Later, it can be read: public fun get_bio(profile: &Profile): &String { df::borrow(&profile.id, b"bio") } Dynamic fields are owned by the parent object, meaning they are deleted when the parent is deleted. They can also be transferred, shared, or frozen depending on the object’s ownership model. Benefits of Dynamic Fields Schema Flexibility**: Contracts don’t need to anticipate all possible data fields upfront. Storage Efficiency**: Only used fields consume space; no need to reserve slots for unused data. Composability**: Objects can be extended by different modules without requiring upgrades to the original code. Upgrade-Free Evolution**: New features can be added by attaching dynamic fields instead of deploying new contract versions. Introducing Programmable Transactions While dynamic fields enhance data modeling, programmable transactions revolutionize how logic is executed on Sui. In traditional blockchains, a transaction typically calls a single function in one smart contract. If multiple actions are needed (e.g., swap tokens, then stake, then mint an NFT), they require multiple transactions or a custom router contract. Sui changes this with programmable transactions—a sequence of operations bundled into a single atomic transaction. These operations can include: Calling functions in different modules. Creating, transferring, or deleting objects. Using the results of one call as inputs to another. This is made possible by Sui’s transaction building system, which allows developers to construct complex workflows off-chain and submit them as one executable unit. Example: A Multi-Step DeFi Operation Imagine a user wants to: Withdraw a token from a vault. Swap it on a DEX. Stake the output token in a liquidity pool. Mint an NFT representing their position. In Ethereum, this would require multiple transactions or a specialized smart contract. In Sui, it can be done in one atomic transaction using a programmable transaction block: // Pseudocode using Sui SDK let tx = new ProgrammableTransaction(); tx.command(Call(Vault::withdraw, [vault_id, coin_type])); tx.command(SplitCoin(0, amount)); // Split output from withdraw tx.command(Call(Dex::swap, [coin_output, target_type])); tx.command(Call(Staking::stake, [swapped_coin])); tx.command(Call(NFT::mint, [staking_receipt])); All steps execute in order. If any step fails, the entire transaction rolls back—ensuring consistency without the need for complex smart contract logic. Why Programmable Transactions Matter Atomicity**: Multiple actions succeed or fail together, reducing the risk of partial execution. Gas Efficiency**: One transaction means one gas fee, even for complex operations. User Experience**: Users can perform multi-step actions in a single click. Developer Flexibility**: No need to build monolithic "router" contracts; logic can be composed on the fly. Combining Dynamic Fields and Programmable Transactions The real power emerges when these two features are used together. Consider a decentralized social platform where: Each user profile is an object with dynamic fields for posts, likes, and followers. When a user creates a post, a programmable transaction: Creates a new Post object. Attaches it as a dynamic field to the user’s profile. Emits an event for followers. Updates a global feed counter. This entire workflow executes atomically, with all state changes guaranteed to be consistent. Another example is a game item marketplace: Items are stored as dynamic fields in a player’s inventory. A trade transaction can: Remove an item from Player A’s inventory. Add it to Player B’s inventory. Transfer payment. Update trade history—all in one transaction. Best Practices and Considerations While powerful, these features require careful use: Access Control**: Ensure only authorized entities can add or modify dynamic fields. Storage Costs**: Dynamic fields consume storage; clean up unused data to avoid bloat. Complexity Management**: Programmable transactions should be validated off-chain to prevent errors. Tooling Support**: Use Sui’s CLI, SDKs (TypeScript, Python), and IDE plugins to build and test transaction blocks safely. Conclusion Dynamic fields and programmable transactions are not just incremental improvements—they represent a fundamental shift in how smart contracts can be designed and executed. By decoupling data structure from schema and enabling multi-step logic in a single transaction, Sui Move gives developers unprecedented flexibility and efficiency. These features make Sui uniquely suited for applications that require high interactivity, rapid iteration, and complex state transitions—such as gaming, social dApps, and composable financial systems. As the ecosystem matures, we can expect to see innovative use cases that were previously impractical or impossible on other blockchains. For developers, mastering dynamic fields and programmable transactions is key to unlocking Sui’s full potential. With Sui Move, the future of smart contract development is not just secure and scalable—it’s dynamic, expressive, and endlessly composable.

    • Sui
    • Move
    0
    0