From 8e1d42397bcc2691c315c23340a1ae2822f1ad02 Mon Sep 17 00:00:00 2001 From: Maxim Fominykh Date: Sun, 26 Jun 2022 14:27:40 +0500 Subject: [PATCH] Typescript: Add toJSON for Asset and Symbol types (#17) --- templates/ts/types.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/ts/types.go b/templates/ts/types.go index e53023a..7803a72 100644 --- a/templates/ts/types.go +++ b/templates/ts/types.go @@ -42,6 +42,10 @@ export class Symbol { this.precision = Number.parseInt(precision); this.symbol_code = symbol_code; } + + public toJSON() { + return this.raw; + } } export class Asset { @@ -64,6 +68,10 @@ export class Asset { this.quantity = Number.parseFloat(quantity); this.symbol_code = symbol_code; } + + public toJSON() { + return this.raw; + } } export type ExtendedAssetType = {