package telegram

import (
	

	

	
)

func ( *Client) ( context.Context,  int) (*tg.AuthExportedAuthorization, error) {
	,  := .tg.AuthExportAuthorization(, )
	if  != nil {
		return nil, errors.Wrapf(, "export auth to %d", )
	}

	return , nil
}

// transfer exports current authorization and imports it to another DC.
// See https://core.telegram.org/api/datacenter#authorization-transfer.
func ( *Client) ( context.Context,  *tg.Client,  int) (tg.AuthAuthorizationClass, error) {
	,  := .exportAuth(, )
	if  != nil {
		return nil, errors.Wrapf(, "export to %d", )
	}

	 := &tg.AuthImportAuthorizationRequest{}
	.FillFrom()
	,  := .AuthImportAuthorization(, )
	if  != nil {
		return nil, errors.Wrapf(, "import from %d", )
	}

	return , nil
}