How to use the json2typescript.JsonProperty function in json2typescript

To help you get started, we’ve selected a few json2typescript examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github harry-sm / BittrexRx / src / model / Balance.ts View on Github external
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;
}
github harry-sm / BittrexRx / src / model / CryptoCurrency.ts View on Github external
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;
}
github harry-sm / BittrexRx / src / model / OrderBookItem.ts View on Github external
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;
}
github harry-sm / BittrexRx / src / model / Transaction.ts View on Github external
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;
github harry-sm / BittrexRx / src / model / ExchangeState.ts View on Github external
@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;
github harry-sm / BittrexRx / src / model / OrderHistoryOrderItem.ts View on Github external
@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;
github harry-sm / BittrexRx / src / model / OpenOrder.ts View on Github external
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;
github harry-sm / BittrexRx / src / model / ExchangeState.ts View on Github external
@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('Rate', Number, false)
	public Rate: number = undefined;

	@JsonProperty('TimeStamp', DateTime, false)
	public TimeStamp: Date = undefined;
}
github harry-sm / BittrexRx / src / model / OrderHistoryOrderItem.ts View on Github external
import { JsonProperty, Any } from 'json2typescript';
import { DateTime } from '../converter';
import { OrderType } from '../converter/order-type';
import { OrderTypeValue } from '../enum/OrderTypeValue';

export class OrderHistoryOrderItem {
	@JsonProperty('OrderUuid', String, false)
	public OrderUuid: string = undefined;

	@JsonProperty('Exchange', String, false)
	public Exchange: string = undefined;

	@JsonProperty('TimeStamp', DateTime, false)
	public TimeStamp: Date = undefined;

	@JsonProperty('OrderType', OrderType, false)
	public OrderType: OrderTypeValue = 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;
github harry-sm / BittrexRx / src / model / ConditionalOrder.ts View on Github external
import { JsonProperty } from 'json2typescript';

export class ConditionalOrder {
	@JsonProperty('OrderId', String, false)
	public OrderId: string = undefined;

	@JsonProperty('MarketName', String, false)
	public MarketName: string = undefined;

	@JsonProperty('MarketCurrency', String, false)
	public MarketCurrency: string = undefined;

	@JsonProperty('BuyOrSell', String, false)
	public BuyOrSell: string = undefined;

	@JsonProperty('OrderType', String, false)
	public OrderType: string = undefined;

	@JsonProperty('Quantity', Number, false)
	public Quantity: number = undefined;

	@JsonProperty('Rate', Number, false)
	public Rate: number = undefined;
}

json2typescript

Provides TypeScript methods to map a JSON object to a JavaScript object on runtime

MIT
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis