def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] if "json" in kwargs and kwargs["json"]: if (isinstance(kwargs["json"], dict) or isinstance(kwargs["json"], list)): js = json.dumps(kwargs["json"]) else: js = kwargs["json"] if len(kwargs["id"]) > 32: raise Exception("'id' too long") super().__init__( OrderedDict([ ('required_auths', Array([String(o) for o in kwargs["required_auths"]])), ('required_posting_auths', Array([ String(o) for o in kwargs["required_posting_auths"] ])), ('id', String(kwargs["id"])), ('json', String(js)), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] if "new_name" in kwargs: # Sort names by countrycode kwargs["new_name"] = sorted( kwargs["new_name"], key=lambda x: repr(x[0]), reverse=False, ) name = Optional(Map([ [String(e[0]), String(e[1])] for e in kwargs["new_name"] ])) else: name = Optional(None) super().__init__(OrderedDict([ ('fee', Asset(kwargs["fee"])), ('sport_id', ObjectId(kwargs["sport_id"], "sport")), ('new_name', name), ('extensions', Set([])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] prefix = kwargs.pop("prefix", default_prefix) assert len(kwargs["new_account_name"] ) <= 16, "Account name must be at most 16 chars long" meta = "" if "json_metadata" in kwargs and kwargs["json_metadata"]: if isinstance(kwargs["json_metadata"], dict): meta = json.dumps(kwargs["json_metadata"]) else: meta = kwargs["json_metadata"] super().__init__( OrderedDict([ ('fee', Amount(kwargs["fee"])), ('creator', String(kwargs["creator"])), ('new_account_name', String(kwargs["new_account_name"])), ('owner', Permission(kwargs["owner"], prefix=prefix)), ('active', Permission(kwargs["active"], prefix=prefix)), ('posting', Permission(kwargs["posting"], prefix=prefix)), ('memo_key', PublicKey(kwargs["memo_key"], prefix=prefix)), ('json_metadata', String(meta)), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] prefix = kwargs.pop("prefix", default_prefix) meta = "" if "json_metadata" in kwargs and kwargs["json_metadata"]: if isinstance(kwargs["json_metadata"], dict): meta = json.dumps(kwargs["json_metadata"]) else: meta = kwargs["json_metadata"] owner = Permission(kwargs["owner"], prefix=prefix) if "owner" in kwargs else None active = Permission(kwargs["active"], prefix=prefix) if "active" in kwargs else None posting = Permission( kwargs["posting"], prefix=prefix) if "posting" in kwargs else None super().__init__( OrderedDict([ ('account', String(kwargs["account"])), ('owner', Optional(owner)), ('active', Optional(active)), ('posting', Optional(posting)), ('memo_key', PublicKey(kwargs["memo_key"], prefix=prefix)), ('json_metadata', String(meta)), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] # Sort names by countrycode kwargs["name"] = sorted( kwargs["name"], key=lambda x: repr(x[0]), reverse=False, ) name = Map([ [String(e[0]), String(e[1])] for e in kwargs["name"] ]) # Sort description by countrycode kwargs["description"] = sorted( kwargs["description"], key=lambda x: repr(x[0]), reverse=False, ) description = Map([ [String(e[0]), String(e[1])] for e in kwargs["description"] ]) super().__init__(OrderedDict([ ('fee', Asset(kwargs["fee"])), ('name', name), ('description', description), ('extensions', Set([])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] if "new_name" in kwargs: # Sort names by countrycode kwargs["new_name"] = sorted(kwargs["new_name"], key=lambda x: repr(x[0]), reverse=False) name = Optional( Map([[String(e[0]), String(e[1])] for e in kwargs["new_name"]])) else: name = Optional(None) if "new_sport_id" in kwargs: new_sport_id = Optional(FullObjectId(kwargs["new_sport_id"])) else: new_sport_id = Optional(None) super().__init__( OrderedDict([ ("fee", Asset(kwargs["fee"])), ("new_sport_id", new_sport_id), ("new_name", name), ( "event_group_id", ObjectId(kwargs["event_group_id"], "event_group"), ), ("extensions", Set([])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] # Sort description by countrycode kwargs["description"] = sorted( kwargs["description"], key=lambda x: repr(x[0]), reverse=False, ) description = Map([ [String(e[0]), String(e[1])] for e in kwargs["description"] ]) super().__init__(OrderedDict([ ('fee', Asset(kwargs["fee"])), ('description', description), ('event_id', FullObjectId(kwargs["event_id"])), ('rules_id', FullObjectId(kwargs["rules_id"])), ('asset_id', ObjectId(kwargs["asset_id"], "asset")), ('never_in_play', Bool(kwargs["never_in_play"])), ('delay_before_settling', Uint32(kwargs["delay_before_settling"])), ('extensions', Set([])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] if "json" in kwargs and kwargs["json"]: if isinstance(kwargs["json"], dict) or isinstance( kwargs["json"], list): js = json.dumps(kwargs["json"]) else: js = kwargs["json"] if len(kwargs["id"]) > 32: raise ValueError("'id' is too long") super().__init__( OrderedDict([ ( "required_active_auths", Array([ String(o) for o in kwargs["required_active_auths"] ]), ), ( "required_regular_auths", Array([ String(o) for o in kwargs["required_regular_auths"] ]), ), ("id", String(kwargs["id"])), ("json", String(js)), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] # Sort names by countrycode kwargs["payout_condition"] = sorted( kwargs.get("payout_condition", []), key=lambda x: repr(x[0]), reverse=False, ) payout_condition = Map([[String(e[0]), String( e[1])] for e in kwargs.get("payout_condition", [])]) # Sort description by countrycode kwargs["description"] = sorted(kwargs["description"], key=lambda x: repr(x[0]), reverse=False) description = Map([[String(e[0]), String(e[1])] for e in kwargs["description"]]) super().__init__( OrderedDict([ ("fee", Asset(kwargs["fee"])), ("group_id", FullObjectId(kwargs["group_id"])), ("description", description), ("payout_condition", payout_condition), ("extensions", Set([])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] # Sort description by countrycode kwargs["description"] = sorted(kwargs["description"], key=lambda x: repr(x[0]), reverse=False) description = Map([[String(e[0]), String(e[1])] for e in kwargs["description"]]) super().__init__( OrderedDict([ ("fee", Asset(kwargs["fee"])), ("description", description), ("event_id", FullObjectId(kwargs["event_id"])), ("rules_id", FullObjectId(kwargs["rules_id"])), ("asset_id", ObjectId(kwargs["asset_id"], "asset")), ("never_in_play", Bool(kwargs["never_in_play"])), ( "delay_before_settling", Uint32(kwargs["delay_before_settling"]), ), ######################## # Multi Market Exposure # Not available on beatrice or alice-hardfork ######################## # ( # "resolution_constraint", # ResolutionConstraint(kwargs["resolution_constraint"]), # ), ("extensions", Set([])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] prefix = kwargs.pop("prefix", DEFAULT_PREFIX) meta = "" if "json_metadata" in kwargs and kwargs["json_metadata"]: if isinstance(kwargs["json_metadata"], dict): meta = json.dumps(kwargs["json_metadata"]) else: meta = kwargs["json_metadata"] master = Permission(kwargs["master"], prefix=prefix) if "master" in kwargs else None active = Permission(kwargs["active"], prefix=prefix) if "active" in kwargs else None regular = Permission( kwargs["regular"], prefix=prefix) if "regular" in kwargs else None super().__init__( OrderedDict([ ("account", String(kwargs["account"])), ("master", Optional(master)), ("active", Optional(active)), ("regular", Optional(regular)), ("memo_key", PublicKey(kwargs["memo_key"], prefix=prefix)), ("json_metadata", String(meta)), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] prefix = kwargs.pop("prefix", DEFAULT_PREFIX) meta = "" if "json_metadata" in kwargs and kwargs["json_metadata"]: if isinstance(kwargs["json_metadata"], dict): meta = json.dumps(kwargs["json_metadata"]) else: meta = kwargs["json_metadata"] super().__init__( OrderedDict([ ("fee", Amount(kwargs["fee"])), ("delegation", Amount(kwargs["delegation"])), ("creator", String(kwargs["creator"])), ("new_account_name", String(kwargs["new_account_name"])), ("master", Permission(kwargs["master"], prefix=prefix)), ("active", Permission(kwargs["active"], prefix=prefix)), ("regular", Permission(kwargs["regular"], prefix=prefix)), ("memo_key", PublicKey(kwargs["memo_key"], prefix=prefix)), ("json_metadata", String(meta)), ("referrer", String(kwargs["referrer"])), ("extensions", Array([])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] prefix = kwargs.pop("prefix", default_prefix) assert len(kwargs["new_account_name"] ) <= 16, "Account name must be at most 16 chars long" meta = "" if "json_metadata" in kwargs and kwargs["json_metadata"]: if isinstance(kwargs["json_metadata"], dict): meta = json.dumps(kwargs["json_metadata"]) else: meta = kwargs["json_metadata"] # HF 18 requires liquid steem to be multiplied by 30 for creation # f = Amount(kwargs["fee"]) # fee = '{} STEEM'.format(f.amount * 30) # print(fee) super().__init__( OrderedDict([ ('fee', Amount(kwargs['fee'])), ('delegation', Amount(kwargs["delegation"])), ('creator', String(kwargs["creator"])), ('new_account_name', String(kwargs["new_account_name"])), ('owner', Permission(kwargs["owner"], prefix=prefix)), ('active', Permission(kwargs["active"], prefix=prefix)), ('posting', Permission(kwargs["posting"], prefix=prefix)), ('memo_key', PublicKey(kwargs["memo_key"], prefix=prefix)), ('json_metadata', String(meta)), ('extensions', Array([])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] super().__init__(OrderedDict([ ('from', String(kwargs["from"])), ('to', String(kwargs["to"])), ('amount', Amount(kwargs["amount"])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] super().__init__(OrderedDict([ ('account', String(kwargs["account"])), ('witness', String(kwargs["witness"])), ('approve', Bool(bool(kwargs["approve"]))), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] super().__init__( OrderedDict([ ('delegator', String(kwargs["delegator"])), ('delegatee', String(kwargs["delegatee"])), ('vesting_shares', Amount(kwargs["vesting_shares"])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] super().__init__(OrderedDict([ ('from_account', String(kwargs["from_account"])), ('to_account', String(kwargs["to_account"])), ('percent', Uint16((kwargs["percent"]))), ('auto_vest', Bool(kwargs["auto_vest"])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] super().__init__(OrderedDict([ ('voter', String(kwargs["voter"])), ('author', String(kwargs["author"])), ('permlink', String(kwargs["permlink"])), ('weight', Int16(kwargs["weight"])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] super().__init__( OrderedDict([ ("author", String(kwargs["author"])), ("title", String(kwargs["title"])), ("requester", String(kwargs["requester"])), ("extensions", Array(kwargs.get("extensions") or [])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] if "new_description" in kwargs: # Sort description by countrycode kwargs["new_description"] = sorted( kwargs["new_description"], key=lambda x: repr(x[0]), reverse=False, ) description = Optional(Map([ [String(e[0]), String(e[1])] for e in kwargs["new_description"] ])) else: description = Optional(None) if "freeze" in kwargs: freeze = Optional(Bool(kwargs["freeze"])) else: freeze = Optional(None) if "delay_bets" in kwargs: delay_bets = Optional(Bool(kwargs["delay_bets"])) else: delay_bets = Optional(None) if "new_event_id" in kwargs: new_event_id = Optional(FullObjectId(kwargs["new_event_id"])) else: new_event_id = Optional(None) if "new_rules_id" in kwargs: new_rules_id = Optional(FullObjectId(kwargs["new_rules_id"])) else: new_rules_id = Optional(None) super().__init__(OrderedDict([ ('fee', Asset(kwargs["fee"])), ('betting_market_group_id', ObjectId(kwargs["betting_market_group_id"], "betting_market_group")), ('new_description', description), ('new_rules_id', new_rules_id), ('freeze', freeze), ('delay_bets', delay_bets), ('extensions', Set([])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] super().__init__( OrderedDict([ ('owner', String(kwargs["owner"])), ('url', String(kwargs["url"])), ('block_signing_key', PublicKey(kwargs["block_signing_key"])), ('props', Witness_props(kwargs["props"])), ('fee', Amount(kwargs["fee"])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] if "memo" not in kwargs: kwargs["memo"] = "" super().__init__( OrderedDict([ ("from", String(kwargs["from"])), ("to", String(kwargs["to"])), ("amount", Amount(kwargs["amount"])), ("memo", String(kwargs["memo"])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] super().__init__( OrderedDict([("fee", Asset(kwargs["fee"])), ("owner", ObjectId(kwargs["owner"], "account")), ("total_participants", Uint32(kwargs["total_participants"])), ("ticket_price", Asset(kwargs["ticket_price"])), ("latency_sec", Uint16(kwargs["latency_sec"])), ("img_url", String(kwargs["img_url"])), ("description", String(kwargs["description"]))]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] if "bitasset_opts" in kwargs: bitasset_opts = Optional( BitAssetOptions(kwargs["bitasset_opts"])) else: bitasset_opts = Optional(None) super().__init__( OrderedDict([ ("fee", Asset(kwargs["fee"])), ("issuer", ObjectId(kwargs["issuer"], "account")), ("symbol", String(kwargs["symbol"])), ("precision", Uint8(kwargs["precision"])), ("common_options", AssetOptions(kwargs["common_options"])), ("bitasset_opts", bitasset_opts), ( "is_prediction_market", Bool(bool(kwargs["is_prediction_market"])), ), ("extensions", Set([])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] if "new_url" in kwargs and kwargs["new_url"]: new_url = Optional(String(kwargs["new_url"])) else: new_url = Optional(None) if "new_signing_key" in kwargs and kwargs["new_signing_key"]: new_signing_key = Optional(PublicKey( kwargs["new_signing_key"])) else: new_signing_key = Optional(None) super().__init__( OrderedDict([ ("fee", Asset(kwargs["fee"])), ("witness", ObjectId(kwargs["witness"], "witness")), ( "witness_account", ObjectId(kwargs["witness_account"], "account"), ), ("new_url", new_url), ("new_signing_key", new_signing_key), ]))
def __init__(self, *args, **kwargs): kwargs.update(args[0]) super().__init__( OrderedDict([ ("asset_id", ObjectId(kwargs["asset_id"], "asset")), ("symbol", String(kwargs["symbol"])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] # if "credit_memo" in kwargs and kwargs["credit_memo"]: # memo = Optional(Memo(kwargs["credit_memo"])) # else: # memo = Optional(None) super().__init__(OrderedDict([ ('fee', Asset(kwargs["fee"])), ('creditor', ObjectId(kwargs["creditor"], "account")), ('credit_memo', String("")), ('credit_request_uuid', String(kwargs["credit_request_uuid"])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] if "memo" not in kwargs: kwargs["memo"] = "" super().__init__(OrderedDict([ ('from', String(kwargs["from"])), ('request_id', Uint32(int(kwargs["request_id"]))), ('to', String(kwargs["to"])), ('amount', Amount(kwargs["amount"])), ('memo', String(kwargs["memo"])), ]))
def __init__(self, *args, **kwargs): if isArgsThisClass(self, args): self.data = args[0].data else: prefix = kwargs.pop("prefix", default_prefix) if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] # Sort keys (FIXME: ideally, the sorting is part of Public # Key and not located here) kwargs["key_auths"] = sorted( kwargs["key_auths"], key=lambda x: repr(PublicKey(x[0], prefix=prefix)), reverse=False, ) kwargs["account_auths"] = sorted( kwargs["account_auths"], key=lambda x: x[0], reverse=False, ) accountAuths = Map([[String(e[0]), Uint16(e[1])] for e in kwargs["account_auths"]]) keyAuths = Map([[PublicKey(e[0], prefix=prefix), Uint16(e[1])] for e in kwargs["key_auths"]]) super().__init__( OrderedDict([ ('weight_threshold', Uint32(int(kwargs["weight_threshold"]))), ('account_auths', accountAuths), ('key_auths', keyAuths), ]))
def __init__(self, *args, **kwargs): # Allow for overwrite of prefix if isArgsThisClass(self, args): self.data = args[0].data else: if len(args) == 1 and len(kwargs) == 0: kwargs = args[0] prefix = kwargs.get("prefix", default_prefix) super().__init__( OrderedDict([ ('fee', Asset(kwargs["fee"])), ('registrar', ObjectId(kwargs["registrar"], "account")), ('referrer', ObjectId(kwargs["referrer"], "account")), ('referrer_percent', Uint16(kwargs["referrer_percent"])), ('name', String(kwargs["name"])), ('owner', Permission(kwargs["owner"], prefix=prefix)), ('active', Permission(kwargs["active"], prefix=prefix)), ('limitactive', Permission(kwargs["limitactive"], prefix=prefix)), # zos chain add ('options', AccountOptions(kwargs["options"], prefix=prefix)), # ('owner_special_authority', Static_variant(SpecialAuthority({}), 0)), # ('active_special_authority', Static_variant(SpecialAuthority({}), 0)), ('owner_special_authority', Optional(None)), ('active_special_authority', Optional(None)), ('buyback_options', Optional(None)), # ('extensions', AccountCreateExtensions(kwargs["extensions"])), ('extensions', Set([])), ]))