sc/deposit.js
function getDepositAddressBySupernodeAddress(conn, supernodeAddress, cb){
    var conn = conn || db;
    if(!validationUtils.isNonemptyString(supernodeAddress))
        return cb("param supernodeAddress is null or empty string");
    if(!validationUtils.isValidAddress(supernodeAddress))
        return cb("param supernodeAddress is not a valid address");

    conn.query("SELECT deposit_address FROM supernode WHERE address = ?", [supernodeAddress], 
        function(rows) {
            if (rows.length !== 1 )
                return cb("deposit address is not found when getDepositAddressBySupernodeAddress " + supernodeAddress);
            cb(null, rows[0].deposit_address);
    });
}
function getDepositAddressBySupernodeAddress(conn, supernodeAddress, cb){
    var conn = conn || db;
    if(!validationUtils.isNonemptyString(supernodeAddress))
        return cb("param supernodeAddress is null or empty string");
    if(!validationUtils.isValidAddress(supernodeAddress))
        return cb("param supernodeAddress is not a valid address");

    conn.query("SELECT deposit_address FROM supernode WHERE address = ?", [supernodeAddress], 
        function(rows) {
            if (rows.length !== 1 )
                return cb("deposit address is not found when getDepositAddressBySupernodeAddress " + supernodeAddress);
            cb(null, rows[0].deposit_address);
    });
}
function getDepositAddressBySupernodeAddress ( conn , supernodeAddress , cb ) { var conn = conn || db ; if ( ! validationUtils . isNonemptyString ( supernodeAddress ) ) return cb ( "param supernodeAddress is null or empty string" ) ; if ( ! validationUtils . isValidAddress ( supernodeAddress ) ) return cb ( "param supernodeAddress is not a valid address" ) ; conn . query ( "SELECT deposit_address FROM supernode WHERE address = ?" , [ supernodeAddress ] , function ( rows ) { if ( rows . length !== 1 ) return cb ( "deposit address is not found when getDepositAddressBySupernodeAddress " + supernodeAddress ) ; cb ( null , rows [ 0 ] . deposit_address ) ; } ) ; }
Returns deposit address by supernode address.

@param	{obj}	    conn      if conn is null, use db query, otherwise use conn.
@param   {String}    supernodeAddress
@param   {function}	cb( err, deposit_address ) callback function
If depositAddress is invalid, then returns err "invalid address".
If can not find the address, then returns err "deposit address not found".
Returns deposit address by supernode address .