当前位置: 首页>>代码示例>>Java>>正文


Java JavaWebSocketTransportImpl类代码示例

本文整理汇总了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);
	}
}
 
开发者ID:cping,项目名称:RipplePower,代码行数:17,代码来源:RPClient.java

示例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();

}
 
开发者ID:mileschet,项目名称:ripple-marketmaker,代码行数:17,代码来源:TestRipple.java

示例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();
}
 
开发者ID:mileschet,项目名称:ripple-marketmaker,代码行数:37,代码来源:MainRippleSpreadTaker.java

示例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);

}
 
开发者ID:ripple,项目名称:ripple-lib-java,代码行数:10,代码来源:CheckPrice.java

示例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
}
 
开发者ID:ripple,项目名称:ripple-lib-java,代码行数:11,代码来源:DumpAccountTransactions.java

示例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);
            }
        });
    }
}
 
开发者ID:ripple,项目名称:ripple-lib-java,代码行数:16,代码来源:MakePayment.java

示例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]));
    }
}
 
开发者ID:ripple,项目名称:ripple-lib-java,代码行数:13,代码来源:CreateOffer.java

示例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);
    }
}
 
开发者ID:ripple,项目名称:ripple-lib-java,代码行数:15,代码来源:PaymentPaths.java

示例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);
}
 
开发者ID:ripple,项目名称:ripple-lib-java,代码行数:7,代码来源:OffersExecuted.java

示例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);
}
 
开发者ID:ripple,项目名称:ripple-lib-java,代码行数:6,代码来源:AccountTx.java

示例11: AndroidClient

import com.ripple.client.transport.impl.JavaWebSocketTransportImpl; //导入依赖的package包/类
public AndroidClient() {
    super(new JavaWebSocketTransportImpl());
}
 
开发者ID:ripple,项目名称:ripple-lib-java,代码行数:4,代码来源:AndroidClient.java


注:本文中的com.ripple.client.transport.impl.JavaWebSocketTransportImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。