Skip to content

Update ADAView Search to use new POST method #58

@johnnuy

Description

@johnnuy

Currently with the Version 1.0 API the search address is passed as part of the URL:
https://api.canadastakes.ca/mainnet/api/wallets/


If the address resolves to a wallet identifier then the url will return a 200 OK with the contents:
https://api.canadastakes.ca/mainnet/api/wallets/stake1uylw5ges065hhcexl7vyc8fgpeqpdja9mqlmpxp4fr6lmvsqn9m47

If the address resolves to an address that is part of a larger wallet, then the url will return a 307 with a Location Header pointing to the wallet identifier:
https://api.canadastakes.ca/mainnet/api/wallets/addr1q80vyudy9nltkq30l96h420y66z0srhlrzg3cm569f09yxe7ag3nql4f003jdlucfswjsrjqzm96tkplkzvr2j84lkeqjsknaf

This has the limitation that the address must fit within the max length of a URL. There exists legacy random cardano addresses where this is not the case. As a result the address can now be POSTed to the URL:

https://api-dev.canadastakes.ca/mainnet/api/wallets

with a json request body in the format:
{
"address": ""
}

Sample Large Wallet POST.txt

Which will now return a json response body with the format.
{
"walletIdentifier":"legacy1844q67czzkmz2dc7vjh5k774cks0zhlmvza2q843y38t2fmg2cx",
"message":"Wallet identifier located",
"network":"mainnet"
}

The wallet identifier represents a hashed value of the address that is url safe, and can now be used to retrieve the wallet data as in the 1.0 API:
https://api-dev.canadastakes.ca/mainnet/api/wallets/legacy1844q67czzkmz2dc7vjh5k774cks0zhlmvza2q843y38t2fmg2cx

The wallet identifier returned from the POST should be what is stored in the saved searches, not the original address that was POSTed.

This work can be done on a branch based on the current dev branch.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions