@@ -246,30 +246,10 @@ def set_custom_fees(self, custom_fees: List[Any]) -> "TokenInfo":
246246 set_customFees = set_custom_fees
247247
248248 # === helpers ===
249- @staticmethod
250- def _copy_key_if_present (dst : "TokenInfo" , setter : str , key_msg ) -> None :
251- # In proto3, keys are a oneof; check presence via WhichOneof
252- if key_msg is not None and hasattr (key_msg , "WhichOneof" ) and key_msg .WhichOneof ("key" ):
253- getattr (dst , setter )(PublicKey ._from_proto (key_msg ))
254-
255- @staticmethod
256- def _parse_custom_fees (proto_obj ) -> List [CustomFee ]:
257- out : List [CustomFee ] = []
258- for fee_proto in getattr (proto_obj , "custom_fees" , []): # snake_case matches your generated proto
259- if fee_proto .HasField ("fixed_fee" ):
260- out .append (CustomFixedFee ._from_proto (fee_proto ))
261- elif fee_proto .HasField ("fractional_fee" ):
262- out .append (CustomFractionalFee ._from_proto (fee_proto ))
263- elif fee_proto .HasField ("royalty_fee" ):
264- out .append (CustomRoyaltyFee ._from_proto (fee_proto ))
265- return out
266249
267- @staticmethod
268- def _copy_msg_to_proto (src_obj , dst_proto , src_attr : str , dst_field : str ) -> None :
269- val = getattr (src_obj , src_attr )
270- if val :
271- getattr (dst_proto , dst_field ).CopyFrom (val ._to_proto ())
250+
272251
252+
273253 @staticmethod
274254 def _get (proto_obj , * names ):
275255 """Get the first present attribute from a list of possible names (camelCase/snake_case)."""
0 commit comments