text: import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
  import {BaseDataTypeClass} from './tfchain.types.BaseDataType.js';
  import * as jsarray from './tfchain.polyfill.array.js';
  import * as jsdec from './tfchain.polyfill.encoding.decimal.js';
  import * as jsstr from './tfchain.polyfill.encoding.str.js';
  import * as jshex from './tfchain.polyfill.encoding.hex.js';
  import * as jsbase64 from './tfchain.polyfill.encoding.base64.js';
  import * as tferrors from './tfchain.errors.js';
  var __name__ = 'tfchain.types.PrimitiveTypes';
  export var BinaryData =  __class__ ('BinaryData', [BaseDataTypeClass], {
  	__module__: __name__,
  	get __init__ () {return __get__ (this, function (self, value, fixed_size, strencoding) {
  		if (typeof value == 'undefined' || (value != null && value.hasOwnProperty ("__kwargtrans__"))) {;
  			var value = null;
  		};
  		if (typeof fixed_size == 'undefined' || (fixed_size != null && fixed_size.hasOwnProperty ("__kwargtrans__"))) {;
  			var fixed_size = null;
  		};
  		if (typeof strencoding == 'undefined' || (strencoding != null && strencoding.hasOwnProperty ("__kwargtrans__"))) {;
  			var strencoding = null;
  		};
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'value': var value = __allkwargs0__ [__attrib0__]; break;
  						case 'fixed_size': var fixed_size = __allkwargs0__ [__attrib0__]; break;
  						case 'strencoding': var strencoding = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (strencoding != null && !(isinstance (strencoding, str))) {
  			var __except0__ = py_TypeError ('strencoding should be None or a str, not be of type {}'.format (strencoding));
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		if (strencoding == null || jsstr.String (strencoding).lower ().strip ().__eq__ ('hex')) {
  			self._from_str = (function __lambda__ (s) {
  				if (arguments.length) {
  					var __ilastarg0__ = arguments.length - 1;
  					if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  						var __allkwargs0__ = arguments [__ilastarg0__--];
  						for (var __attrib0__ in __allkwargs0__) {
  							switch (__attrib0__) {
  								case 's': var s = __allkwargs0__ [__attrib0__]; break;
  							}
  						}
  					}
  				}
  				else {
  				}
  				return jshex.bytes_from_hex (s);
  			});
  			self._to_str = (function __lambda__ (value) {
  				if (arguments.length) {
  					var __ilastarg0__ = arguments.length - 1;
  					if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  						var __allkwargs0__ = arguments [__ilastarg0__--];
  						for (var __attrib0__ in __allkwargs0__) {
  							switch (__attrib0__) {
  								case 'value': var value = __allkwargs0__ [__attrib0__]; break;
  							}
  						}
  					}
  				}
  				else {
  				}
  				return jshex.bytes_to_hex (value);
  			});
  		}
  		else if (jsstr.String (strencoding).lower ().strip ().__eq__ ('base64')) {
  			self._from_str = (function __lambda__ (s) {
  				if (arguments.length) {
  					var __ilastarg0__ = arguments.length - 1;
  					if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  						var __allkwargs0__ = arguments [__ilastarg0__--];
  						for (var __attrib0__ in __allkwargs0__) {
  							switch (__attrib0__) {
  								case 's': var s = __allkwargs0__ [__attrib0__]; break;
  							}
  						}
  					}
  				}
  				else {
  				}
  				return jsbase64.bytes_from_b64 (s);
  			});
  			self._to_str = (function __lambda__ (value) {
  				if (arguments.length) {
  					var __ilastarg0__ = arguments.length - 1;
  					if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  						var __allkwargs0__ = arguments [__ilastarg0__--];
  						for (var __attrib0__ in __allkwargs0__) {
  							switch (__attrib0__) {
  								case 'value': var value = __allkwargs0__ [__attrib0__]; break;
  							}
  						}
  					}
  				}
  				else {
  				}
  				return jsbase64.bytes_to_b64 (value);
  			});
  		}
  		else if (jsstr.String (strencoding).lower ().strip ().__eq__ ('hexprefix')) {
  			self._from_str = (function __lambda__ (s) {
  				if (arguments.length) {
  					var __ilastarg0__ = arguments.length - 1;
  					if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  						var __allkwargs0__ = arguments [__ilastarg0__--];
  						for (var __attrib0__ in __allkwargs0__) {
  							switch (__attrib0__) {
  								case 's': var s = __allkwargs0__ [__attrib0__]; break;
  							}
  						}
  					}
  				}
  				else {
  				}
  				return jshex.bytes_from_hex ((s.startswith ('0x') || s.startswith ('0X') ? s.__getslice__ (2, null, 1) : s));
  			});
  			self._to_str = (function __lambda__ (value) {
  				if (arguments.length) {
  					var __ilastarg0__ = arguments.length - 1;
  					if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  						var __allkwargs0__ = arguments [__ilastarg0__--];
  						for (var __attrib0__ in __allkwargs0__) {
  							switch (__attrib0__) {
  								case 'value': var value = __allkwargs0__ [__attrib0__]; break;
  							}
  						}
  					}
  				}
  				else {
  				}
  				return '0x' + jshex.bytes_to_hex (value);
  			});
  		}
  		else {
  			var __except0__ = py_TypeError ('{} is not a valid string encoding'.format (strencoding));
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		self._strencoding = strencoding;
  		if (fixed_size != null) {
  			if (!(isinstance (fixed_size, int))) {
  				var __except0__ = py_TypeError ('fixed size should be None or int, not be of type {}'.format (py_typeof (fixed_size)));
  				__except0__.__cause__ = null;
  				throw __except0__;
  			}
  			if (fixed_size < 0) {
  				var __except0__ = py_TypeError ('fixed size should be at least 0, {} is not allowed'.format (fixed_size));
  				__except0__.__cause__ = null;
  				throw __except0__;
  			}
  		}
  		if (fixed_size != 0) {
  			self._fixed_size = fixed_size;
  		}
  		else {
  			self._fixed_size = null;
  		}
  		self._value = null;
  		self.value = value;
  		if (fixed_size == 0) {
  			self._fixed_size = len (self.value);
  		}
  	});},
  	get from_json () {return __getcm__ (this, function (cls, obj, fixed_size, strencoding) {
  		if (typeof fixed_size == 'undefined' || (fixed_size != null && fixed_size.hasOwnProperty ("__kwargtrans__"))) {;
  			var fixed_size = null;
  		};
  		if (typeof strencoding == 'undefined' || (strencoding != null && strencoding.hasOwnProperty ("__kwargtrans__"))) {;
  			var strencoding = null;
  		};
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'cls': var cls = __allkwargs0__ [__attrib0__]; break;
  						case 'obj': var obj = __allkwargs0__ [__attrib0__]; break;
  						case 'fixed_size': var fixed_size = __allkwargs0__ [__attrib0__]; break;
  						case 'strencoding': var strencoding = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (obj != null && !(isinstance (obj, str))) {
  			var __except0__ = py_TypeError ('binary data is expected to be an encoded string when part of a JSON object');
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		if (obj == '') {
  			var obj = null;
  		}
  		return cls (__kwargtrans__ ({value: obj, fixed_size: fixed_size, strencoding: strencoding}));
  	});},
  	get _get_value () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self._value;
  	});},
  	get _set_value () {return __get__ (this, function (self, value) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'value': var value = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (isinstance (value, BinaryData)) {
  			var value = value.value;
  		}
  		else if (value == null) {
  			if (self._fixed_size != null) {
  				var value = bytes (jsarray.new_array (self._fixed_size));
  			}
  			else {
  				var value = bytes (jsarray.new_array (0));
  			}
  		}
  		else if (isinstance (value, str)) {
  			var value = self._from_str (value);
  		}
  		else if (isinstance (value, bytearray)) {
  			var value = bytes (value);
  		}
  		else if (!(isinstance (value, bytes)) && !(jsarray.is_uint8_array (value))) {
  			var __except0__ = py_TypeError ('binary data can only be set to a BinaryData, str, bytes or bytearray, not {}'.format (py_typeof (value)));
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		var lvalue = len (value);
  		if (self._fixed_size != null && lvalue != 0 && lvalue != self._fixed_size) {
  			var __except0__ = ValueError ('binary data was expected to be of fixed size {}, length {} is not allowed'.format (self._fixed_size, len (value)));
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		self._value = value;
  	});},
  	get __len__ () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return len (self.value);
  	});},
  	get __str__ () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self._to_str (self._value);
  	});},
  	get str () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__str__ ();
  	});},
  	get __repr__ () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__str__ ();
  	});},
  	get json () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__str__ ();
  	});},
  	get __eq__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		var other = self._op_other_as_binary_data (other);
  		return self.value == other.value;
  	});},
  	get __ne__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		var other = self._op_other_as_binary_data (other);
  		return self.value != other.value;
  	});},
  	get _op_other_as_binary_data () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (isinstance (other, tuple ([str, bytes, bytearray]))) {
  			var other = BinaryData (__kwargtrans__ ({value: other, fixed_size: self._fixed_size, strencoding: self._strencoding}));
  		}
  		else if (!(isinstance (other, BinaryData))) {
  			var __except0__ = py_TypeError ('Binary data of type {} is not supported'.format (py_typeof (other)));
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		if (self._fixed_size != other._fixed_size) {
  			var __except0__ = py_TypeError ('Cannot compare binary data with different fixed size: self({}) != other({})'.format (self._fixed_size, other._fixed_size));
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		if (self._strencoding != other._strencoding) {
  			var __except0__ = py_TypeError ('Cannot compare binary data with different strencoding: self({}) != other({})'.format (self._strencoding, other._strencoding));
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		return other;
  	});},
  	get __hash__ () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return hash (self.__str__ ());
  	});},
  	get sia_binary_encode () {return __get__ (this, function (self, encoder) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'encoder': var encoder = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (self._fixed_size == null) {
  			encoder.add_slice (self._value);
  		}
  		else {
  			encoder.add_array (self._value);
  		}
  	});},
  	get rivine_binary_encode () {return __get__ (this, function (self, encoder) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'encoder': var encoder = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (self._fixed_size == null) {
  			encoder.add_slice (self._value);
  		}
  		else {
  			encoder.add_array (self._value);
  		}
  	});}
  });
  Object.defineProperty (BinaryData, 'value', property.call (BinaryData, BinaryData._get_value, BinaryData._set_value));;
  export var Hash =  __class__ ('Hash', [BinaryData], {
  	__module__: __name__,
  	SIZE: 32,
  	get __init__ () {return __get__ (this, function (self, value) {
  		if (typeof value == 'undefined' || (value != null && value.hasOwnProperty ("__kwargtrans__"))) {;
  			var value = null;
  		};
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'value': var value = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		__super__ (Hash, '__init__') (self, value, __kwargtrans__ ({fixed_size: Hash.SIZE, strencoding: 'hex'}));
  	});},
  	get from_json () {return __getcm__ (this, function (cls, obj) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'cls': var cls = __allkwargs0__ [__attrib0__]; break;
  						case 'obj': var obj = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (obj != null && !(isinstance (obj, str))) {
  			var __except0__ = py_TypeError ('hash is expected to be an encoded string when part of a JSON object, not {}'.format (py_typeof (obj)));
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		if (obj == '') {
  			var obj = null;
  		}
  		return cls (__kwargtrans__ ({value: obj}));
  	});},
  	get __str__ () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		var s = __super__ (Hash, '__str__') (self);
  		if (jsstr.isempty (s)) {
  			return jsstr.repeat ('0', Hash.SIZE * 2);
  		}
  		return s;
  	});}
  });
  export var Currency =  __class__ ('Currency', [BaseDataTypeClass], {
  	__module__: __name__,
  	get __init__ () {return __get__ (this, function (self, value) {
  		if (typeof value == 'undefined' || (value != null && value.hasOwnProperty ("__kwargtrans__"))) {;
  			var value = null;
  		};
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'value': var value = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		self._value = null;
  		self.value = value;
  	});},
  	get sum () {return __getcm__ (this, function (cls) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'cls': var cls = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  			var py_values = tuple ([].slice.apply (arguments).slice (1, __ilastarg0__ + 1));
  		}
  		else {
  			var py_values = tuple ();
  		}
  		var s = cls ();
  		for (var value of py_values) {
  			s.__iadd__ (value);
  		}
  		return s;
  	});},
  	get from_str () {return __getcm__ (this, function (cls, obj, lowest_unit) {
  		if (typeof lowest_unit == 'undefined' || (lowest_unit != null && lowest_unit.hasOwnProperty ("__kwargtrans__"))) {;
  			var lowest_unit = false;
  		};
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'cls': var cls = __allkwargs0__ [__attrib0__]; break;
  						case 'obj': var obj = __allkwargs0__ [__attrib0__]; break;
  						case 'lowest_unit': var lowest_unit = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (obj != null && !(isinstance (obj, str))) {
  			var __except0__ = py_TypeError ('currency is expected to be a string , not type {}'.format (py_typeof (obj)));
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		if (obj == '') {
  			var obj = null;
  		}
  		var c = cls ();
  		c.value = jsdec.Decimal (obj);
  		if (lowest_unit) {
  			c.value.__imul__ (jsdec.Decimal ('0.000000001'));
  		}
  		return c;
  	});},
  	get from_json () {return __getcm__ (this, function (_, obj) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case '_': var _ = __allkwargs0__ [__attrib0__]; break;
  						case 'obj': var obj = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return Currency.from_str (obj, __kwargtrans__ ({lowest_unit: true}));
  	});},
  	get _get_value () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self._value;
  	});},
  	get plus () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__add__ (other);
  	});},
  	get minus () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__sub__ (other);
  	});},
  	get times () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__mul__ (other);
  	});},
  	get divided_by () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__truediv__ (other);
  	});},
  	get equal_to () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__eq__ (other);
  	});},
  	get not_equal_to () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__ne__ (other);
  	});},
  	get less_than () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__lt__ (other);
  	});},
  	get greater_than () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__gt__ (other);
  	});},
  	get less_than_or_equal_to () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__le__ (other);
  	});},
  	get greater_than_or_equal_to () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__ge__ (other);
  	});},
  	get negate () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return Currency (self.value.negate ());
  	});},
  	get _set_value () {return __get__ (this, function (self, value) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'value': var value = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (value == null) {
  			self._value = jsdec.Decimal ();
  			return ;
  		}
  		if (isinstance (value, Currency)) {
  			self._value = value.value;
  			return ;
  		}
  		if (isinstance (value, tuple ([int, str, jsdec.Decimal]))) {
  			var inner_value = value;
  			if (isinstance (inner_value, str)) {
  				var inner_value = jsstr.String (inner_value).upper ().strip ().value;
  				if (len (inner_value) >= 4 && inner_value.__getslice__ (-(3), null, 1) == 'TFT') {
  					var inner_value = jsstr.rstrip (inner_value.__getslice__ (0, -(3), 1));
  				}
  			}
  			var d = jsdec.Decimal (inner_value);
  			var __left0__ = d.as_tuple ();
  			var _ = __left0__ [0];
  			var _ = __left0__ [1];
  			var exp = __left0__ [2];
  			if (exp < -(9)) {
  				var __except0__ = tferrors.CurrencyPrecisionOverflow (d.__str__ ());
  				__except0__.__cause__ = null;
  				throw __except0__;
  			}
  			self._value = d;
  			return ;
  		}
  		var __except0__ = py_TypeError ('cannot set value of type {} as Currency (invalid type): {}'.format (py_typeof (value), value));
  		__except0__.__cause__ = null;
  		throw __except0__;
  	});},
  	get __add__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__add__ (Currency (other));
  		}
  		return Currency (self.value.__add__ (other.value));
  	});},
  	get __radd__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__add__ (other);
  	});},
  	get __iadd__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__iadd__ (Currency (other));
  		}
  		self._value.__iadd__ (other.value);
  		return self;
  	});},
  	get __mul__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__mul__ (Currency (other));
  		}
  		return Currency (self.value.__mul__ (other.value).to_nearest (9));
  	});},
  	get __rmul__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__mul__ (other);
  	});},
  	get __imul__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__imul__ (Currency (other));
  		}
  		self._value.__imul__ (other.value);
  		return self;
  	});},
  	get __truediv__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__truediv__ (Currency (other));
  		}
  		return Currency (self.value.__truediv__ (other.value).to_nearest (9));
  	});},
  	get __sub__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__sub__ (Currency (other));
  		}
  		return Currency (self.value.__sub__ (other.value));
  	});},
  	get __rsub__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__sub__ (other);
  	});},
  	get __isub__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__isub__ (Currency (other));
  		}
  		self._value.__isub__ (other.value);
  		return self;
  	});},
  	get __lt__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__lt__ (Currency (other));
  		}
  		return self.value.__lt__ (other.value);
  	});},
  	get __le__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__le__ (Currency (other));
  		}
  		return self.value.__le__ (other.value);
  	});},
  	get __eq__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__eq__ (Currency (other));
  		}
  		return self.value.__eq__ (other.value);
  	});},
  	get __ne__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__ne__ (Currency (other));
  		}
  		return self.value.__ne__ (other.value);
  	});},
  	get __gt__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__gt__ (Currency (other));
  		}
  		return self.value.__gt__ (other.value);
  	});},
  	get __ge__ () {return __get__ (this, function (self, other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (!(isinstance (other, Currency))) {
  			return self.__ge__ (Currency (other));
  		}
  		return self.value.__ge__ (other.value);
  	});},
  	get _op_other_as_currency () {return function (other) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'other': var other = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (isinstance (other, tuple ([int, str]))) {
  			var other = Currency (__kwargtrans__ ({value: other}));
  		}
  		else if (isinstance (other, float)) {
  			var other = Currency (__kwargtrans__ ({value: jsdec.Decimal (str (other))}));
  		}
  		else if (!(isinstance (other, Currency))) {
  			var __except0__ = py_TypeError ('currency of type {} is not supported'.format (py_typeof (other)));
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		return other;
  	};},
  	get __int__ () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return jsstr.to_int (self.str (__kwargtrans__ ({lowest_unit: true})));
  	});},
  	get bytes () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.value.bytes (__kwargtrans__ ({prec: 9}));
  	});},
  	get __str__ () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.str ();
  	});},
  	get str () {return __get__ (this, function (self, with_unit, lowest_unit, precision) {
  		if (typeof with_unit == 'undefined' || (with_unit != null && with_unit.hasOwnProperty ("__kwargtrans__"))) {;
  			var with_unit = false;
  		};
  		if (typeof lowest_unit == 'undefined' || (lowest_unit != null && lowest_unit.hasOwnProperty ("__kwargtrans__"))) {;
  			var lowest_unit = false;
  		};
  		if (typeof precision == 'undefined' || (precision != null && precision.hasOwnProperty ("__kwargtrans__"))) {;
  			var precision = 9;
  		};
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'with_unit': var with_unit = __allkwargs0__ [__attrib0__]; break;
  						case 'lowest_unit': var lowest_unit = __allkwargs0__ [__attrib0__]; break;
  						case 'precision': var precision = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		var s = self.value.str (precision);
  		if (lowest_unit) {
  			var s = jsstr.lstrip (jsstr.py_replace (s, '.', ''), '0');
  		}
  		else if (jsstr.contains (s, '.')) {
  			var s = jsstr.rstrip (jsstr.rstrip (s, '0 '), '.');
  		}
  		if (jsstr.isempty (s)) {
  			var s = '0';
  		}
  		if (with_unit) {
  			s += ' TFT';
  		}
  		return s;
  	});},
  	get __repr__ () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.str (__kwargtrans__ ({with_unit: true}));
  	});},
  	get json () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.str (__kwargtrans__ ({lowest_unit: true}));
  	});},
  	get sia_binary_encode () {return __get__ (this, function (self, encoder) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'encoder': var encoder = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		var b = self.bytes ();
  		encoder.add_int (len (b));
  		encoder.add_array (b);
  	});},
  	get rivine_binary_encode () {return __get__ (this, function (self, encoder) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'encoder': var encoder = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		var b = self.bytes ();
  		encoder.add_slice (b);
  	});}
  });
  Object.defineProperty (Currency, 'value', property.call (Currency, Currency._get_value, Currency._set_value));;
  export var Blockstake =  __class__ ('Blockstake', [BaseDataTypeClass], {
  	__module__: __name__,
  	get __init__ () {return __get__ (this, function (self, value) {
  		if (typeof value == 'undefined' || (value != null && value.hasOwnProperty ("__kwargtrans__"))) {;
  			var value = null;
  		};
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'value': var value = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		self._value = Currency (value);
  	});},
  	get from_json () {return __getcm__ (this, function (cls, obj) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'cls': var cls = __allkwargs0__ [__attrib0__]; break;
  						case 'obj': var obj = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		if (obj != null && !(isinstance (obj, str))) {
  			var __except0__ = py_TypeError ('block stake is expected to be a string when part of a JSON object, not type {}'.format (py_typeof (obj)));
  			__except0__.__cause__ = null;
  			throw __except0__;
  		}
  		if (obj == '') {
  			var obj = null;
  		}
  		return cls (__kwargtrans__ ({value: obj}));
  	});},
  	get _get_value () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self._value;
  	});},
  	get _set_value () {return __get__ (this, function (self, value) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'value': var value = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		value._value = Currency (__kwargtrans__ ({value: value}));
  	});},
  	get __int__ () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return jsstr.to_int (self.value.str (__kwargtrans__ ({lowest_unit: false})));
  	});},
  	get str () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return jsstr.from_int (self.__int__ ());
  	});},
  	get __str__ () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.str ();
  	});},
  	get __repr__ () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__str__ ();
  	});},
  	get json () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.__str__ ();
  	});},
  	get bytes () {return __get__ (this, function (self) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		return self.value.bytes ();
  	});},
  	get sia_binary_encode () {return __get__ (this, function (self, encoder) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'encoder': var encoder = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		var b = self.bytes ();
  		encoder.add_int (len (b));
  		encoder.add_array (b);
  	});},
  	get rivine_binary_encode () {return __get__ (this, function (self, encoder) {
  		if (arguments.length) {
  			var __ilastarg0__ = arguments.length - 1;
  			if (arguments [__ilastarg0__] && arguments [__ilastarg0__].hasOwnProperty ("__kwargtrans__")) {
  				var __allkwargs0__ = arguments [__ilastarg0__--];
  				for (var __attrib0__ in __allkwargs0__) {
  					switch (__attrib0__) {
  						case 'self': var self = __allkwargs0__ [__attrib0__]; break;
  						case 'encoder': var encoder = __allkwargs0__ [__attrib0__]; break;
  					}
  				}
  			}
  		}
  		else {
  		}
  		var b = self.bytes ();
  		encoder.add_slice (b);
  	});}
  });
  Object.defineProperty (Blockstake, 'value', property.call (Blockstake, Blockstake._get_value, Blockstake._set_value));;
  
  //# sourceMappingURL=tfchain.types.PrimitiveTypes.map
  