import { PolymorpheusComponent } from '@tinkoff/ng-polymorpheus' ; import { Inject , Injectable , Injector } from '@angular/core' ; import { TuiDialogService , TuiDialogSize } from '@taiga-ui/core' ; import { Observable } from 'rxjs' ; import { TokenAmount } from '@shared/models/tokens/token-amount' ; import { AvailableTokenAmount } from '@shared/models/tokens/available-token-amount' ; import { BLOCKCHAIN_NAME } from '@shared/models/blockchain/blockchain-name' ; import { FormGroup } from '@ngneat/reactive-forms' ; import { ISwapFormInput } from '@shared/models/swaps/swap-form' ; import { IframeService } from 'src/app/core/services/iframe/iframe.service' ; import { TokensSelectComponent } from '../components/tokens-select/tokens-select.component' ; @ Injectable ( ) export class TokensSelectService { constructor ( @ Inject ( TuiDialogService ) private readonly dialogService , @ Inject ( Injector ) private injector , private readonly iframeService ) { } param tokens$ param favoriteTokens$ param formType param currentBlockchain param form param allowedBlockchains param idPrefix public showDialog ( tokens$ , favoriteTokens$ , formType , currentBlockchain , form , allowedBlockchains , idPrefix = '' ) { const size = ( this . iframeService . isIframe ? 'fullscreen' : 'm' ) as TuiDialogSize ; return this . dialogService . open ( new PolymorpheusComponent ( TokensSelectComponent , this . injector ) , { size , data : { tokens$ , favoriteTokens$ , currentBlockchain , formType , form , allowedBlockchains , idPrefix } } ) ; } }