當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。