Open tequdev opened 1 year ago
What I'm trying to say is that instead of providing type definitions for xrpl.js, it would be better to provide more generic type definitions.
Projects and other client libraries will be able to spend their time on more valuable things.
The types try to reflect what the websocket response is. xrpl-client
simplifies it when it is successful and only returns the result
part. Since the xrpl.org Explorer also uses xrpl-client
this would be a very nice edition to break these portions of the response out.
Currently,
AccountInfoResponse
and other Response types contain aresult
field, which contains the original response of the method.https://github.com/XRPLF/xrpl.js/blob/74de24cf75ff5a3d42ebe2fa17c9733812103881/packages/xrpl/src/models/methods/accountInfo.ts#L137-L178
Since other client libraries, such as xrpl-client, will only use the contents of the
result
field, it is preferable to define this part separately.Otherwise, other libraries will need to define it as
AccountInfoResponse['result']
.In xrpl.js, it may be better to use it in the form of
MethodResponse<AccountInfoResponse>
.xrpl-client example
result