You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guys! I'd like to discuss some insights regarding the getAssetSignatures methods within the DAS-API standard.
Currently, the method returns the following structure:
I would like to draw your attention particularly to the structure of the items field. It is an array of arrays, each containing two string elements. This format may introduce several challenges for future use, support, and extension of this API method, specifically:
The lack of field names within arrays complicates understanding the elements' meanings without additional documentation or context, potentially leading to misinterpretation and misuse.
Relying on index-based data access in deserialized structures heightens the risk of errors, as it is easy to reference an incorrect index, leading to inaccurate data retrieval or runtime errors.
Implementing data-driven algorithms becomes more complex and less intuitive due to the necessity of managing array indices, increasing the likelihood of mistakes.
Extending the internal array structure poses various difficulties. For instance, adding a slot number to the inner array, alongside the transaction signature and instruction name (akin to the implementation in the getSignaturesForAddress method of solana-rpc), introduces type inconsistencies. While Rust can utilize a tuple (String, String, u64), Golang would require a [][]interface{}, necessitating type conversion from interface to string or uint64 before each element's usage. Moreover, even in Rust, handling a tuple (String, String, u64) is less clear and convenient than working with a dedicated data structure.
To address these issues, we propose an alternative data structure for the items field in the getAssetSignatures method. The following JSON schema demonstrates our suggestion, where each element of the items array is a separate structure:
Hi guys! I'd like to discuss some insights regarding the
getAssetSignatures
methods within the DAS-API standard.Currently, the method returns the following structure:
I would like to draw your attention particularly to the structure of the
items
field. It is an array of arrays, each containing two string elements. This format may introduce several challenges for future use, support, and extension of this API method, specifically:getSignaturesForAddress
method of solana-rpc), introduces type inconsistencies. While Rust can utilize a tuple (String, String, u64), Golang would require a [][]interface{}, necessitating type conversion from interface to string or uint64 before each element's usage. Moreover, even in Rust, handling a tuple (String, String, u64) is less clear and convenient than working with a dedicated data structure.To address these issues, we propose an alternative data structure for the
items
field in thegetAssetSignatures
method. The following JSON schema demonstrates our suggestion, where each element of the items array is a separate structure:This approach addresses all previously mentioned issues. I invite you to discuss the merits and potential drawbacks of this proposal. Thanks!
The text was updated successfully, but these errors were encountered: