From 8e87499c1267ba5aa879404a822a7c9d507e380f Mon Sep 17 00:00:00 2001 From: Tuditi Date: Tue, 24 Oct 2023 15:11:23 +0200 Subject: [PATCH 1/5] feat: add bloom logo --- .../wallet-deeplink.component.html | 11 +++++++++++ src/assets/logos/bloom.png | Bin 0 -> 1302 bytes 2 files changed, 11 insertions(+) create mode 100644 src/assets/logos/bloom.png diff --git a/src/app/components/wallet-deeplink/wallet-deeplink.component.html b/src/app/components/wallet-deeplink/wallet-deeplink.component.html index 43bc2f3..71b4622 100644 --- a/src/app/components/wallet-deeplink/wallet-deeplink.component.html +++ b/src/app/components/wallet-deeplink/wallet-deeplink.component.html @@ -1,4 +1,15 @@
+ +
+ Bloom logo +
+
ADVB6cUq=Rpjs4tz5?O(K#^NA% zCx&(BWL^R}oCO|{#S9GG!XV7ZFl&wkQ1C{8Pl&5~fsYNtQU`|h)(p#R8J5{FEVpG? z4kR5wBv1s%m=9C{X0HH~OJT}@ih*dU6~ii92B08Fy%mVD!j@qrL<&fPjRk548Vh0r zMZnsD${^-INQk9C1t4)dhUL~^HvmaHkd_s83@gF9Kzbnzu*u7as5IR$ZCG&S z>)pT~AH0~3a8^9{^Y6tP|4)7mUGJnCcFba~_q54BxrFUrv%cL&ojisg``!y>e7MWB zBX1F2lJDm*l+6YpGK%-RNPDkP@<7+OzuaHRn@$ zYvg}CTwY?}&G4YA>&_D1h7)WI>f0<1+-qCr&K>61UmE`=z;;Ts-~@NJ6(Lg_?1dhr zD1D#b?;tx@PT~eb{#`R(!UaPM)mJf8lp8-fm74VFyP@Gf#Xl>p7KmM+5wd#$yRFuG zmW%AMX9M>&o;lPj!?lQC;PYblpQ7ErbRI4{X3b-MDS*p*6=zn%JXJT{e&!hq_ZKmq zWGF~6jq;R9aW$Ih&h*5Xqu5yC)56<2E?OGTOuh=G@o(iR@eSP8w|?domKSRl+i)va z=EVIG$P0CuVrZpu!*Mo4*57|som*HBm@~}DWk}IGocH91kHW4WVbh*wRz6yw*Dx{9 z)ak(4;v~_gegCGFwl0u%;MAU9-5xx1+R{r;no1cp5+fNHIi&V1ckhr4G>vJoiiu`e zQ6k*Buj|dBKyMmyF1Gao4JTFJ|r8OBlB z@b!w|Exrc~-?R>V^e*L?=<0lC*<6MzBI+x$(>BR*gl8(BX%(JTUDs{WvS%k_gVL(| z3{4TnOrO=BBzsFF+nEJde{y|#J5u>h%g$2AV0r6O=9|4!11qijp51$5#CgK{uIZr{ zlDZu;IF@J|TUg$CG{^4sKY>dcGMDb{I{Cdm Date: Tue, 24 Oct 2023 16:40:17 +0200 Subject: [PATCH 2/5] feat: add getBloomDeepLink logic --- .../wallet-deeplink.component.ts | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/app/components/wallet-deeplink/wallet-deeplink.component.ts b/src/app/components/wallet-deeplink/wallet-deeplink.component.ts index 8456b59..4f246df 100644 --- a/src/app/components/wallet-deeplink/wallet-deeplink.component.ts +++ b/src/app/components/wallet-deeplink/wallet-deeplink.component.ts @@ -70,7 +70,8 @@ export class WalletDeeplinkComponent { } @Input() public showTanglePay = true; - + + public bloomDeepLink?: SafeUrl; public fireflyDeepLink?: SafeUrl; public tanglePayDeepLink?: SafeUrl; private _targetAddress?: string; @@ -83,10 +84,38 @@ export class WalletDeeplinkComponent { constructor(private sanitizer: DomSanitizer, private cd: ChangeDetectorRef) {} private setLinks(): void { + this.bloomDeepLink = this.getBloomDeepLink(); this.fireflyDeepLink = this.getFireflyDeepLink(); this.tanglePayDeepLink = this.getTanglePayDeepLink(); } + private getBloomDeepLink(): SafeUrl { + if (!this._network || this._network === Network.IOTA || this._network === Network.ATOI) { + // TODO: IOTA network support in Bloom + return ''; + } else { + // Shimmer Network + const parameters = { + address: this.targetAddress, + baseCoinAmount: this.tokenId && this.surplus ? Number(this.targetAmount).toFixed(0): undefined, + tokenId: this.tokenId, + tokenAmount: this.tokenId ? this.tokenAmount : undefined, + tag: WEN_NAME.toLowerCase(), + giftStorageDeposit: true, + disableToggleGift: true, + disableChangeExpiration: true, + disableChangeTimelock: true + } + const searchParametersArray: (string | undefined)[] = Object.entries(parameters).map(([key, value]) => { return value ? `${key}=${value}` : undefined}); + const searchParametersString = searchParametersArray.filter(x => x !== undefined).flat().join('&') + + return this.sanitizer.bypassSecurityTrustUrl( + `bloom://wallet/sendTransaction?${searchParametersString}` + ) + + } + } + private getFireflyDeepLink(): SafeUrl { if (!this.targetAddress || !this.targetAmount) { return ''; From 684aadbbb20a9151020d270c2ce00bb51d17d08b Mon Sep 17 00:00:00 2001 From: Tuditi Date: Tue, 24 Oct 2023 16:44:57 +0200 Subject: [PATCH 3/5] chore: add semicolon --- .../components/wallet-deeplink/wallet-deeplink.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/components/wallet-deeplink/wallet-deeplink.component.ts b/src/app/components/wallet-deeplink/wallet-deeplink.component.ts index 4f246df..1ac274c 100644 --- a/src/app/components/wallet-deeplink/wallet-deeplink.component.ts +++ b/src/app/components/wallet-deeplink/wallet-deeplink.component.ts @@ -105,9 +105,9 @@ export class WalletDeeplinkComponent { disableToggleGift: true, disableChangeExpiration: true, disableChangeTimelock: true - } + }; const searchParametersArray: (string | undefined)[] = Object.entries(parameters).map(([key, value]) => { return value ? `${key}=${value}` : undefined}); - const searchParametersString = searchParametersArray.filter(x => x !== undefined).flat().join('&') + const searchParametersString = searchParametersArray.filter(x => x !== undefined).flat().join('&'); return this.sanitizer.bypassSecurityTrustUrl( `bloom://wallet/sendTransaction?${searchParametersString}` From 72608e693a5181aea637f93bd63e55921a6a5f6d Mon Sep 17 00:00:00 2001 From: Tuditi Date: Thu, 26 Oct 2023 12:36:45 +0200 Subject: [PATCH 4/5] feat: only show button if deep link exists --- .../components/wallet-deeplink/wallet-deeplink.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/wallet-deeplink/wallet-deeplink.component.html b/src/app/components/wallet-deeplink/wallet-deeplink.component.html index 71b4622..f1e6e17 100644 --- a/src/app/components/wallet-deeplink/wallet-deeplink.component.html +++ b/src/app/components/wallet-deeplink/wallet-deeplink.component.html @@ -2,7 +2,7 @@ From 2dc76b20355217bb3634e974de9c544d2f2b2b2e Mon Sep 17 00:00:00 2001 From: Tuditi Date: Thu, 26 Oct 2023 12:48:20 +0200 Subject: [PATCH 5/5] chore: same button prop order --- .../wallet-deeplink/wallet-deeplink.component.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/components/wallet-deeplink/wallet-deeplink.component.html b/src/app/components/wallet-deeplink/wallet-deeplink.component.html index f1e6e17..2220aa6 100644 --- a/src/app/components/wallet-deeplink/wallet-deeplink.component.html +++ b/src/app/components/wallet-deeplink/wallet-deeplink.component.html @@ -1,10 +1,10 @@