hyperweb-io / hyperweb-io/telescope

helpers for nested create Any objects

Open
#281 20 comments 1 reaction 1 assignee Claimed by @hoangdv2429 View on GitHub
Dominant language
TypeScript
Stars
154
Forks
53
PR merge metrics
No merged PRs in 30d

Description

https://github.com/cosmos/groups-ui/blob/master/src/shared-state/groups-store.ts#L363

- [ ] fix type issue in comment below
- [ ] fix the interface so developer doesn't have to encode `decisionPolicy` field

```js
import Long from 'long';
const {
createGroupWithPolicy
} = cosmos.group.v1.MessageComposer.withTypeUrl;

const {
PercentageDecisionPolicy
} = cosmos.group.v1;

const msg = createGroupWithPolicy({
admin: 'a string',
groupMetadata: 'string here',
groupPolicyAsAdmin: true,
groupPolicyMetadata: 'a string here too',
members: [], // MemberRequest[],
decisionPolicy: { // types here aren't exactly happy with the encode function for some reason...
// WE CAN IMPROVE THIS....
typeUrl: '/cosmos.group.v1.PercentageDecisionPolicy',
value: PercentageDecisionPolicy.encode({
percentage: 'a string',
windows: {
votingPeriod: {
nanos: 0,
seconds: Long.fromValue(100)
},
minExecutionPeriod: {
nanos: 0,
seconds: Long.fromValue(100)
}
}
}).finish()
}
})
```

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.