Converted General RPC from Coffee to JS