{"version":3,"sources":["webpack:///./src/modals/signin.module.css?4865","webpack:///./src/modals/dswap-order.module.css?ed52","webpack:///./src/modals/confirm-chain.ts","webpack:///./src/modals/confirm-chain.html","webpack:///./src/modals/dswap-order.ts","webpack:///./src/modals/dswap-order.html","webpack:///./src/modals/dswap-swapdetails.ts","webpack:///./src/modals/dswap-swapdetails.html","webpack:///./src/modals/signin.ts","webpack:///./src/modals/signin.html","webpack:///./src/modals/dswap-swapdetails.module.css?6507"],"names":["module","exports","ConfirmChainModal","controller","toast","taskQueue","controllerFactory","i18n","store","authService","loading","this","validationController","createForCurrentScope","renderer","addRenderer","settings","lock","centerHorizontalOnly","storeSubscription","state","subscribe","selectedChain","dswapChainId","id","loggedIn","logout","toastMessage","message","tr","ns","overrideOptions","timeout","warning","ok","DswapOrderModal","hes","ss","ts","copyTxt","copyMemoTxt","styles","createValidationRules","swapRequestModel","baseTokenSymbol","Chain","sellToken","tokens","find","x","symbol","TokenInput","isCrypto","sellTokenSwap","depositAddress","DSWAP_ACCOUNT_HE","getDepositAddress","TokenInputMemo","address","memo","customMemoId","customMemo","error","amtInclFee","parseFloat","TokenInputAmount","toFixed","depositAmount","val","selBox","document","createElement","style","position","left","top","opacity","value","body","appendChild","focus","select","execCommand","removeChild","amount","token","stake","validationResult","validate","customValid","result","results","valid","rule","messageKey","swapV2","txMemo","ChainTransactionId","swapResponse","SwapRequest","Id","txMemoId","sendTx","sendToken","transactionId","enrichTokensWithUserBalances","DswapSwapdetailsModal","swapStatusName","SwapStatusId","blockExplorerUrl","swapTransactions","t","timestamp_month_name","CreatedAt","format","timestamp_day","timestamp_time","timestamp_year","SwapStatusName","SwapStepName","SwapStepId","SigninModal","router","environment","usePrivateKey","useKeychain","subscription","username","currentChainId","window","hive_keychain","requestHandshake","steem_keychain","chains","currentChain","login","trim","toLowerCase","close","e","privateKey","getElementById","display"],"mappings":"gFACAA,EAAOC,QAAU,CAAC,cAAc,sCAAsC,aAAa,qCAAqC,eAAe,uCAAuC,Y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AAC,iBAAmB,sDAAsD,eAAe,kDAAkD,aAAa,gDAAgD,eAAe","file":"app~1b1e745d.43b9dceeedbc5a55c2c4.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"signin-text\":\"signin-module__signin-text____5vvot\",\"auth-input\":\"signin-module__auth-input____2hW-B\",\"keychain-btn\":\"signin-module__keychain-btn____39jzj\",\"auth-link\":\"signin-module__auth-link____SMSay\",\"active-key-btn\":\"signin-module__active-key-btn____3RELn\",\"greenBtns\":\"signin-module__greenBtns____1GXQd\",\"redBtn\":\"signin-module__redBtn____u_HYr\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"sendTokenBalance\":\"dswap-order-module__sendTokenBalance____1RDr0\",\"modal-header\":\"dswap-order-module__modal-header____vZ5I8\",\"modal-body\":\"dswap-order-module__modal-body____3f-jy\",\"trade-button\":\"dswap-order-module__trade-button____1-MQG\"};","import { dispatchify, Store } from 'aurelia-store';\nimport { DialogController } from 'aurelia-dialog';\nimport { autoinject, TaskQueue, bindable } from 'aurelia-framework';\nimport { Subscription } from 'rxjs';\nimport { ValidationControllerFactory, ControllerValidateResult, ValidationRules } from 'aurelia-validation';\nimport { ToastService, ToastMessage } from 'services/toast-service';\nimport { BootstrapFormRenderer } from 'resources/bootstrap-form-renderer';\nimport { I18N } from 'aurelia-i18n';\nimport { DefaultPopupTimeOut } from 'common/constants';\nimport { AuthService } from '../services/auth-service';\n\n@autoinject()\nexport class ConfirmChainModal {\n private loading = false;\n private subscription: Subscription;\n private token: any;\n private validationController;\n private renderer;\n private selectedChain;\n public storeSubscription: Subscription;\n private state: IState;\n\n constructor(private controller: DialogController,\n private toast: ToastService,\n private taskQueue: TaskQueue,\n private controllerFactory: ValidationControllerFactory,\n private i18n: I18N,\n private store: Store,\n private authService: AuthService) {\n this.validationController = controllerFactory.createForCurrentScope();\n\n this.renderer = new BootstrapFormRenderer();\n this.validationController.addRenderer(this.renderer);\n\n this.controller.settings.lock = false;\n this.controller.settings.centerHorizontalOnly = true;\n\n this.storeSubscription = this.store.state.subscribe(state => {\n if (state) {\n this.state = state;\n }\n }); \n }\n\n async activate(selectedChain) {\n this.selectedChain = selectedChain;\n }\n\n async confirmSwitch() {\n this.loading = true;\n\n this.state.dswapChainId = this.selectedChain.id;\n\n if (this.state.loggedIn) {\n await this.authService.logout();\n\n const toastMessage = new ToastMessage();\n toastMessage.message = this.i18n.tr(\"marketMakerChainSwitchConfirm\", {\n ns: 'notifications'\n });\n toastMessage.overrideOptions.timeout = DefaultPopupTimeOut;\n this.toast.warning(toastMessage);\n }\n\n this.loading = false;\n\n this.controller.ok();\n }\n}\n","module.exports = \"\\n\";","import { dispatchify, Store } from 'aurelia-store';\nimport { DialogController } from 'aurelia-dialog';\nimport { autoinject, TaskQueue, bindable } from 'aurelia-framework';\nimport { Subscription } from 'rxjs';\nimport { ValidationControllerFactory, ControllerValidateResult, ValidationRules } from 'aurelia-validation';\nimport { ToastService, ToastMessage } from 'services/toast-service';\nimport { BootstrapFormRenderer } from 'resources/bootstrap-form-renderer';\nimport { I18N } from 'aurelia-i18n';\nimport styles from './dswap-order.module.css';\nimport { HiveEngineService } from 'services/hive-engine-service';\nimport { environment } from 'environment';\nimport { SwapService } from 'services/swap-service';\nimport { swapRequest } from 'common/dswap-api';\nimport { getPeggedTokenSymbolByChain, getSwapTokenByCrypto, getRandomID } from 'common/functions';\nimport { TokenService } from '../services/token-service';\n\n@autoinject()\nexport class DswapOrderModal {\n @bindable amount;\n @bindable username;\n @bindable copyTxt = \"Copy\";\n @bindable copyMemoTxt = \"Copy\";\n\n private styles = styles;\n private loading = false;\n private subscription: Subscription; \n private token: any;\n private validationController;\n private renderer;\n private swapRequestModel: ISwapRequestModel;\n private baseTokenSymbol;\n public storeSubscription: Subscription;\n private state: IState;\n private depositAddress;\n private sellToken; \n private depositAmount: number;\n private customMemo;\n private customMemoId;\n private swapV2;\n\n constructor(private controller: DialogController, private toast: ToastService, private taskQueue: TaskQueue, private store: Store,\n private controllerFactory: ValidationControllerFactory, private i18n: I18N, private hes: HiveEngineService, private ss: SwapService, private ts: TokenService) {\n this.validationController = controllerFactory.createForCurrentScope();\n\n this.renderer = new BootstrapFormRenderer();\n this.validationController.addRenderer(this.renderer);\n\n this.controller.settings.lock = false;\n this.controller.settings.centerHorizontalOnly = true; \n\n this.storeSubscription = this.store.state.subscribe(state => {\n if (state) {\n this.state = state;\n }\n }); \n }\n\n bind() {\n this.createValidationRules();\n }\n\n async activate(swapRequestModel: ISwapRequestModel) { \n this.swapRequestModel = swapRequestModel;\n this.baseTokenSymbol = await getPeggedTokenSymbolByChain(swapRequestModel.Chain);\n\n this.sellToken = this.state.tokens.find(x => x.symbol === swapRequestModel.TokenInput);\n if (this.sellToken && this.sellToken.isCrypto) {\n let sellTokenSwap = await getSwapTokenByCrypto(this.sellToken.symbol);\n if (sellTokenSwap == this.baseTokenSymbol) {\n this.depositAddress = environment.DSWAP_ACCOUNT_HE;\n } else {\n this.depositAddress = await this.hes.getDepositAddress(sellTokenSwap, environment.DSWAP_ACCOUNT_HE);\n \n if (this.depositAddress) {\n this.swapRequestModel.TokenInputMemo = this.depositAddress.address;\n\n if (this.depositAddress.memo) {\n this.customMemoId = getRandomID();\n this.customMemo = this.depositAddress.memo + \" \" + this.customMemoId;\n }\n } else {\n const toast = new ToastMessage();\n\n toast.message = this.i18n.tr(\"converterApiTimeout\", {\n ns: 'errors'\n });\n\n this.toast.error(toast);\n }\n }\n\n // calculate 1.001% fee instead of 1% to be safe with rounding differences\n let amtInclFee = parseFloat((this.swapRequestModel.TokenInputAmount * 100 / 98.999).toFixed(8));\n\n this.depositAmount = amtInclFee;\n }\n }\n\n copyMessage(val: string, memo: boolean) {\n const selBox = document.createElement('textarea');\n selBox.style.position = 'fixed';\n selBox.style.left = '0';\n selBox.style.top = '0';\n selBox.style.opacity = '0';\n selBox.value = val;\n document.body.appendChild(selBox);\n selBox.focus();\n selBox.select();\n document.execCommand('copy');\n document.body.removeChild(selBox);\n\n if (memo) {\n this.copyMemoTxt = \"Copied!\";\n } else {\n this.copyTxt = \"Copied!\";\n }\n }\n\n balanceClicked() {\n this.amount = this.token.stake;\n }\n\n private createValidationRules() {\n \n }\n\n async confirmSend() {\n const validationResult: ControllerValidateResult = await this.validationController.validate();\n\n this.loading = true;\n let customValid = true;\n\n for (const result of validationResult.results) {\n if (!result.valid) {\n const toast = new ToastMessage();\n\n toast.message = this.i18n.tr(result.rule.messageKey, {\n stake: this.token.stake,\n symbol: this.token.symbol,\n ns: 'errors'\n });\n\n this.toast.error(toast);\n }\n }\n\n if (this.sellToken && this.sellToken.isCrypto && !this.depositAddress) {\n const toast = new ToastMessage();\n\n toast.message = this.i18n.tr(\"DepositAddressMissing\", {\n stake: this.token.stake,\n symbol: this.token.symbol,\n ns: 'errors'\n });\n\n this.toast.error(toast);\n customValid = false;\n }\n\n if (validationResult.valid && customValid) {\n //let waitMsg = this.i18n.tr('swapRequestQueued', {\n // ns: 'notifications'\n //});\n\n if (this.swapRequestModel.TokenInputMemo)\n {\n this.swapV2 = false;\n let txMemo = this.swapRequestModel.TokenInputMemo;\n if (this.customMemo)\n txMemo += \" \" + this.customMemo;\n\n this.swapRequestModel.ChainTransactionId = txMemo;\n\n // update token input memo with unique id generated (if it is applicable)\n if (this.customMemo)\n this.swapRequestModel.TokenInputMemo = this.customMemoId;\n\n let swapResponse = await this.ss.SwapRequest(this.swapRequestModel);\n\n if (swapResponse && swapResponse.Id) {\n this.controller.ok();\n }\n } else {\n var txMemoId = getRandomID(); \n this.swapRequestModel.TokenInputMemo = txMemoId; \n let swapResponse = await this.ss.SwapRequest(this.swapRequestModel);\n this.swapV2 = true;\n\n var txMemo = \"SwapRequest \" + txMemoId;\n if (swapResponse && swapResponse.Id) {\n var sendTx = await this.hes.sendToken(this.swapRequestModel.TokenInput, environment.DSWAP_ACCOUNT_HE, this.swapRequestModel.TokenInputAmount, txMemo);\n if (sendTx) {\n if (sendTx.transactionId) {\n //this.swapRequestModel.ChainTransactionId = sendTx.transactionId;\n\n await this.ts.enrichTokensWithUserBalances([this.swapRequestModel.TokenInput]);\n this.controller.ok();\n }\n } else {\n this.swapRequestModel.TokenInputMemo = \"\";\n }\n }\n }\n }\n\n this.loading = false;\n }\n\n}\n","module.exports = \"\\n\";","import { dispatchify, Store } from 'aurelia-store';\nimport { DialogController } from 'aurelia-dialog';\nimport { autoinject, TaskQueue, bindable } from 'aurelia-framework';\nimport { Subscription } from 'rxjs';\nimport { ValidationControllerFactory, ControllerValidateResult, ValidationRules } from 'aurelia-validation';\nimport { ToastService, ToastMessage } from 'services/toast-service';\nimport { BootstrapFormRenderer } from 'resources/bootstrap-form-renderer';\nimport { I18N } from 'aurelia-i18n';\nimport styles from './dswap-swapdetails.module.css';\nimport { HiveEngineService } from 'services/hive-engine-service';\nimport { environment } from 'environment';\nimport { SwapService } from 'services/swap-service';\nimport { swapRequest, getSwapRequestTransactions } from 'common/dswap-api';\nimport { getPeggedTokenSymbolByChain, getBlockExplorerByChain, getSwapStatusById, getSwapStepById } from 'common/functions';\nimport moment from 'moment';\n\n@autoinject()\nexport class DswapSwapdetailsModal {\n @bindable amount;\n @bindable username;\n\n private styles = styles;\n private loading = false;\n private subscription: Subscription; \n private token: any;\n private validationController;\n private renderer;\n private swapRequestModel: ISwapRequestViewModel;\n private baseTokenSymbol;\n private blockExplorerUrl;\n private swapTransactions: ISwapRequestTransactionViewModel[];\n private swapStatusName;\n\n constructor(private controller: DialogController, private toast: ToastService, private taskQueue: TaskQueue,\n private controllerFactory: ValidationControllerFactory, private i18n: I18N, private hes: HiveEngineService, private ss: SwapService) {\n this.validationController = controllerFactory.createForCurrentScope();\n\n this.renderer = new BootstrapFormRenderer();\n this.validationController.addRenderer(this.renderer);\n\n this.controller.settings.lock = false;\n this.controller.settings.centerHorizontalOnly = true; \n }\n\n bind() {\n \n }\n\n async activate(swapRequestModel: ISwapRequestViewModel) {\n this.loading = true;\n this.swapRequestModel = swapRequestModel;\n this.swapStatusName = getSwapStatusById(swapRequestModel.SwapStatusId);\n this.baseTokenSymbol = await getPeggedTokenSymbolByChain(swapRequestModel.Chain);\n this.blockExplorerUrl = await getBlockExplorerByChain(swapRequestModel.Chain);\n this.swapTransactions = await getSwapRequestTransactions(swapRequestModel.Id)\n for (let t of this.swapTransactions) {\n t.timestamp_month_name = moment(t.CreatedAt).format('MMMM');\n t.timestamp_day = moment(t.CreatedAt).format('DD');\n t.timestamp_time = moment(t.CreatedAt).format('HH:mm');\n t.timestamp_year = moment(t.CreatedAt).format('YYYY');\n t.SwapStatusName = await getSwapStatusById(t.SwapStatusId);\n t.SwapStepName = await getSwapStepById(t.SwapStepId);\n }\n \n this.loading = false;\n }\n\n balanceClicked() {\n this.amount = this.token.stake;\n }\n}\n","module.exports = \"\\n\";","import { Router } from \"aurelia-router\";\nimport { ToastMessage } from \"services/toast-service\";\nimport { I18N } from \"aurelia-i18n\";\nimport { dispatchify, Store } from \"aurelia-store\";\n//import { HiveEngine } from 'services/hive-engine';\nimport { DialogController } from \"aurelia-dialog\";\nimport { autoinject } from \"aurelia-framework\";\nimport { Subscription } from \"rxjs\";\nimport { environment } from \"environment\";\nimport { ToastService } from \"services/toast-service\";\nimport { login } from \"store/actions\";\n\nimport styles from \"./signin.module.css\";\nimport { AuthService } from \"services/auth-service\";\nimport { getDswapChains, getChainByState } from \"../common/functions\";\n\n@autoinject()\nexport class SigninModal {\n private styles = styles;\n private environment = environment;\n private subscription: Subscription;\n private loading = false;\n private usePrivateKey = false;\n private username;\n private privateKey;\n private useKeychain = false;\n private state: IState;\n private currentChainId;\n private currentChain;\n\n constructor(\n private controller: DialogController,\n private authService: AuthService,\n private i18n: I18N,\n private router: Router,\n private toast: ToastService,\n private store: Store\n ) {\n this.controller.settings.lock = false;\n this.controller.settings.centerHorizontalOnly = true;\n\n this.subscription = this.store.state.subscribe(state => {\n if (state) {\n this.state = state; \n }\n }); \n }\n\n async activate(username?: string) {\n if (username)\n this.username = username;\n }\n\n async attached() {\n this.currentChainId = await getChainByState(this.state);\n\n if (window.hive_keychain) {\n window.hive_keychain.requestHandshake(() => {\n this.useKeychain = true;\n });\n }\n\n if (window.steem_keychain) {\n window.steem_keychain.requestHandshake(() => {\n this.useKeychain = true;\n });\n }\n\n let chains = await getDswapChains();\n this.currentChain = chains.find(x => x.id === this.currentChainId);\n }\n\n async keychainSignIn() {\n try {\n this.loading = true;\n\n const { username } = (await this.authService.login(\n this.username.trim().toLowerCase(),\n null,\n this.currentChain.id\n )) as any;\n\n if (username) {\n await dispatchify(login)(username, this.currentChain.id);\n }\n\n this.controller.close(true);\n\n this.loading = false;\n } catch (e) {\n this.loading = false;\n }\n }\n\n async keySignIn() {\n try {\n this.loading = true;\n\n const { username } = (await this.authService.login(\n this.username.trim().toLowerCase(),\n this.privateKey.trim(),\n this.currentChain.id\n )) as any;\n\n if (username) {\n await dispatchify(login)(username, this.currentChain.id);\n }\n\n this.controller.close(true);\n\n this.loading = false;\n } catch (e) {\n this.loading = false;\n }\n }\n hideKeychainBtn() {\n this.usePrivateKey = !this.usePrivateKey;\n document.getElementById(\"activeKeyBtn\").style.display = \"none\";\n }\n}\n","module.exports = \"\\n\";","// extracted by mini-css-extract-plugin\nmodule.exports = {\"sendTokenBalance\":\"dswap-swapdetails-module__sendTokenBalance____UvlQw\",\"modal-header\":\"dswap-swapdetails-module__modal-header____1ul9u\",\"modal-body\":\"dswap-swapdetails-module__modal-body____3D_pz\",\"trade-button\":\"dswap-swapdetails-module__trade-button____3YzHR\"};"],"sourceRoot":""}