yoroi-graphql-migration-backend
yoroi-graphql-migration-backend copied to clipboard
fix address format handling of tx summaries endpoint
Background: Previously when I was implementing the API, I didn't get the input address handing correct. To be consistent with other APIs that take address (set) inputs, the supported address types should be:
- Byron addresses encoded in Base58
- Full Shelley addresses in bech32
- Stake key encoded in bech32, converted to hex string internally
- Stake key encoded in hex string
- Payment key hash encoded in bech32, converted to hex string internally
For a shelly address, if the client wants to match by full address (payment key hash and stake address), it should pass 2. If the client wants to match only the payment key hash and disregard the stake part, it should pass 5.
Type 1 & 2 should be matched against tx_out.address
. Type 5 should be matched against tx_out.payment_cred
(after the conversion to hex string).
This PR fixes handling of address type 5.