UserBalanceStore is the store for the user balances for a collection.

It consists of a list of balances, a list of approved outgoing transfers, and a list of approved incoming transfers, as well as the permissions for updating the approved incoming/outgoing transfers.

Upon initialization, all fields (minus the balances) are set to the defaults specified by the collection.

The outgoing transfers can be used to allow / disallow transfers which are sent from this user. If a transfer has no match, then it is disallowed by default, unless from == initiatedBy (i.e. initiated by this user) and autoApproveSelfInitiatedOutgoingTransfers is set to true.

The incoming transfers can be used to allow / disallow transfers which are sent to this user. If a transfer has no match, then it is disallowed by default, unless to == initiatedBy (i.e. initiated by this user) and autoApproveSelfInitiatedIncomingTransfers is set to true.

Note that the user approved transfers are only checked if the collection approved transfers do not specify to override the user approved transfers.

The permissions are used to determine whether the user can update the approved incoming/outgoing transfers and auto approvals.

from message badges.UserBalanceStore

Hierarchy

Constructors

Properties

autoApproveSelfInitiatedIncomingTransfers: boolean = false

Whether to auto-approve self-initiated incoming transfers for this user (i.e. to == initiatedBy).

from field: bool autoApproveSelfInitiatedIncomingTransfers = 5;

autoApproveSelfInitiatedOutgoingTransfers: boolean = false

Whether to auto-approve self-initiated outgoing transfers for this user (i.e. from == initiatedBy).

from field: bool autoApproveSelfInitiatedOutgoingTransfers = 4;

balances: proto.badges.Balance[] = []

The list of balances associated with this user.

from field: repeated badges.Balance balances = 1;

incomingApprovals: proto.badges.UserIncomingApproval[] = []

The list of approved incoming transfers for this user.

from field: repeated badges.UserIncomingApproval incomingApprovals = 3;

outgoingApprovals: proto.badges.UserOutgoingApproval[] = []

The list of approved outgoing transfers for this user.

from field: repeated badges.UserOutgoingApproval outgoingApprovals = 2;

userPermissions?: proto.badges.UserPermissions

The permissions for this user's actions and transfers.

from field: badges.UserPermissions userPermissions = 6;

fields: FieldList = ...
runtime: ProtoRuntime = proto3
typeName: "badges.UserBalanceStore" = "badges.UserBalanceStore"

Methods