UNPKG

@0xsticks/web3modal-angular-sticks

Version:

Web3Modal implementation for Angular

1 lines 28.8 kB
{"version":3,"file":"0xsticks-web3modal-angular-sticks.mjs","sources":["../../../projects/web3modal/src/lib/web3-modal/web3-modal.service.ts","../../../projects/web3modal/src/lib/modal/modal.component.ts","../../../projects/web3modal/src/lib/modal/modal.component.html","../../../projects/web3modal/src/lib/web3-modal/web3-modal-metamask-logo.component.ts","../../../projects/web3modal/src/lib/web3-modal/web3-modal.component.ts","../../../projects/web3modal/src/lib/web3-modal/web3-modal.component.html","../../../projects/web3modal/src/lib/web3-modal/web3-modal.module.ts","../../../projects/web3modal/src/public-api.ts","../../../projects/web3modal/src/0xsticks-web3modal-angular-sticks.ts"],"sourcesContent":["import { EventEmitter, Injectable, Optional } from '@angular/core';\nimport {\n CONNECT_EVENT,\n ERROR_EVENT,\n IProviderControllerOptions,\n Web3WalletConnector,\n IProviderUserOptions\n} from '@mindsorg/web3modal-ts';\nimport { take } from 'rxjs/operators';\n\n@Injectable()\nexport class Web3ModalService {\n private web3WalletConnector: Web3WalletConnector\n\n public shouldOpen: EventEmitter<boolean> = new EventEmitter();\n public providers: EventEmitter<IProviderUserOptions[]> = new EventEmitter();\n\n constructor (@Optional() configOptions?: IProviderControllerOptions) {\n this.web3WalletConnector = new Web3WalletConnector(configOptions)\n }\n\n async open() {\n this.providers.next(this.web3WalletConnector.providers)\n\n return await new Promise((resolve, reject) => {\n this.web3WalletConnector.providerController.on(CONNECT_EVENT, provider => {\n resolve(provider);\n });\n \n this.web3WalletConnector.providerController.on(ERROR_EVENT, error => {\n reject(error);\n });\n\n this.shouldOpen.next(true)\n\n this.shouldOpen.pipe(take(1)).subscribe({\n next: (open) => {\n if (!open) {\n reject('Dismissed modal');\n }\n }\n })\n }).finally(() => {\n this.close()\n })\n }\n\n setConfiguration(options: IProviderControllerOptions) {\n this.web3WalletConnector.setConfiguration(options)\n }\n\n clearCachedProvider(): void {\n this.web3WalletConnector.providerController.clearCachedProvider();\n }\n\n setCachedProvider(id: string): void {\n this.web3WalletConnector.providerController.setCachedProvider(id);\n }\n\n close() {\n this.shouldOpen.next(false)\n }\n}\n","import { Component, EventEmitter, ViewEncapsulation } from '@angular/core';\n\n@Component({\n selector: 'm-modal',\n host: {\n '[hidden]': 'hidden',\n },\n inputs: ['open', 'allowClose'],\n outputs: ['closed'],\n styleUrls: ['./modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n templateUrl: './modal.component.html',\n})\nexport class Modal {\n allowClose: boolean = true;\n hidden: boolean = true;\n closed: EventEmitter<any> = new EventEmitter();\n\n set _hidden(value: boolean) {\n this.hidden = value;\n }\n\n set open(value: boolean) {\n this.hidden = !value;\n }\n\n close(event) {\n if (!this.allowClose) return;\n\n this.hidden = !this.hidden;\n this.closed.next(true);\n event.stopPropagation();\n }\n}\n","<div class=\"m-modal-bg\" (click)=\"close($event)\"></div>\n<div class=\"m-modal-container\">\n <ng-content></ng-content>\n</div>","import { Component } from '@angular/core';\n\n/**\n * Component wrapper for Metamask logo SVG.\n */\n@Component({\n selector: 'm-web3-modal-metamask-logo',\n template: `\n <svg width=\"345px\" height=\"322px\" viewBox=\"0 0 345 322\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <!-- Generator: Sketch 48.2 (47327) - http://www.bohemiancoding.com/sketch -->\n <title>metamask</title>\n <desc>Created with Sketch.</desc>\n <defs></defs>\n <g id=\"metamask\" stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g fill-rule=\"nonzero\" id=\"Shape\">\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"125.609336 54.7652595 214.004731 52.4943349 190.464604 99.3115951\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"190.464604 99.3115951 141.18833 100.253458 125.609336 54.7652595\"></polygon>\n <polygon stroke=\"#E4761B\" fill=\"#E4761B\" points=\"141.18833 100.253458 18.3981091 10.6018951 125.609336 54.7652595\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"71.4163573 141.226234 15.4535146 127.296088 12.6090885 114.4584\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"17.187184 142.752141 15.4535146 127.296088 71.4163573 141.226234\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"17.187184 142.752141 71.4163573 141.226234 24.7516021 165.079784\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"24.7516021 165.079784 71.4163573 141.226234 93.8508404 145.045596\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"71.3609734 70.3102307 71.4163573 141.226234 12.6090885 114.4584\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"93.8508404 145.045596 71.4163573 141.226234 71.3609734 70.3102307\"></polygon>\n <polygon stroke=\"#E2761B\" fill=\"#E2761B\" points=\"118.836084 279.399985 19.5398793 317.895193 92.5830263 289.102142\"></polygon>\n <polygon stroke=\"#E2761B\" fill=\"#E2761B\" points=\"92.5830263 289.102142 113.53989 279.852373 118.836084 279.399985\"></polygon>\n <polygon stroke=\"#E2761B\" fill=\"#E2761B\" points=\"315.42735 0.938069582 190.464604 99.3115951 214.004731 52.4943349\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"5.30887973 119.190961 12.6090885 114.4584 15.4535146 127.296088\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"17.187184 142.752141 7.16155177 133.026086 15.4535146 127.296088\"></polygon>\n <polygon stroke=\"#E4761B\" fill=\"#E4761B\" points=\"92.5830263 289.102142 19.5398793 317.895193 0.492086977 239.803694\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"12.6090885 114.4584 2.68213692 60.7724764 71.3609734 70.3102307\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"269.169992 138.581129 328.878431 108.955677 325.724354 122.481291\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"24.7516021 165.079784 10.3994778 147.108352 17.187184 142.752141\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"323.656824 138.68867 269.169992 138.581129 325.724354 122.481291\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"323.656824 138.68867 315.532189 162.174839 269.169992 138.581129\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"315.532189 162.174839 242.896561 143.14059 269.169992 138.581129\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"328.878431 108.955677 269.169992 138.581129 263.485955 65.7680278\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"263.485955 65.7680278 269.169992 138.581129 242.896561 143.14059\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"68.2087529 169.187957 0.492086977 239.803694 24.7516021 165.079784\"></polygon>\n <polygon stroke=\"#E4761B\" fill=\"#E4761B\" points=\"0.492086977 239.803694 56.3767556 230.10087 92.5830263 289.102142\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"56.3767556 230.10087 0.492086977 239.803694 68.2087529 169.187957\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"71.3609734 70.3102307 141.18833 100.253458 93.8508404 145.045596\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"24.7516021 165.079784 93.8508404 145.045596 68.2087529 169.187957\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"242.896561 143.14059 190.464604 99.3115951 263.485955 65.7680278\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"71.3609734 70.3102307 2.68213692 60.7724764 18.3981091 10.6018951\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"18.3981091 10.6018951 141.18833 100.253458 71.3609734 70.3102307\"></polygon>\n <polygon stroke=\"#E4761B\" fill=\"#E4761B\" points=\"140.88318 168.733865 68.2087529 169.187957 93.8508404 145.045596\"></polygon>\n <polygon stroke=\"#E4761B\" fill=\"#E4761B\" points=\"93.8508404 145.045596 141.18833 100.253458 140.88318 168.733865\"></polygon>\n <polygon stroke=\"#E4761B\" fill=\"#E4761B\" points=\"344.727811 240.11481 325.429154 321.655026 238.639247 290.271545\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"336.26476 113.655491 325.724354 122.481291 328.878431 108.955677\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"323.656824 138.68867 325.724354 122.481291 334.094917 128.220305\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"315.532189 162.174839 260.670709 167.391844 242.896561 143.14059\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"263.485955 65.7680278 336.615736 52.3326676 328.878431 108.955677\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"315.532189 162.174839 323.656824 138.68867 330.504654 143.063544\"></polygon>\n <polygon stroke=\"#E4761B\" fill=\"#E4761B\" points=\"181.987685 168.351586 190.464604 99.3115951 242.896561 143.14059\"></polygon>\n <polygon stroke=\"#E4761B\" fill=\"#E4761B\" points=\"242.896561 143.14059 260.670709 167.391844 181.987685 168.351586\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"260.670709 167.391844 315.532189 162.174839 344.727811 240.11481\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"260.670709 167.391844 344.727811 240.11481 272.609651 229.990332\"></polygon>\n <polygon stroke=\"#E4761B\" fill=\"#E4761B\" points=\"238.639247 290.271545 272.609651 229.990332 344.727811 240.11481\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"263.485955 65.7680278 190.464604 99.3115951 315.42735 0.938069582\"></polygon>\n <polygon stroke=\"#763D16\" fill=\"#763D16\" points=\"315.42735 0.938069582 336.615736 52.3326676 263.485955 65.7680278\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"181.987685 168.351586 140.88318 168.733865 141.18833 100.253458\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"141.18833 100.253458 190.464604 99.3115951 181.987685 168.351586\"></polygon>\n <polygon stroke=\"#CD6116\" fill=\"#CD6116\" points=\"92.5830263 289.102142 56.3767556 230.10087 96.3807076 227.871326\"></polygon>\n <polygon stroke=\"#CD6116\" fill=\"#CD6116\" points=\"96.370437 197.713078 68.2087529 169.187957 140.88318 168.733865\"></polygon>\n <polygon stroke=\"#E4751F\" fill=\"#E4751F\" points=\"68.2087529 169.187957 96.370437 197.713078 96.3807076 227.871326\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"68.2087529 169.187957 96.3807076 227.871326 56.3767556 230.10087\"></polygon>\n <polygon stroke=\"#CD6116\" fill=\"#CD6116\" points=\"238.639247 290.271545 227.324291 227.762661 272.609651 229.990332\"></polygon>\n <polygon stroke=\"#C0AD9E\" fill=\"#C0AD9E\" points=\"104.934637 297.503234 92.5830263 289.102142 124.671835 291.090408\"></polygon>\n <polygon stroke=\"#CD6116\" fill=\"#CD6116\" points=\"181.987685 168.351586 260.670709 167.391844 228.590352 197.028192\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"272.609651 229.990332 227.324291 227.762661 260.670709 167.391844\"></polygon>\n <polygon stroke=\"#E4751F\" fill=\"#E4751F\" points=\"260.670709 167.391844 227.324291 227.762661 228.590352 197.028192\"></polygon>\n <polygon stroke=\"#CD6116\" fill=\"#CD6116\" points=\"140.88318 168.733865 122.978916 184.909564 96.370437 197.713078\"></polygon>\n <polygon stroke=\"#D7C1B3\" fill=\"#D7C1B3\" points=\"122.23049 273.872494 124.671835 291.090408 92.5830263 289.102142\"></polygon>\n <polygon stroke=\"#D7C1B3\" fill=\"#D7C1B3\" points=\"92.5830263 289.102142 125.800388 242.170799 122.23049 273.872494\"></polygon>\n <polygon stroke=\"#E4761B\" fill=\"#E4761B\" points=\"125.800388 242.170799 92.5830263 289.102142 96.3807076 227.871326\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"96.3807076 227.871326 96.370437 197.713078 132.872444 206.620434\"></polygon>\n <polygon stroke=\"#233447\" fill=\"#233447\" points=\"132.872444 206.620434 96.370437 197.713078 122.978916 184.909564\"></polygon>\n <polygon stroke=\"#CD6116\" fill=\"#CD6116\" points=\"122.978916 184.909564 140.88318 168.733865 132.872444 206.620434\"></polygon>\n <polygon stroke=\"#C0AD9E\" fill=\"#C0AD9E\" points=\"183.108489 291.572819 238.639247 290.271545 220.687379 298.568451\"></polygon>\n <polygon stroke=\"#CD6116\" fill=\"#CD6116\" points=\"228.590352 197.028192 200.763528 184.365085 181.987685 168.351586\"></polygon>\n <polygon stroke=\"#E4751F\" fill=\"#E4751F\" points=\"132.872444 206.620434 140.88318 168.733865 140.75901 190.323956\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"140.75901 190.323956 140.88318 168.733865 181.987685 168.351586\"></polygon>\n <polygon stroke=\"#D7C1B3\" fill=\"#D7C1B3\" points=\"181.151849 274.213279 238.639247 290.271545 183.108489 291.572819\"></polygon>\n <polygon stroke=\"#CD6116\" fill=\"#CD6116\" points=\"200.763528 184.365085 188.435181 206.405145 181.987685 168.351586\"></polygon>\n <polygon stroke=\"#233447\" fill=\"#233447\" points=\"188.435181 206.405145 200.763528 184.365085 228.590352 197.028192\"></polygon>\n <polygon stroke=\"#E4761B\" fill=\"#E4761B\" points=\"177.024604 242.233677 227.324291 227.762661 238.639247 290.271545\"></polygon>\n <polygon stroke=\"#D7C1B3\" fill=\"#D7C1B3\" points=\"238.639247 290.271545 181.151849 274.213279 177.024604 242.233677\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"227.324291 227.762661 188.435181 206.405145 228.590352 197.028192\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"181.987685 168.351586 178.618729 190.089 140.75901 190.323956\"></polygon>\n <polygon stroke=\"#E2761B\" fill=\"#E2761B\" points=\"188.435181 206.405145 178.618729 190.089 181.987685 168.351586\"></polygon>\n <polygon stroke=\"#C0AD9E\" fill=\"#C0AD9E\" points=\"124.671835 291.090408 126.647198 303.896082 104.934637 297.503234\"></polygon>\n <polygon stroke=\"#C0AD9E\" fill=\"#C0AD9E\" points=\"220.687379 298.568451 180.02279 304.43475 183.108489 291.572819\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"125.800388 242.170799 96.3807076 227.871326 132.872444 206.620434\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"132.872444 206.620434 132.389686 237.559341 125.800388 242.170799\"></polygon>\n <polygon stroke=\"#E4751F\" fill=\"#E4751F\" points=\"140.75901 190.323956 132.389686 237.559341 132.872444 206.620434\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"188.435181 206.405145 227.324291 227.762661 177.024604 242.233677\"></polygon>\n <polygon stroke=\"#E4751F\" fill=\"#E4751F\" points=\"178.618729 190.089 188.435181 206.405145 170.381038 237.580791\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"177.024604 242.233677 170.381038 237.580791 188.435181 206.405145\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"140.75901 190.323956 178.618729 190.089 170.381038 237.580791\"></polygon>\n <polygon stroke=\"#F6851B\" fill=\"#F6851B\" points=\"170.381038 237.580791 132.389686 237.559341 140.75901 190.323956\"></polygon>\n <polygon stroke=\"#C0AD9E\" fill=\"#C0AD9E\" points=\"126.647198 303.896082 124.671835 291.090408 122.23049 273.872494\"></polygon>\n <polygon stroke=\"#C0AD9E\" fill=\"#C0AD9E\" points=\"181.151849 274.213279 183.108489 291.572819 180.02279 304.43475\"></polygon>\n <polygon stroke=\"#C0AD9E\" fill=\"#C0AD9E\" points=\"122.23049 273.872494 124.598522 268.830707 126.647198 303.896082\"></polygon>\n <polygon stroke=\"#C0AD9E\" fill=\"#C0AD9E\" points=\"176.647572 269.09395 180.02279 304.43475 126.647198 303.896082\"></polygon>\n <polygon stroke=\"#C0AD9E\" fill=\"#C0AD9E\" points=\"126.647198 303.896082 124.598522 268.830707 176.647572 269.09395\"></polygon>\n <polygon stroke=\"#C0AD9E\" fill=\"#C0AD9E\" points=\"180.02279 304.43475 176.647572 269.09395 181.151849 274.213279\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"124.598522 268.830707 122.23049 273.872494 125.800388 242.170799\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"125.800388 242.170799 132.389686 237.559341 129.905717 240.180259\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"129.905717 240.180259 125.67841 244.96466 125.800388 242.170799\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"125.800388 242.170799 125.67841 244.96466 124.598522 268.830707\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"129.905717 240.180259 132.389686 237.559341 170.381038 237.580791\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"177.024604 242.233677 181.151849 274.213279 176.647572 269.09395\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"168.611729 240.216686 170.381038 237.580791 177.024604 242.233677\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"170.381038 237.580791 168.611729 240.216686 129.905717 240.180259\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"176.647572 269.09395 172.856575 245.041504 177.024604 242.233677\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"177.024604 242.233677 172.856575 245.041504 168.611729 240.216686\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"176.647572 269.09395 124.598522 268.830707 125.67841 244.96466\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"125.67841 244.96466 172.856575 245.041504 176.647572 269.09395\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"125.67841 244.96466 129.905717 240.180259 168.611729 240.216686\"></polygon>\n <polygon stroke=\"#161616\" fill=\"#161616\" points=\"168.611729 240.216686 172.856575 245.041504 125.67841 244.96466\"></polygon>\n </g>\n </g>\n </svg>\n `\n})\nexport class Web3ModalMetamaskLogoComponent { }\n","import {\n Component,\n Input,\n OnDestroy,\n OnInit,\n ViewEncapsulation,\n} from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { IProviderUserOptions } from '@mindsorg/web3modal-ts';\nimport { Web3ModalService } from './web3-modal.service';\n\n@Component({\n selector: 'm-web3-modal',\n templateUrl: 'web3-modal.component.html',\n styleUrls: ['./web3-modal.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class Web3ModalComponent implements OnInit, OnDestroy {\n open = false;\n providers: IProviderUserOptions[] = [];\n showMetamaskDownload: boolean;\n\n private openSubscription: Subscription;\n private providersSubscription: Subscription;\n private readonly metamaskShopURL = 'https://metamask.io/download.html';\n\n @Input() title: string;\n @Input() description?: string;\n @Input() descriptionGray?: string;\n @Input() dismissText?: string;\n @Input() promptMetamaskIfNotInstalled = false;\n\n constructor(private service: Web3ModalService) {}\n\n ngOnInit(): void {\n this.openSubscription = this.service.shouldOpen.subscribe({\n next: (open: boolean) => {\n this.open = open;\n },\n });\n\n this.providersSubscription = this.service.providers.subscribe({\n next: (providers: IProviderUserOptions[]) => {\n this.showMetamaskDownload =\n this.promptMetamaskIfNotInstalled &&\n !this.isMetamaskInProviders(providers);\n this.providers = providers;\n\n for (let provider of providers) {\n let filename = provider.logo\n .toString()\n .substring(provider.logo.toString().lastIndexOf('/') + 1);\n let url = new URL(`/logos/${filename}`, document.baseURI);\n provider.logo = url;\n }\n },\n });\n }\n\n ngOnDestroy(): void {\n this.openSubscription.unsubscribe();\n this.providersSubscription.unsubscribe();\n }\n\n close(): void {\n this.service.close();\n }\n\n private isMetamaskInProviders(providers: IProviderUserOptions[]): boolean {\n return providers.some((p) => p.name.toLowerCase() === 'metamask');\n }\n\n private openMetamaskDownloadPage(): void {\n window.open(this.metamaskShopURL, '_blank');\n }\n}\n","<m-modal [open]=\"open\" (closed)=\"close()\">\n <div class=\"m-web3Modal\">\n <div class=\"m-web3Modal__header\">\n <h3 class=\"m-web3ModalHeader__title\">\n {{ title }}\n </h3>\n <div class=\"m-web3ModalHeader__description\">\n <p class=\"m-web3ModalHeader__text\">\n {{ description }}\n </p>\n <p\n class=\"m-web3ModalHeader__text--gray m-web3ModalHeader__text\"\n >\n {{ descriptionGray }}\n </p>\n </div>\n </div>\n <div class=\"m-web3Modal__body\">\n <div class=\"m-web3ModalBody__provider\">\n <div\n class=\"m-web3ModalProvider__body\"\n *ngIf=\"providers && showMetamaskDownload\"\n (click)=\"openMetamaskDownloadPage()\"\n >\n <div class=\"m-web3ModalProviderBody__icon--custom\">\n <m-web3-modal-metamask-logo></m-web3-modal-metamask-logo>\n </div>\n <div class=\"m-web3ModalProviderBody__name\">MetaMask</div>\n </div>\n <div\n class=\"m-web3ModalProvider__body\"\n *ngFor=\"let provider of providers\"\n (click)=\"provider.onClick()\"\n >\n <div class=\"m-web3ModalProviderBody__icon\">\n <img [src]=\"provider.logo\" [alt]=\"provider.logo\" />\n </div>\n <div class=\"m-web3ModalProviderBody__name\">\n {{ provider.name }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"m-web3Modal__footer\">\n <div class=\"m-web3ModalFooter__description\">\n <p class=\"m-web3ModalFooter__text\" (click)=\"close()\">\n {{ dismissText }}\n </p>\n </div>\n </div>\n </div>\n</m-modal>\n","import { CommonModule as NgCommonModule } from '@angular/common';\nimport {\n NgModule,\n} from '@angular/core';\nimport { Modal } from '../modal/modal.component';\nimport { Web3ModalMetamaskLogoComponent } from './web3-modal-metamask-logo.component';\nimport { Web3ModalComponent } from './web3-modal.component';\n\n@NgModule({\n imports: [NgCommonModule],\n declarations: [Modal, Web3ModalComponent, Web3ModalMetamaskLogoComponent],\n exports: [Web3ModalComponent],\n})\nexport class Web3ModalModule { }\n","/*\n * Public API Surface of web3modal\n */\n\nexport * from './lib/web3-modal/web3-modal.service';\nexport * from './lib/web3-modal/web3-modal.component';\nexport * from './lib/web3-modal/web3-modal.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["NgCommonModule"],"mappings":";;;;;;;MAWa,gBAAgB;IAM3B,YAAyB,aAA0C;QAH5D,eAAU,GAA0B,IAAI,YAAY,EAAE,CAAC;QACvD,cAAS,GAAyC,IAAI,YAAY,EAAE,CAAC;QAG1E,IAAI,CAAC,mBAAmB,GAAG,IAAI,mBAAmB,CAAC,aAAa,CAAC,CAAA;KAClE;IAED,MAAM,IAAI;QACR,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAA;QAEvD,OAAO,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM;YACvC,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,EAAE,CAAC,aAAa,EAAE,QAAQ;gBACpE,OAAO,CAAC,QAAQ,CAAC,CAAC;aACnB,CAAC,CAAC;YAEH,IAAI,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAAE,KAAK;gBAC/D,MAAM,CAAC,KAAK,CAAC,CAAC;aACf,CAAC,CAAC;YAEH,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAE1B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBACtC,IAAI,EAAE,CAAC,IAAI;oBACT,IAAI,CAAC,IAAI,EAAE;wBACT,MAAM,CAAC,iBAAiB,CAAC,CAAC;qBAC3B;iBACF;aACF,CAAC,CAAA;SACH,CAAC,C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