Class: VotingChallenge<T>
VotingChallenge defines a rule for approval in the form of a voting/multi-sig challenge. Requires a weighted quorum threshold to be met through votes from…
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1399
VotingChallenge defines a rule for approval in the form of a voting/multi-sig challenge. Requires a weighted quorum threshold to be met through votes from specified voters. All challenges must be met with valid solutions for the transfer to be approved.
IMPORTANT: Votes are stored separately and can be updated. The threshold is calculated as a percentage of total possible weight (all voters), not just voted weight. If you update the proposal ID, then the vote tracker will reset and start a new tally. We recommend using a unique proposal ID for each challenge to prevent overlap and unexpected behavior.
Extends
BaseNumberTypeClass<VotingChallenge<T>>
Type Parameters
T
T extends NumberType
Implements
Constructors
Constructor
new VotingChallenge<
T>(votingChallenge):VotingChallenge<T>
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1408
Parameters
votingChallenge
Returns
VotingChallenge<T>
Overrides
BaseNumberTypeClass.constructor
Properties
customData?
optionalcustomData?:string
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1404
Arbitrary custom data associated with this voting challenge.
Implementation of
delayAfterQuorum?
optionaldelayAfterQuorum?:T
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1406
Mandatory delay in milliseconds after quorum is reached before the transfer can execute.
Implementation of
iVotingChallenge.delayAfterQuorum
proposalId
proposalId:
string
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1400
The ID of this voting challenge for tracking votes (scoped like challengeTrackerId). Format: collectionId-approverAddress-approvalLevel-approvalId-challengeId
Implementation of
quorumThreshold
quorumThreshold:
T
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1401
The quorum threshold as a percentage (0-100) of total possible weight that must vote "yes". Example: 50 means 50% of total voter weight must vote yes for approval.
Implementation of
iVotingChallenge.quorumThreshold
resetAfterExecution?
optionalresetAfterExecution?:boolean
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1405
If true, all votes for this challenge are cleared after a successful transfer execution.
Implementation of
iVotingChallenge.resetAfterExecution
uri?
optionaluri?:string
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1403
The URI associated with this voting challenge.
Implementation of
voters
voters:
Voter<T>[]
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1402
List of voters with their weights. Each voter can cast a weighted vote.
Implementation of
Methods
clone()
clone():
VotingChallenge
Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:151
Deep copies the object and returns a new instance.
Returns
VotingChallenge
Inherited from
convert()
convert<
U>(convertFunction,options?):VotingChallenge<U>
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1423
Converts the object to a different NumberType equivalent.
Type Parameters
U
U extends NumberType
Parameters
convertFunction
(item) => U
options?
Returns
VotingChallenge<U>
Overrides
equals()
equals<
U>(other,normalizeNumberTypes?):boolean
Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:147
Compares this object's fields to another object's fields for equality. Equality is determined by comparing the JSON representations of the objects.
If normalizeNumberTypes is true, then all number types will be compared as strings (i.e. "1n" === "1" === 1). Else, they will be compared as their native types (i.e. 1n !== 1 !== "1").
Type Parameters
U
U extends CustomType<U>
Parameters
other
CustomType<U> | null | undefined
normalizeNumberTypes?
boolean
Returns
boolean
Inherited from
getNumberFieldNames()
getNumberFieldNames():
string[]
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1419
Internal helper method to convert the number fields of the object to a different NumberType equivalent.
Returns
string[]
Overrides
BaseNumberTypeClass.getNumberFieldNames
hasNumberFields()
hasNumberFields():
boolean
Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:161
Checks if the object has number fields.
Returns
boolean
Inherited from
BaseNumberTypeClass.hasNumberFields
toJson()
toJson():
JsonObject
Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:139
Converts the object to a JSON object with all primitive types.
Returns
JsonObject
Inherited from
toJsonString()
toJsonString():
string
Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:143
Converts the object to a JSON string.
Returns
string
Inherited from
BaseNumberTypeClass.toJsonString
fromProto()
staticfromProto<U>(item,convertFunction):VotingChallenge<U>
Defined in: packages/bitbadgesjs-sdk/src/core/misc.ts:1427
Type Parameters
U
U extends NumberType
Parameters
item
VotingChallenge
convertFunction
(item) => U
Returns
VotingChallenge<U>