Balances

https://github.com/BitBadges/bitbadgeschain/blob/master/proto/badges/balances.proto
syntax = "proto3";
package badges;  

import "gogoproto/gogo.proto";
import "badges/params.proto";
// this line is used by starport scaffolding # genesis/proto/import

option go_package = "github.com/bitbadges/bitbadgeschain/x/badges/types";

/* 
  The UintRange is a range of IDs from some start to some end (inclusive).
  uintRanges are one of the core types used.

  They are used for everything from token IDs to time ranges to min/max balance amounts.

  See the BitBadges documentation for more information.
*/
message UintRange {
  // The starting value of the range (inclusive).
  string start = 1 [(gogoproto.customtype) = "Uint", (gogoproto.nullable) = false];

  // The ending value of the range (inclusive).
  string end = 2 [(gogoproto.customtype) = "Uint", (gogoproto.nullable) = false];
}


/* 
  Balance represents the balance of a token for a specific user.
  The user amounts xAmount of a token for the badgeID specified for the time ranges specified.

  Example: User A owns x10 of token IDs 1-10 from 1/1/2020 to 1/1/2021.
  
  If times or badgeIDs have len > 1, then the user owns all token IDs specified for all time ranges specified.
*/
message Balance {
  // The amount of the token owned by the user.
  string amount = 1 [(gogoproto.customtype) = "Uint", (gogoproto.nullable) = false];

  // The time ranges during which the user owns the token.
  repeated UintRange ownershipTimes = 2;

  // The token IDs for which the user owns the token.
  repeated UintRange badgeIds = 3;
}

Last updated