sarvalabs / js-moi-sdk

JavaScript library to interact with MOI Protocol via RPC API
https://js-moi-sdk.docs.moi.technology/
Apache License 2.0
24 stars 2 forks source link

Enhance ix operation to automatically suggest payload type based on optype #104

Open sarvalabs-gokul opened 1 day ago

sarvalabs-gokul commented 1 day ago

Description

Currently, the IxOperation interface requires manual specification of the payload type, which can lead to inconsistencies or errors. To improve this, the operation type (OpType) should be used to automatically determine and suggest the appropriate payload type (OperationPayload).

This enhancement will streamline the operation process, ensuring that the correct payload is associated with the corresponding operation type without manual intervention.

Expected Changes

  1. Modify the IxOperation interface to support automatic suggestion of payload type based on the OpType field.
  2. Ensure proper type inference to eliminate the need for manually specifying the payload for each operation type.
  3. This will improve consistency and reduce errors in specifying payloads for operations.