2026-09-30 15:31:44 +07:00
|
|
|
package constants
|
|
|
|
|
|
|
|
|
|
// The two balances a customer wallet holds (docs/prd-point-coin.md). EnakPoint pays
|
|
|
|
|
// for orders; EnakCoin is spent on games and can be exchanged into EnakPoint.
|
|
|
|
|
const (
|
|
|
|
|
WalletCurrencyPoint = "POINT"
|
|
|
|
|
WalletCurrencyCoin = "COIN"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func IsValidWalletCurrency(currency string) bool {
|
|
|
|
|
return currency == WalletCurrencyPoint || currency == WalletCurrencyCoin
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Ledger row types. §8.1 of the PRD lists, per type, which currency it may use, which
|
|
|
|
|
// way it moves the balance, and which reference it must carry.
|
|
|
|
|
const (
|
2026-10-07 13:48:29 +07:00
|
|
|
WalletTxTypeEarn = "EARN"
|
|
|
|
|
WalletTxTypeEarnReversal = "EARN_REVERSAL"
|
|
|
|
|
WalletTxTypeExchangeOut = "EXCHANGE_OUT"
|
|
|
|
|
WalletTxTypeExchangeIn = "EXCHANGE_IN"
|
|
|
|
|
WalletTxTypeTransferOut = "TRANSFER_OUT"
|
|
|
|
|
WalletTxTypeTransferIn = "TRANSFER_IN"
|
|
|
|
|
WalletTxTypeGameSpend = "GAME_SPEND"
|
|
|
|
|
WalletTxTypeExpire = "EXPIRE"
|
|
|
|
|
WalletTxTypeAdjustment = "ADJUSTMENT"
|
|
|
|
|
WalletTxTypeMigration = "MIGRATION"
|
|
|
|
|
WalletTxTypeRewardRedeem = "REWARD_REDEEM"
|
2026-10-07 20:53:14 +07:00
|
|
|
|
|
|
|
|
// EnakGame (docs/rfc-enakgame.md §6.1).
|
|
|
|
|
WalletTxTypeGameSpendRefund = "GAME_SPEND_REFUND"
|
|
|
|
|
WalletTxTypeGameReward = "GAME_REWARD"
|
|
|
|
|
WalletTxTypeRewardRedeemRefund = "REWARD_REDEEM_REFUND"
|
2026-09-30 15:31:44 +07:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// What a ledger row's reference_id points at: where the value came from for a
|
|
|
|
|
// credit, or where it went for a debit.
|
|
|
|
|
const (
|
|
|
|
|
WalletRefTypeOrder = "ORDER"
|
|
|
|
|
WalletRefTypeWalletTx = "WALLET_TX"
|
|
|
|
|
WalletRefTypeGamePlay = "GAME_PLAY"
|
|
|
|
|
WalletRefTypeLot = "LOT"
|
|
|
|
|
WalletRefTypeUser = "USER"
|
|
|
|
|
WalletRefTypeLegacyPoints = "LEGACY_POINTS"
|
|
|
|
|
WalletRefTypeLegacyTokens = "LEGACY_TOKENS"
|
|
|
|
|
WalletRefTypeRewardRedemption = "REWARD_REDEMPTION"
|
2026-10-07 20:53:14 +07:00
|
|
|
WalletRefTypeGameSession = "GAME_SESSION"
|
2026-09-30 15:31:44 +07:00
|
|
|
)
|