hyperweb-io / hyperweb-io/create-cosmos-app

[voting example] Decoded content didn't follow the same pattern

Open
#69 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
166
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Get the decoded content
```js
const { proposals } = await client.cosmos.gov.v1beta1.proposals({
proposalStatus: ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED,
depositor: '',
voter: '',
});

const decodeUint8Arr = (uint8array: Uint8Array | undefined) => {
if (!uint8array) return '';
return new TextDecoder('utf-8').decode(uint8array);
};

for (const proposal of proposals) {
console.log(decodeUint8Arr(proposal.content?.value));
}
```

Some decoded results
`*Confirmation by CCN to agree to Unity Prop�This proposal signals that...`
`=Community Spend Proposal for Creation of Terra Developer Fund�!# Community Spend Proposal...`
`Increase Validator Set to 150�# Increase Validator Set to 150...`
`QJuno on Osmosis - Early pool incentives to mitigate slippage and boost liquidity.�The core...`
`#MARS Airdrop for COSMOS holders ✅�According to tokenomics...`
`>Fair and Equitable Distribution of Remaining Funds (corrected)� The multi-sig created by...`

The pattern before and after the title aren't always the same so it makes it hard to extract the correct title and description at all times.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.