p2ptrade implementation in JS (for WebcoinX)