Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vesting account data #138

Closed
ryuash opened this issue May 20, 2021 · 2 comments · Fixed by #232
Closed

Vesting account data #138

ryuash opened this issue May 20, 2021 · 2 comments · Fixed by #232
Assignees

Comments

@ryuash
Copy link

ryuash commented May 20, 2021

Feature description

Big dipper + Forbole X might need to be able to display an account's vesting info if there are any. Is there an easy/ efficient way that we can log this data in bdjuno?

I was able to get the following data from

desmos q account desmos1snmetx9sfrmznr4z6d3lnwlyvwu36sgcpzzhlr
{
  "@type": "/desmos.profiles.v1beta1.Profile",
  "account": {
    "@type": "/cosmos.vesting.v1beta1.PeriodicVestingAccount",
    "base_vesting_account": {
      "base_account": {
        "address": "desmos1snmetx9sfrmznr4z6d3lnwlyvwu36sgcpzzhlr",
        "pub_key": {
          "@type": "/cosmos.crypto.secp256k1.PubKey",
          "key": "AsmSLYJM5CoIwuYQF+XvOFMSK1HeijFHF9XehSZGfET9"
        },
        "account_number": "143",
        "sequence": "3"
      },
      "original_vesting": [
        {
          "denom": "udaric",
          "amount": "30000000000"
        }
      ],
      "delegated_free": [],
      "delegated_vesting": [],
      "end_time": "1619766000"
    },
    "start_time": "1619506800",
    "vesting_periods": [
      {
        "length": "86400",
        "amount": [
          {
            "denom": "udaric",
            "amount": "10000000000"
          }
        ]
      },
      {
        "length": "86400",
        "amount": [
          {
            "denom": "udaric",
            "amount": "10000000000"
          }
        ]
      },
      {
        "length": "86400",
        "amount": [
          {
            "denom": "udaric",
            "amount": "10000000000"
          }
        ]
      }
    ]
  },
  "dtag": "Apollo",
  "moniker": "Apollo",
  "bio": "One of the most important and complex of the Greek gods, son of Zeus and Leto, and the twin brother of Artemis, goddess of the hunt.",
  "pictures": {
    "profile": "https://vignette.wikia.nocookie.net/olympians/images/5/54/Apollo_Viria.jpg/revision/latest/scale-to-width-down/298\\?cb\\=20180413123657",
    "cover": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Hazy_Crazy_Sunrise.jpg/1200px-Hazy_Crazy_Sunrise.jpg"
  },
  "creation_date": "2021-04-30T09:31:51.619099537Z"
}

Implementation proposal

@huichiaotsou
Copy link
Contributor

Hi @RiccardoM , is there a way to unpack the account of specific account types ?

For example I tried the below but BaseVestingAccount doesn't seem to store anything:

for _, account := range authState.Accounts {
    var BaseVestingAccount authvestingtypes.BaseVestingAccount
    cdc.UnpackAny(account, &BaseVestingAccount)
}

@RiccardoM
Copy link
Contributor

RiccardoM commented Oct 18, 2021

Hi @RiccardoM , is there a way to unpack the account of specific account types ?

Answered here: #232 (comment)

@mergify mergify bot closed this as completed in #232 Oct 20, 2021
mergify bot pushed a commit that referenced this issue Oct 20, 2021
<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v                               ✰  Thanks for creating a PR! ✰    
v    Before smashing the submit button please review the checkboxes.
v    If a checkbox is n/a - please still include it but + a little note why
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >  -->

## Description
This PR replaces #158 
close #138

## Checklist
- [x] Targeted PR against correct branch.
- [x] Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
- [x] Wrote unit tests.  
- [x] Re-reviewed `Files changed` in the Github PR explorer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants