Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { JsonProperty, Any } from 'json2typescript';
export class Balance {
@JsonProperty('Currency', String, false)
public Currency: string = undefined;
@JsonProperty('Balance', Number, false)
public Balance: number = undefined;
@JsonProperty('Available', Number, false)
public Available: number = undefined;
@JsonProperty('Pending', Number, false)
public Pending: number = undefined;
@JsonProperty('CryptoAddress', Any, false)
public CryptoAddress: string | null = undefined;
// Requested?: boolean;
// Uuid: string | null;
}
private convert(data: any, dataType: Model.ClassType): T {
const jsc: JsonConvert = new JsonConvert();
jsc.valueCheckingMode = ValueCheckingMode.DISALLOW_NULL; // never allow null
return jsc.deserialize(data, dataType);
}
private convert(data: any, dataType: Model.ClassType): T {
const jsc: JsonConvert = new JsonConvert();
jsc.valueCheckingMode = ValueCheckingMode.DISALLOW_NULL; // never allow null
return jsc.deserialize(data, dataType);
}
constructor() {
CloudflareAuthenticator.init();
this.http = new HttpClient();
this.requestOptions = {
agent: false,
headers: {},
method: 'GET'
};
this.jsc = new JsonConvert();
}
import { JsonProperty, Any } from 'json2typescript';
export class Currency {
@JsonProperty('Currency', String, false)
public Currency: string = undefined;
@JsonProperty('CurrencyLong', String, false)
public CurrencyLong: string = undefined;
@JsonProperty('MinConfirmation', Number, false)
public MinConfirmation: number = undefined;
@JsonProperty('TxFee', Number, false)
public TxFee: number = undefined;
@JsonProperty('IsActive', Boolean, false)
public IsActive: boolean = undefined;
@JsonProperty('CoinType', String, false)
public CoinType: string = undefined;
@JsonProperty('BaseAddress', Any, true)
public BaseAddress: string | null = undefined;
@JsonProperty('Notice', Any, true)
public Notice?: any = undefined;
}
private jsc: JsonConvert = new JsonConvert();
public serialize(data: OrderBookOrderItem[]): any {
return data;
}
public deserialize(data: any[]): OrderBookOrderItem[] {
return data.map((item: any) => {
return this.jsc.deserialize(item, OrderBookOrderItem);
});
}
}
export class OrderBook {
@JsonProperty('buy', OrderItemConverter, false)
public buy?: OrderBookOrderItem[] = undefined;
@JsonProperty('sell', OrderItemConverter, false)
public sell?: OrderBookOrderItem[] = undefined;
}
export class OrderBookOrderItem {
@JsonProperty('Quantity', Number, false)
public Quantity: number = undefined;
@JsonProperty('Rate', Number, false)
public Rate: number = undefined;
}
import { JsonProperty } from 'json2typescript';
import { DateTime } from '../converter';
export class Transaction {
@JsonProperty('Id', Number, false)
public Id: number = undefined;
@JsonProperty('Amount', Number, false)
public Amount: number = undefined;
@JsonProperty('Currency', String, false)
public Currency: string = undefined;
@JsonProperty('Confirmations', Number, false)
public Confirmations: number = undefined;
@JsonProperty('LastUpdated', DateTime, false)
public LastUpdated: DateTime = undefined;
@JsonProperty('TxId', String, false)
public TxId: string | null = undefined;
@JsonProperty('CryptoAddress', String, false)
public CryptoAddress: string | null = undefined;
@JsonProperty('Nounce', Number, false)
public Nounce: number = undefined;
@JsonProperty('Buys', OrderBookOrderConverter, false)
public Buys: OrderBookOrderStream[] = undefined;
@JsonProperty('Sells', OrderBookOrderConverter, false)
public Sells: OrderBookOrderStream[] = undefined;
@JsonProperty('Fills', OrderBookOrderFillsConverter, false)
public Fills: OrderBookOrderFillsStream[] = undefined;
}
export class OrderBookOrderStream {
@JsonProperty('Type', Number, false)
public Type: number = undefined;
@JsonProperty('Quantity', Number, false)
public Quantity: number = undefined;
@JsonProperty('Rate', Number, false)
public Rate: number = undefined;
}
export class OrderBookOrderFillsStream {
@JsonProperty('OrderType', String, false)
public OrderType: string = undefined;
@JsonProperty('Quantity', Number, false)
public Quantity: number = undefined;
@JsonProperty('Limit', Number, false)
public Limit: number = undefined;
@JsonProperty('Quantity', Number, false)
public Quantity: number = undefined;
@JsonProperty('QuantityRemaining', Number, false)
public QuantityRemaining: number = undefined;
@JsonProperty('Commission', Number, false)
public Commission: number = undefined;
@JsonProperty('Price', Number, false)
public Price: number = undefined;
@JsonProperty('PricePerUnit', Number, false)
public PricePerUnit: number = undefined;
@JsonProperty('IsConditional', Boolean, false)
public IsConditional: boolean = undefined;
@JsonProperty('Condition', String, false)
public Condition: string = undefined;
@JsonProperty('ConditionTarget', Any, false)
public ConditionTarget: undefined = undefined;
@JsonProperty('ImmediateOrCancel', Boolean, false)
public ImmediateOrCancel: boolean = undefined;
@JsonProperty('Closed', DateTime, false)
public Closed: Date = undefined;
import { JsonProperty, Any } from 'json2typescript';
import { DateTime } from '../converter';
import { OrderType } from '../converter/order-type';
import { OrderTypeValue } from '../enum/OrderTypeValue';
export class OpenOrder {
@JsonProperty('Uuid', Any, false)
public Uuid: string | undefined = undefined;
@JsonProperty('OrderUuid', String, false)
public OrderUuid: string = undefined;
@JsonProperty('Exchange', String, false)
public Exchange: string = undefined;
@JsonProperty('OrderType', OrderType, false)
public OrderType: OrderTypeValue = undefined;
@JsonProperty('Quantity', Number, false)
public Quantity: number = undefined;
@JsonProperty('QuantityRemaining', Number, false)
public QuantityRemaining: number = undefined;
@JsonProperty('Limit', Number, false)
public Limit: number = undefined;
@JsonProperty('CommissionPaid', Number, false)
public CommissionPaid: number = undefined;
@JsonProperty('Price', Number, false)
public Price: number = undefined;