Ejemplo n.º 1
0
    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(
                    [
                        # initial, version 0
                        ("account_creation_fee", Amount(kwargs["account_creation_fee"])),
                        ("maximum_block_size", Uint32(kwargs["maximum_block_size"])),
                        ("create_account_delegation_ratio", Uint32(kwargs["create_account_delegation_ratio"])),
                        ("create_account_delegation_time", Uint32(kwargs["create_account_delegation_time"])),
                        ("min_delegation", Amount(kwargs["min_delegation"])),
                        ("min_curation_percent", Uint16(kwargs["min_curation_percent"])),
                        ("max_curation_percent", Uint16(kwargs["max_curation_percent"])),
                        ("bandwidth_reserve_percent", Uint16(kwargs["bandwidth_reserve_percent"])),
                        ("bandwidth_reserve_below", Amount(kwargs["bandwidth_reserve_below"])),
                        ("flag_energy_additional_cost", Uint16(kwargs["flag_energy_additional_cost"])),
                        ("vote_accounting_min_rshares", Uint32(kwargs["vote_accounting_min_rshares"])),
                        (
                            "committee_request_approve_min_percent",
                            Uint16(kwargs["committee_request_approve_min_percent"]),
                        ),
                        # chain_properties_hf4, version 1
                        ("inflation_witness_percent", Uint16(kwargs["inflation_witness_percent"])),
                        (
                            "inflation_ratio_committee_vs_reward_fund",
                            Uint16(kwargs["inflation_ratio_committee_vs_reward_fund"]),
                        ),
                        ("inflation_recalc_period", Uint32(kwargs["inflation_recalc_period"])),
                        # chain_properties_hf6: version 2
                        (
                            "data_operations_cost_additional_bandwidth",
                            Uint32(kwargs["data_operations_cost_additional_bandwidth"]),
                        ),
                        ("witness_miss_penalty_percent", Uint16(kwargs["witness_miss_penalty_percent"])),
                        ("witness_miss_penalty_duration", Uint32(kwargs["witness_miss_penalty_duration"])),
                        # chain_properties_hf9: version 3
                        ("create_invite_min_balance", Amount(kwargs["create_invite_min_balance"])),
                        ("committee_create_request_fee", Amount(kwargs["committee_create_request_fee"])),
                        ("create_paid_subscription_fee", Amount(kwargs["create_paid_subscription_fee"])),
                        ("account_on_sale_fee", Amount(kwargs["account_on_sale_fee"])),
                        ("subaccount_on_sale_fee", Amount(kwargs["subaccount_on_sale_fee"])),
                        ("witness_declaration_fee", Amount(kwargs["witness_declaration_fee"])),
                        ("withdraw_intervals", Uint16(kwargs["withdraw_intervals"])),
                    ]
                )
            )
Ejemplo n.º 2
0
 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"]))]))
Ejemplo n.º 3
0
    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"])),
            ]))
Ejemplo n.º 4
0
    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]

            super().__init__(
                OrderedDict([
                    ('from', PublicKey(kwargs["from"], prefix=prefix)),
                    ('to', PublicKey(kwargs["to"], prefix=prefix)),
                    ('nonce', Uint64(int(kwargs["nonce"]))),
                    ('check', Uint32(int(kwargs["check"]))),
                    ('encrypted', Bytes(kwargs["encrypted"])),
                ]))
Ejemplo n.º 5
0
 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 "review_period_seconds" in kwargs:
             review = Optional(Uint32(kwargs["review_period_seconds"]))
         else:
             review = Optional(None)
         super().__init__(OrderedDict([
             ('fee', Asset(kwargs["fee"])),
             ('fee_paying_account', ObjectId(kwargs["fee_paying_account"], "account")),
             ('expiration_time', PointInTime(kwargs["expiration_time"])),
             ('proposed_ops',
                 Array([Op_wrapper(o) for o in kwargs["proposed_ops"]])),
             ('review_period_seconds', review),
             ('extensions', Set([])),
         ]))
Ejemplo n.º 6
0
 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"])),
                 ('bettor_id', ObjectId(kwargs["bettor_id"], "account")),
                 ('betting_market_id',
                  ObjectId(kwargs["betting_market_id"], "betting_market")),
                 ('amount_to_bet', Asset(kwargs["amount_to_bet"])),
                 ('backer_multiplier',
                  Uint32(int(kwargs["backer_multiplier"]))),
                 ('amount_reserved_for_fees',
                  Int64(kwargs["amount_reserved_for_fees"])),
                 ('back_or_lay', BetType(kwargs["back_or_lay"])),
                 ('extensions', Set([])),
             ]))
Ejemplo n.º 7
0
    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]
            kwargs["key_auths"] = sorted(kwargs["key_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),
                    ]
                )
            )
Ejemplo n.º 8
0
    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)

            super().__init__(
                OrderedDict(
                    [
                        ("from", PublicKey(kwargs["from"], prefix=prefix)),
                        ("to", PublicKey(kwargs["to"], prefix=prefix)),
                        ("nonce", Uint64(int(kwargs["nonce"]))),
                        ("check", Uint32(int(kwargs["check"]))),
                        ("encrypted", Bytes(kwargs["encrypted"])),
                    ]
                )
            )
Ejemplo n.º 9
0
 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"])),
                 ("bettor_id", ObjectId(kwargs["bettor_id"], "account")),
                 (
                     "betting_market_id",
                     ObjectId(kwargs["betting_market_id"],
                              "betting_market"),
                 ),
                 ("amount_to_bet", Asset(kwargs["amount_to_bet"])),
                 ("backer_multiplier",
                  Uint32(int(kwargs["backer_multiplier"]))),
                 ("back_or_lay", BetType(kwargs["back_or_lay"])),
                 ("extensions", Set([])),
             ]))
Ejemplo n.º 10
0
 def __init__(self,start_claim,vesting_seconds):
     super().__init__(OrderedDict([
         ("start_claim",PointInTime(start_claim)),
         ("vesting_seconds",Uint32(vesting_seconds))
            ]))   
Ejemplo n.º 11
0
 def __init__(self, kwargs):
     super().__init__(OrderedDict([
         ('score', Uint32(kwargs["score"])),
     ]))
Ejemplo n.º 12
0
 def __init__(self, kwargs):
     super().__init__(OrderedDict([
         ('margin', Uint32(kwargs["margin"])),
     ]))
Ejemplo n.º 13
0
 def __init__(self, *args, **kwargs):
     kwargs.update(args[0])
     super().__init__(
         OrderedDict([("duration", Uint32(kwargs["duration"]))]))