I'm hoping to use the Coinbase Bitcoin Exchange node.js API from inside ClojureScript.
The goal is to replicate the first javascript example on the page:
var CoinbaseExchange = require('coinbase-exchange');
var publicClient = new CoinbaseExchange.PublicClient();
But in my following code I've started by trying to access PublicClient at all:
(ns plutus.core
(:require
[cljs.nodejs :as nodejs]))
(def coinb (nodejs/require "coinbase-exchange"))
(nodejs/enable-util-print!)
(defn -main [& args]
(def pc (js/PublicClient.)))
(println pc))
(set! *main-cli-fn* -main)
This throws a ReferenceError: PublicClient is not defined, though I've also tried (along with similar variations):
(def pc (. coinb (PublicClient)))(def pc (.PublicClient coinb))(def pc (:PublicClient coinb))
All of which have failed by printing nil. I've pretty closely studied this article for any relevant examples, but I'm confused on how using node.js affects the naming of things, if at all.