stellar / js-stellar-base

The lowest-level stellar helper library. It consists of classes to read, write, hash, and sign Stellar xdr
https://stellar.github.io/js-stellar-base/
Apache License 2.0
106 stars 138 forks source link

Missing types in OperationType #728

Open aristidesstaffieri opened 7 months ago

aristidesstaffieri commented 7 months ago

Describe the bug Missing revoke sponsorship types in OperationType

What version are you on? @stellar/stellar-base@10.0.1

To Reproduce Go to lab an build a "Revoke Sponsorship" op. Select any of the options and fill out the fields. Inspect the transaction and note that operation.type !== 'revokeSponsorship' but instead has a type specific to the type of revocation(revokeTrustlineSponsorship for example).

Expected behavior The OperationType type would have op types matching the Operation type, which would allow clients downstream to switch over operation.type which is an Operation.BaseOperation<T extends OperationType = OperationType>.type.

Additional context Here is where I step around this in a client - https://github.com/stellar/freighter/pull/1096/files#diff-e0ff0af943168c2545ebfe644635fa24c65c454685e591e279f3e410ab66fa23R644