vocdoni / interoperability

Private repository to manage the interoperability between protocol, API, SDK, UIs and documentation
1 stars 0 forks source link

track accounts, balances #104

Closed mariajdab closed 9 months ago

mariajdab commented 10 months ago

The account API now has a couple of new endpoints:

{"count":2}
{"count":3}
{
   "accounts":[
      {
         "address":"72e3305dae450c691a96397868bed3dda81806c2",
         "balance":999840,
         "nonce":0
      },
      {
         "address":"ebed47afa91854f1858b890d664102f424b66f3b",
         "balance":95,
         "nonce":1
      },
      {
         "address":"0fd969e1359f15690856900898c5740f5c9dc2f6",
         "balance":65,
         "nonce":1
      }
   ]
}

Also the endpoint /accounts/{accountID}/transfers/page/{page} was modified to include the list of token transfer sent and received

"transfers":{
   "received":[
      {
         "amount":10,
         "from":"794cec5258b86de17f2377812260f17f2049882f",
         "height":4,
         "txHash":"DFc7mGb3dSavLhaJPPAwBlFHnJ38r/HbfWZtQjC6ECE=",
         "timestamp":"2023-11-08T15:34:43.439505326-04:00",
         "to":"bc532c8c26e9dad20acdd72fbbf77956bcda12ce"
      },
      {
         "amount":80,
         "from":"54c5d4deecdbeee25dbab86177d3e107e025ded2",
         "height":1,
         "txHash":"48omzG5uKCs6Ybcy3ElFsTD6MPXA8n7GkGCRES/hg/w=",
         "timestamp":"2023-11-08T15:34:43.396857837-04:00",
         "to":"bc532c8c26e9dad20acdd72fbbf77956bcda12ce"
      }
   ],
   "sent":[
      {
         "amount":25,
         "from":"bc532c8c26e9dad20acdd72fbbf77956bcda12ce",
         "height":3,
         "txHash":"kplkDVk2MWDwVq0hVFtHDeAYbu5p4oUbXCYYEWdSGcs=",
         "timestamp":"2023-11-08T15:34:43.43008297-04:00",
         "to":"794cec5258b86de17f2377812260f17f2049882f"
      }
   ]
}
}
p4u commented 10 months ago

To implement at some moment by @marcvelmer into the SDK (not a priority).

p4u commented 10 months ago

ouch @mariajdab Received and Sent should be lowercase, please send new PR

mariajdab commented 10 months ago

ouch @mariajdab Received and Sent should be lowercase, please send new PR

My bad. I opened the PR to fix it: https://github.com/vocdoni/vocdoni-node/pull/1187

marcvelmer commented 10 months ago

All changes done in the SDK: https://github.com/vocdoni/vocdoni-sdk/pull/310