Class: PredeterminedBalances<T>
PredeterminedBalances represents the predetermined balances for an approval. This allows you to define an approval where Transfer A happens first, then…
Defined in: packages/bitbadgesjs-sdk/src/core/approvals.ts:464
PredeterminedBalances represents the predetermined balances for an approval. This allows you to define an approval where Transfer A happens first, then Transfer B, then Transfer C, etc. The order of the transfers is defined by the orderCalculationMethod. The order number 0 represents the first transfer, 1 represents the second transfer, etc.
IMPORTANT: if the balances of the transfer do not exactly match the predetermined balances, then the transfer will fail.
Extends
BaseNumberTypeClass<PredeterminedBalances<T>>
Type Parameters
T
T extends NumberType
Implements
Constructors
Constructor
new PredeterminedBalances<
T>(msg):PredeterminedBalances<T>
Defined in: packages/bitbadgesjs-sdk/src/core/approvals.ts:469
Parameters
msg
Returns
PredeterminedBalances<T>
Overrides
BaseNumberTypeClass.constructor
Properties
incrementedBalances
incrementedBalances:
IncrementedBalances<T>
Defined in: packages/bitbadgesjs-sdk/src/core/approvals.ts:466
Define a starting balance and increment the token IDs and owned times by a certain amount after each transfer. Cannot be used with manualBalances. Order number corresponds to number of times we increment.
Implementation of
iPredeterminedBalances.incrementedBalances
manualBalances
manualBalances:
ManualBalances<T>[]
Defined in: packages/bitbadgesjs-sdk/src/core/approvals.ts:465
Manually define the balances for each transfer. Cannot be used with incrementedBalances. Order number corresponds to the index of the balance in the array.
Implementation of
iPredeterminedBalances.manualBalances
orderCalculationMethod
orderCalculationMethod:
PredeterminedOrderCalculationMethod
Defined in: packages/bitbadgesjs-sdk/src/core/approvals.ts:467
The order calculation method.
Implementation of
iPredeterminedBalances.orderCalculationMethod
Methods
clone()
clone():
PredeterminedBalances
Defined in: packages/bitbadgesjs-sdk/src/common/base.ts:151
Deep copies the object and returns a new instance.
Returns
PredeterminedBalances
Inherited from
convert()
convert<
U>(convertFunction,options?):PredeterminedBalances<U>
Defined in: packages/bitbadgesjs-sdk/src/core/approvals.ts:476
Converts the object to a different NumberType equivalent.
Type Parameters
U
U extends NumberType
Parameters
convertFunction
(item) => U
options?
Returns
PredeterminedBalances<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/common/base.ts:157
Internal helper method to convert the number fields of the object to a different NumberType equivalent.
Returns
string[]
Inherited from
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
toProto()
toProto():
PredeterminedBalances
Defined in: packages/bitbadgesjs-sdk/src/core/approvals.ts:486
Returns
PredeterminedBalances
fromJson()
staticfromJson<U>(jsonValue,convertFunction,options?):PredeterminedBalances<U>
Defined in: packages/bitbadgesjs-sdk/src/core/approvals.ts:490
Type Parameters
U
U extends NumberType
Parameters
jsonValue
JsonValue
convertFunction
(item) => U
options?
Partial<JsonReadOptions>
Returns
PredeterminedBalances<U>
fromJsonString()
staticfromJsonString<U>(jsonString,convertFunction,options?):PredeterminedBalances<U>
Defined in: packages/bitbadgesjs-sdk/src/core/approvals.ts:498
Type Parameters
U
U extends NumberType
Parameters
jsonString
string
convertFunction
(item) => U
options?
Partial<JsonReadOptions>
Returns
PredeterminedBalances<U>
fromProto()
staticfromProto<U>(item,convertFunction):PredeterminedBalances<U>
Defined in: packages/bitbadgesjs-sdk/src/core/approvals.ts:506
Type Parameters
U
U extends NumberType
Parameters
item
PredeterminedBalances
convertFunction
(item) => U
Returns
PredeterminedBalances<U>