thenewboston-developers / thenewboston-Backend

API for thenewboston.
18 stars 9 forks source link

201 - endpoint for getting user's default wallet #202

Closed MAbdurrehman1 closed 4 months ago

MAbdurrehman1 commented 4 months ago

Closes #201

API Details

URL:

base_domain/api/wallets/default

For Local (running on 8000)

http://localhost:8000/api/wallets/default

Example Response:

{
    "balance": 1090,
    "core": {
        "id": 1,
        "created_date": "2024-04-14T11:52:29.117397Z",
        "modified_date": "2024-04-14T11:53:36.289286Z",
        "domain": "thenewboston.com",
        "logo": "http://localhost:8000/media/images/tnb-logo_cHv935Y.png",
        "ticker": "TNB",
        "owner": 1
    },
    "created_date": "2024-04-29T07:59:48.605785Z",
    "deposit_account_number": "a7809323c895db95e25b82fec1d208ad4f7e17c14177d4481d857c2c14269874",
    "deposit_balance": 0,
    "id": 2,
    "modified_date": "2024-05-29T14:51:51.950459Z",
    "owner": 4
}

If wallet doesn't not exist, then example response:

{
    "error": "Default wallet not found."
}