import knex from '../db/knex' ; import { Address , AddressInformation } from '../types/database' ; param payId returns export async function getAllAddressInfoFromDatabase ( payId ) { const addressInformation = await knex . select ( 'address.paymentNetwork' , 'address.environment' , 'address.details' ) . from < Address > ( 'address' ) . innerJoin ( 'account' , 'address.accountId' , 'account.id' ) . where ( 'account.payId' , payId ) . whereNull ( 'address.identityKeySignature' ) ; return addressInformation ; } param payId returns export async function getAllVerifiedAddressInfoFromDatabase ( payId ) { const addressInformation = await knex . select ( 'address.paymentNetwork' , 'address.environment' , 'address.details' , 'address.identityKeySignature' ) . from < Address > ( 'address' ) . innerJoin ( 'account' , 'address.accountId' , 'account.id' ) . where ( 'account.payId' , payId ) . whereNotNull ( 'address.identityKeySignature' ) ; return addressInformation ; } param payId returns export async function getIdentityKeyFromDatabase ( payId ) { const identityKey = await knex . select ( 'account.identityKey' ) . from < Account > ( 'account' ) . where ( 'account.payId' , payId ) ; return identityKey [ 0 ] . identityKey ; }