0 purchases
upbit
upbit #
✅ Quotation
❌ Exchange
✅ WebSocket
Example #
Quotation #
import 'package:upbit/upbit.dart';
import 'package:upbit/quotation.dart';
void main() async {
final upbit = UpBit();
final markets = await upbit.getMarkets();
markets.forEach((market) => print(market));
}
copied to clipboard
WebSocket #
import 'package:upbit/upbit.dart';
import 'package:upbit/websocket.dart';
void main() {
final upbit = UpBit();
upbit.connectWebSocket();
upbit.webSocket.onData.listen((data) {
print(data);
}, onError: (error) async {
print(error);
await upbit.webSocket.close();
});
upbit.webSocket.requestData(Field(
typeFields: [
TypeField(
type: Type.TICKER,
codes: ['KRW-BTC'],
),
],
));
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.