本文整理汇总了Java中com.ripple.client.transport.impl.JavaWebSocketTransportImpl类的典型用法代码示例。如果您正苦于以下问题:Java JavaWebSocketTransportImpl类的具体用法?Java JavaWebSocketTransportImpl怎么用?Java JavaWebSocketTransportImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JavaWebSocketTransportImpl类属于com.ripple.client.transport.impl包,在下文中一共展示了JavaWebSocketTransportImpl类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RPClient
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
public RPClient() {
/*
* LSystem.applicationProxy = new ProxySettings("127.0.0.1", 1080);
* LSystem.applicationProxy.setSocket(true);
* LSystem.applicationProxy.setEnabled(true);
*/
// ClientLogger.quiet = true;
pClinet = new Client(new JavaWebSocketTransportImpl());
if (LSystem.applicationProxy != null) {
pClinet.setProxy(LSystem.applicationProxy.getProxy());
}
if (!testing) {
node_path = getRippledNode();
pClinet.connect(node_path);
}
}
示例2: testOffersLoad
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
@Test
public void testOffersLoad() {
Client client = new Client(new JavaWebSocketTransportImpl());
client.connect("wss://s1.ripple.com");
Request request = client.requestBookOffers(XRP, BITSTAMP_USD);
request.once(Request.OnResponse.class, new Request.OnResponse() {
@Override
public void called(Response response) {
System.out.println(response);
}
});
request.request();
}
示例3: main
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
public static void main(String[] args) throws JSONException {
Client client = new Client(new JavaWebSocketTransportImpl());
client.connect("wss://s1.ripple.com");
BookEvents bookEvents = new BookEvents() {
@Override
public void onUpdate(OrderBookPair book) {
if (!book.isEmpty()) {
System.out.printf("%s Ask: %s, Bid: %s, Spread %s%n",
book.currencyPair(),
book.ask.toText(),
book.bid.toText(),
book.spread.toText());
System.out.println(Arrays.toString(book.asks.toArray()));
System.out.println(Arrays.toString(book.bids.toArray()));
} else {
System.out.printf("%s No info!%n", book.currencyPair());
}
}
private void showOfferInfo(Offer offer) {
BigDecimal payForOne = offer.askQuality();
Amount getsOne = offer.getsOne();
Amount paysOne = offer.paysOne();
System.out.println("Directory quality: " + offer.directoryAskQuality().toPlainString());
// Multiply and divide will round/scale to the required bounds
System.out.printf("%40s == %s\n", paysOne.multiply(payForOne).toText(), getsOne.toText());
System.out.printf("%40s == %s\n", getsOne.divide(payForOne).toText(), paysOne.toText());
}
};
new OrderBookPair(client, XRP, BITSTAMP_USD, bookEvents).requestUpdate();
new OrderBookPair(client, XRP, RIPPEX_BRL, bookEvents).requestUpdate();
}
示例4: main
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
public static void main(String[] args) throws JSONException {
Client client = new Client(new JavaWebSocketTransportImpl());
client.connect("wss://s1.ripple.com");
showPairInfo(client, BITSTAMP_USD, XRP);
showPairInfo(client, BITSTAMP_USD, BITSTAMP_BTC);
showPairInfo(client, BITSTAMP_AUD, BITSTAMP_BTC);
}
示例5: main
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
File file = new File(outputFile);
if (file.exists()) {
boolean delete = file.delete();
}
Client c = new Client(new JavaWebSocketTransportImpl());
c.connect("wss://s1.ripple.com");
walkAccountTx(c, null, 5); // a null marker to start with and 5 pages of 500 txn per page
}
示例6: main
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
if (PAYWARD_USER.isEmpty() || PAYWARD_PASS.isEmpty()) {
log("Must configure PAYWARD_USER && PAYWARD_PASS");
}
else {
final Client client = new Client(new JavaWebSocketTransportImpl());
client.run(new Client.ThrowingRunnable() {
@Override
public void throwingRun() throws Exception {
client.connect("wss://s1.ripple.com");
makePayment(client);
}
});
}
}
示例7: main
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
public static void main(String[] args) {
// We need a valid seed
if (args.length != 1 || Func.itThrows(Seed::fromBase58, args[0])) {
printErr("Must pass valid base58 encoded " +
"seed/secret as first arg :)");
System.exit(1);
} else {
new Client(new JavaWebSocketTransportImpl())
.connect("wss://s-east.ripple.com", (c) ->
new CreateOffer(c, args[0]));
}
}
示例8: main
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
public static void main(String[] args) {
// We need a valid seed
if (args.length != 1 || Func.itThrows(Seed::fromBase58, args[0])) {
printErr("Must pass valid base58 encoded " +
"seed/secret as first arg :)");
System.exit(1);
} else {
// Gratuitous use of Java 8 features such as method
// references and lambdas
new Client(new JavaWebSocketTransportImpl())
.connect("wss://s-east.ripple.com",
Func.bind(PaymentPaths::example, args[0])::accept);
}
}
示例9: main
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
public static void main(String[] args) {
Client.logger.setLevel(Level.OFF);
new Client(new JavaWebSocketTransportImpl())
.connect("wss://s-east.ripple.com",
OffersExecuted::onceConnected);
}
示例10: main
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
public static void main(String[] args) {
new Client(new JavaWebSocketTransportImpl())
.connect("wss://s-east.ripple.com",
AccountTx::new);
}
示例11: AndroidClient
import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
public AndroidClient() {
super(new JavaWebSocketTransportImpl());
}