Skip to content

Commit 79cb9d5

Browse files
authored
Merge pull request #1782 from numbersprotocol/feature-qr-code-for-deposit
Feature qr code for deposit
2 parents 16224c8 + 3e05971 commit 79cb9d5

File tree

8 files changed

+394
-1
lines changed

8 files changed

+394
-1
lines changed

package-lock.json

Lines changed: 349 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"@ngx-formly/schematics": "^5.10.22",
6262
"@numbersprotocol/preview-camera": "github:numbersprotocol/preview-camera#release-0.0.2-auto-rotate-fix",
6363
"@numbersprotocol/preview-video": "github:numbersprotocol/preview-video",
64+
"@techiediaries/ngx-qrcode": "^9.1.0",
6465
"appsflyer-capacitor-plugin": "^6.5.2",
6566
"async-mutex": "^0.3.2",
6667
"buffer": "^5.7.1",
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { NgModule } from '@angular/core';
2+
import { NgxQRCodeModule } from '@techiediaries/ngx-qrcode';
23
import { SharedModule } from '../../shared/shared.module';
34
import { WalletsPageRoutingModule } from './wallets-routing.module';
45
import { WalletsPage } from './wallets.page';
56

67
@NgModule({
7-
imports: [SharedModule, WalletsPageRoutingModule],
8+
imports: [SharedModule, WalletsPageRoutingModule, NgxQRCodeModule],
89
declarations: [WalletsPage],
910
})
1011
export class WalletsPageModule {}

src/app/features/wallets/wallets.page.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,22 @@ <h3 class="num-text">NUM</h3>
7676
</ion-grid>
7777
</ion-card>
7878

79+
<div class="asset-wallet-qr-code-container">
80+
{{ t('wallets.myAssetWalletQRCode') }}
81+
<div class="qr-code-info">
82+
{{ t('wallets.myAssetWalletQRCodeInfo') }}
83+
</div>
84+
<div class="vertical-pacing-12"></div>
85+
<ngx-qrcode
86+
[elementType]="elementType"
87+
[value]="assetWalletAddr$ | ngrxPush"
88+
cssClass="qr-code"
89+
[margin]="0"
90+
[width]="150"
91+
>
92+
</ngx-qrcode>
93+
</div>
94+
7995
<mat-list>
8096
<mat-list-item>
8197
<mat-icon svgIcon="wallet" mat-list-icon></mat-icon>

src/app/features/wallets/wallets.page.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,22 @@ mat-list {
119119
margin-left: 3px;
120120
font-size: 1.1em;
121121
}
122+
123+
.asset-wallet-qr-code-container {
124+
// background-color: green;
125+
max-width: 300px;
126+
margin: 0 auto;
127+
display: flex;
128+
flex-direction: column;
129+
align-items: center;
130+
}
131+
132+
.qr-code-info {
133+
text-align: center;
134+
opacity: 0.6;
135+
font-size: 12px;
136+
}
137+
138+
.vertical-pacing-12 {
139+
height: 12px;
140+
}

src/app/features/wallets/wallets.page.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Browser } from '@capacitor/browser';
88
import { Clipboard } from '@capacitor/clipboard';
99
import { TranslocoService } from '@ngneat/transloco';
1010
import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
11+
import { NgxQrcodeElementTypes } from '@techiediaries/ngx-qrcode';
1112
import { BehaviorSubject, combineLatest, forkJoin } from 'rxjs';
1213
import {
1314
catchError,
@@ -49,6 +50,8 @@ export class WalletsPage {
4950
readonly isLoadingBalance$ = new BehaviorSubject<boolean>(false);
5051
readonly networkConnected$ = this.diaBackendWalletService.networkConnected$;
5152

53+
elementType = NgxQrcodeElementTypes.URL;
54+
5255
constructor(
5356
private readonly diaBackendWalletService: DiaBackendWalletService,
5457
private readonly diaBackendAuthService: DiaBackendAuthService,

src/assets/i18n/en-us.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@
275275
"assetWalletHistory": "Asset Wallet History",
276276
"myAssetWallet": "My Asset Wallet",
277277
"myAssetWalletTooltip": "Main asset vault for Capture NFT and NUM",
278+
"myAssetWalletQRCode": "My Asset Wallet QR-Code",
279+
"myAssetWalletQRCodeInfo": "Please make sure to use BEP20 (BNB Chain)",
278280
"integrityKey": "Integrity Key",
279281
"integrityWallet": "Integrity Wallet",
280282
"integrityWalletTooltip": "Wallet used for creating Signatures",

src/assets/i18n/zh-tw.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@
275275
"assetWalletHistory": "資產交易紀錄",
276276
"myAssetWallet": "我的資產錢包",
277277
"myAssetWalletTooltip": "Capture NFT 和 NUM 的主要資產庫",
278+
"myAssetWalletQRCode": "我的資產錢包二維碼",
279+
"myAssetWalletQRCodeInfo": "請務必使用 BEP20(BNB 鏈)",
278280
"integrityKey": "完整性金鑰",
279281
"integrityWallet": "完整性錢包",
280282
"integrityWalletTooltip": "用於創建簽名的錢包",

0 commit comments

Comments
 (0)