original_docstring: Create a :class:`Asset` from an XDR Asset/ChangeTrustAsset/TrustLineAsset object.
  
          Cannot process XDR objects with asset type ASSET_TYPE_POOL_SHARE.
  
          :param xdr_object: The XDR Asset/ChangeTrustAsset/TrustLineAsset object.
          :return: A new :class:`Asset` object from the given XDR object.
          
docstring: Create a :class:`Asset` from an XDR Asset/ChangeTrustAsset/TrustLineAsset object.
  Cannot process XDR objects with asset type ASSET_TYPE_POOL_SHARE.
docstring_tokens: Create a : class : ` Asset ` from an XDR Asset / ChangeTrustAsset / TrustLineAsset object . Cannot process XDR objects with asset type ASSET_TYPE_POOL_SHARE .
code: def from_xdr_object(
          cls,
          xdr_object: Union[
              stellar_xdr.Asset, stellar_xdr.ChangeTrustAsset, stellar_xdr.TrustLineAsset
          ],
      ) -> "Asset":
          """Create a :class:`Asset` from an XDR Asset/ChangeTrustAsset/TrustLineAsset object.
  
          Cannot process XDR objects with asset type ASSET_TYPE_POOL_SHARE.
  
          :param xdr_object: The XDR Asset/ChangeTrustAsset/TrustLineAsset object.
          :return: A new :class:`Asset` object from the given XDR object.
          """
          if xdr_object.type == stellar_xdr.AssetType.ASSET_TYPE_NATIVE:
              return Asset.native()
          elif xdr_object.type == stellar_xdr.AssetType.ASSET_TYPE_CREDIT_ALPHANUM4:
              assert xdr_object.alpha_num4 is not None
              assert xdr_object.alpha_num4.issuer.account_id.ed25519 is not None
              issuer = StrKey.encode_ed25519_public_key(
                  xdr_object.alpha_num4.issuer.account_id.ed25519.uint256
              )
              code = xdr_object.alpha_num4.asset_code.asset_code4.decode().rstrip("\x00")
          elif xdr_object.type == stellar_xdr.AssetType.ASSET_TYPE_CREDIT_ALPHANUM12:
              assert xdr_object.alpha_num12 is not None
              assert xdr_object.alpha_num12.issuer.account_id.ed25519 is not None
              issuer = StrKey.encode_ed25519_public_key(
                  xdr_object.alpha_num12.issuer.account_id.ed25519.uint256
              )
              code = xdr_object.alpha_num12.asset_code.asset_code12.decode().rstrip(
                  "\x00"
              )
          else:
              raise ValueError(f"Invalid asset type: {xdr_object.type}")
          return cls(code, issuer)
code_tokens: def from_xdr_object ( cls , xdr_object : Union [ stellar_xdr . Asset , stellar_xdr . ChangeTrustAsset , stellar_xdr . TrustLineAsset ] , ) -> "Asset" : if xdr_object . type == stellar_xdr . AssetType . ASSET_TYPE_NATIVE : return Asset . native ( ) elif xdr_object . type == stellar_xdr . AssetType . ASSET_TYPE_CREDIT_ALPHANUM4 : assert xdr_object . alpha_num4 is not None assert xdr_object . alpha_num4 . issuer . account_id . ed25519 is not None issuer = StrKey . encode_ed25519_public_key ( xdr_object . alpha_num4 . issuer . account_id . ed25519 . uint256 ) code = xdr_object . alpha_num4 . asset_code . asset_code4 . decode ( ) . rstrip ( "\x00" ) elif xdr_object . type == stellar_xdr . AssetType . ASSET_TYPE_CREDIT_ALPHANUM12 : assert xdr_object . alpha_num12 is not None assert xdr_object . alpha_num12 . issuer . account_id . ed25519 is not None issuer = StrKey . encode_ed25519_public_key ( xdr_object . alpha_num12 . issuer . account_id . ed25519 . uint256 ) code = xdr_object . alpha_num12 . asset_code . asset_code12 . decode ( ) . rstrip ( "\x00" ) else : raise ValueError ( f"Invalid asset type: {xdr_object.type}" ) return cls ( code , issuer )
short_docstring: Create a :class:`Asset` from an XDR Asset/ChangeTrustAsset/TrustLineAsset object.
short_docstring_tokens: Create a : class : ` Asset ` from an XDR Asset / ChangeTrustAsset / TrustLineAsset object .
comment: """Create a :class:`Asset` from an XDR Asset/ChangeTrustAsset/TrustLineAsset object.
  
          Cannot process XDR objects with asset type ASSET_TYPE_POOL_SHARE.
  
          :param xdr_object: The XDR Asset/ChangeTrustAsset/TrustLineAsset object.
          :return: A new :class:`Asset` object from the given XDR object.
          """