yoroi-graphql-migration-backend icon indicating copy to clipboard operation
yoroi-graphql-migration-backend copied to clipboard

fix address format handling of tx summaries endpoint

Open yushih opened this issue 1 year ago • 0 comments

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:

  1. Byron addresses encoded in Base58
  2. Full Shelley addresses in bech32
  3. Stake key encoded in bech32, converted to hex string internally
  4. Stake key encoded in hex string
  5. 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.

yushih avatar Dec 21 '22 17:12 yushih