Store

Defines the way in which the state of the Subaccount is being stored in the chain.

Account Summary

The Create and TopUp messages are used to store the data of a particular subaccount's locked balance in the blockchain. The AccountSummary entity consists of the following fields:

  1. deposited_amount: The total amount that has been transferred to a subaccount so far.

  2. spent_amount: The spent amount that has been used for wager and deposit.

  3. withdrawn_amount: The amount that has been withdrawn from the subaccount's unlocked/locked balance.

  4. lost_amount: The amount that has been lost in wager and deposit.

The proto for the Deposit messages is as follows:

// AccountSummary defines the balance of a subaccount.
message AccountSummary {
  // deposited_amount keeps track of how much was deposited so far in the
  // subaccount.
  string deposited_amount = 1 [
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];

  // spent_amount keeps track of how much was spent in the account in betting,
  // house, staking, etc.
  string spent_amount = 2 [
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];

  // withdrawn_amount keeps track of how much was withdrawn in the account after
  // locked coins become unlocked.
  string withdrawn_amount = 3 [
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];

  // lost_amount keeps track of the amounts that were lost due to betting
  // losses, slashing etc.
  string lost_amount = 4 [
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
}

LockedBalance

The Create and TopUp messages are used to store the data of a particular subaccount's locked balance in the blockchain. The LockedBalance entity consists of the following fields:

  1. amount: The amount of locked balance.

  2. unlock_ts: The time when the amount would be unlocked.

The proto for the locked balance is as follows:

// LockedBalance defines a balance which is locked.
message LockedBalance {
  uint64 unlock_ts = 1 [
    (gogoproto.customname) = "UnlockTS",
    (gogoproto.jsontag) = "unlock_ts",
    json_name = "unlock_ts"
  ];
  string amount = 2 [
    (gogoproto.customtype) = "cosmossdk.io/math.Int",
    (gogoproto.nullable) = false
  ];
}

Last updated