XYOracleNetwork/sdk-diviner-nodejs

View on GitHub
src/payment/repository/firestore/plugin/firestore-credit.endpoint.ts

Summary

Maintainability
A
3 hrs
Test Coverage
/* eslint-disable @typescript-eslint/no-explicit-any */
import { FirestoreCoinAuth } from '../firestore-coin-auth'

export class XyoFirestoreCreditEndpoint {
  public static query = 'coinCredits(token: String): Float'
  public static queryName = 'coinCredits'
  private spendStore: FirestoreCoinAuth

  constructor(spend: FirestoreCoinAuth) {
    this.spendStore = spend
  }

  public async resolve(obj: any, args: any): Promise<any> {
    return this.spendStore.getCredits(args.token)
  }
}