-
Notifications
You must be signed in to change notification settings - Fork 52
helpers for nested create Any objects #281
Copy link
Copy link
Open
Description
- fix type issue in comment below
- fix the interface so developer doesn't have to encode
decisionPolicyfield
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()
}
})Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels