(pubkey: Pubkey, client: DatabaseClient = this.dbClient)
| 102 | } |
| 103 | |
| 104 | public async getBalanceByPubkey(pubkey: Pubkey, client: DatabaseClient = this.dbClient): Promise<bigint> { |
| 105 | logger('get balance for pubkey: %s', pubkey) |
| 106 | |
| 107 | const [user] = await client<DBUser>('users').select('balance').where('pubkey', toBuffer(pubkey)).limit(1) |
| 108 | |
| 109 | if (!user) { |
| 110 | return 0n |
| 111 | } |
| 112 | |
| 113 | return BigInt(user.balance) |
| 114 | } |
| 115 | |
| 116 | public async admitUser(pubkey: Pubkey, admittedAt: Date, client: DatabaseClient = this.dbClient): Promise<void> { |
| 117 | logger('admit user: %s at %s', pubkey, admittedAt) |
nothing calls this directly
no test coverage detected