forked from bitpay/wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Fb takyoon message onchain #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
takYoon
wants to merge
23
commits into
master
Choose a base branch
from
fb-takyoon-message-onchain
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
d97e06a
tmp commit
89006ab
Merge branch 'master' into fb-takyoon-message-onchain
takYoon 2dfb9fc
tmp commit
takYoon d0d9d6c
add message reply component
takYoon d08da80
Merge branch 'master' into fb-takyoon-message-onchain
eric-son12 eb09c40
implement ui onchain message
eric-son12 4608c97
implement onchain message
eric-son12 169d5a6
apply logic encrypt and decrypt message
takYoon fc6a445
Merge branch 'fb-takyoon-tmp-onchain' into fb-takyoon-message-onchain
takYoon 4129a88
only wallet xpi and single address can use feature onchain message
takYoon d82079a
Merge branch 'master' into fb-takyoon-message-onchain
takYoon b07c162
Merge branch 'master' into fb-takyoon-message-onchain
takYoon 92c5ed2
pump version for bitcore-wallet-client
takYoon d5058f4
fix issue onchain
takYoon 74806be
Merge branch 'master' into fb-takyoon-message-onchain
takYoon b089426
fix loading screen
takYoon 47f813b
Merge branch 'master' into fb-takyoon-message-onchain
eric-son12 af196e5
commit code
takYoon fde1f59
added new whitelist for chronik api
takYoon cf20359
polish ui 30032023
eric-son12 b8ae7ba
Merge branch 'master' into fb-takyoon-message-onchain
eric-son12 73df200
refactor code
eric-son12 46f5e67
Merge branch 'master' into fb-takyoon-message-onchain
takYoon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/app/components/message-reply/message-reply.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <action-sheet> | ||
| <div class="reply-to-container"> | ||
| <div class="reply-to-title"> | ||
| <ion-icon [src]="currentTheme == 'dark' ? 'assets/img/ico-reply-dark.svg' : 'assets/img/ico-reply-light.svg'"></ion-icon> | ||
| {{'Replying to ' | translate }} {{ messageReplyInfo.addressTo }} | ||
| </div> | ||
| <div class="reply-to-message"> | ||
| {{messageReplyInfo.messageOnChain}} | ||
| </div> | ||
| </div> | ||
|
|
||
| <form [formGroup]="messageReplySend"> | ||
| <mat-form-field appearance="outline"> | ||
| <mat-label translate>{{'Private message' | translate}}</mat-label> | ||
| <textarea matInput formControlName="messageOnChain" [(ngModel)]="message" (keyup)="changeMessage()" [placeholder]="'Type your private message' | translate" maxlength="206"></textarea> | ||
| </mat-form-field> | ||
| <mat-hint class="hint-reply-message"> | ||
| {{Buffer.from(this.message).length}} / 206 bytes | ||
| </mat-hint> | ||
| </form> | ||
|
|
||
| <ion-button fill="clear" type="submit" class="button-standard safe-area button-send-onchain" [disabled]="!validMessage" (click)="send()"> | ||
| {{ 'Send' | translate }} | ||
| </ion-button> | ||
| </action-sheet> |
93 changes: 93 additions & 0 deletions
93
src/app/components/message-reply/message-reply.component.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| message-reply-component { | ||
| .scanner-icon { | ||
| z-index: 99; | ||
| font-size: 28px; | ||
| color: var(--ion-color-primary); | ||
| } | ||
| .check { | ||
| font-size: 22px; | ||
| padding-top: 1rem; | ||
| &.success { | ||
| color: var(--ion-color-success); | ||
| } | ||
| &.fail { | ||
| color: var(--ion-color-danger); | ||
| } | ||
| } | ||
|
|
||
| label-tip { | ||
| margin-top: 1.8rem; | ||
| } | ||
|
|
||
| .slide-title { | ||
| h3 { | ||
| margin: 0; | ||
| font-weight: 400; | ||
| font-size: 24px; | ||
| line-height: 32px; | ||
| color: #001e2e; | ||
| margin-bottom: 2rem; | ||
| } | ||
| } | ||
| form { | ||
| margin: 0 8px 24px 8px; | ||
| ion-item { | ||
| margin: 2rem 0; | ||
| border: 2px solid rgba(0, 30, 46, 0.38); | ||
| --inner-padding-start: 1rem; | ||
| --inner-padding-end: 1rem; | ||
| --inner-padding-end: 0; | ||
| --padding-start: 0; | ||
| --padding-end: 0; | ||
| --color: #001e2e; | ||
| --background: #fafafb; | ||
| border-radius: 4px; | ||
| ion-input { | ||
| font-weight: 400; | ||
| font-size: 16px !important; | ||
| line-height: 24px; | ||
| letter-spacing: 0.5px; | ||
| } | ||
| ion-icon { | ||
| padding: 0; | ||
| } | ||
| } | ||
| .form-field { | ||
| margin-bottom: 3rem !important; | ||
| padding: 0 !important; | ||
| } | ||
| .mat-form-field-subscript-wrapper { | ||
| margin-top: 2rem !important; | ||
| padding: 0 !important; | ||
| } | ||
|
|
||
| .mobile-view { | ||
| .mat-form-field-infix { | ||
| max-width: 85%; | ||
| } | ||
| } | ||
| } | ||
| .reply-to-container { | ||
| background: linear-gradient(0deg, rgba(0, 101, 141, 0.14), rgba(0, 101, 141, 0.14)), #FAFAFB; | ||
| border: 1px solid rgba(126, 208, 255, 0.08); | ||
| border-radius: 8px; | ||
| padding: 8px; | ||
| margin: 24px; | ||
| .reply-to-title { | ||
| color: #1C3745; | ||
| font-size: 16px; | ||
| font-weight: 600; | ||
| letter-spacing: 0.1px; | ||
| } | ||
| .reply-to-message { | ||
| color: #1C3745; | ||
| letter-spacing: 0.25px; | ||
| font-size: 14px; | ||
| } | ||
| } | ||
|
|
||
| .button-send-onchain { | ||
| width: fit-content !important; | ||
| margin: 5px 24px 25px auto !important; | ||
| } | ||
| } |
24 changes: 24 additions & 0 deletions
24
src/app/components/message-reply/message-reply.component.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; | ||
| import { IonicModule } from '@ionic/angular'; | ||
|
|
||
| import { MessageReplyComponent } from './message-reply.component'; | ||
|
|
||
| describe('MessageReplyComponent', () => { | ||
| let component: MessageReplyComponent; | ||
| let fixture: ComponentFixture<MessageReplyComponent>; | ||
|
|
||
| beforeEach(waitForAsync(() => { | ||
| TestBed.configureTestingModule({ | ||
| declarations: [ MessageReplyComponent ], | ||
| imports: [IonicModule.forRoot()] | ||
| }).compileComponents(); | ||
|
|
||
| fixture = TestBed.createComponent(MessageReplyComponent); | ||
| component = fixture.componentInstance; | ||
| fixture.detectChanges(); | ||
| })); | ||
|
|
||
| it('should create', () => { | ||
| expect(component).toBeTruthy(); | ||
| }); | ||
| }); |
53 changes: 53 additions & 0 deletions
53
src/app/components/message-reply/message-reply.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import { Component, OnInit, ViewEncapsulation } from '@angular/core'; | ||
| import { Location } from '@angular/common'; | ||
| import { Router } from '@angular/router'; | ||
| import { Logger } from 'src/app/providers/logger/logger'; | ||
| import { ActionSheetParent } from '../action-sheet/action-sheet-parent'; | ||
| import { FormBuilder, FormGroup } from '@angular/forms'; | ||
| import { AppProvider } from 'src/app/providers/app/app'; | ||
|
|
||
| @Component({ | ||
| selector: 'message-reply-component', | ||
| templateUrl: './message-reply.component.html', | ||
| styleUrls: ['./message-reply.component.scss'], | ||
| encapsulation: ViewEncapsulation.None | ||
| }) | ||
| export class MessageReplyComponent extends ActionSheetParent{ | ||
| message = ''; | ||
| Buffer = Buffer; | ||
| messageReplyInfo: any; | ||
| public currentTheme: string; | ||
| public messageReplySend: FormGroup; | ||
| messageOnChainValue; | ||
| validMessage: boolean = false; | ||
| constructor( | ||
| private formBuilder: FormBuilder, | ||
| private appProvider: AppProvider, | ||
| ) { | ||
| super(); | ||
| this.currentTheme = this.appProvider.themeProvider.currentAppTheme; | ||
| this.messageReplySend = this.formBuilder.group({ | ||
| messageOnChain: [ | ||
| '', | ||
| [] | ||
| ] | ||
| }); | ||
| } | ||
|
|
||
| ngOnInit() { | ||
| this.messageReplyInfo = this.params; | ||
| } | ||
|
|
||
| public changeMessage() { | ||
| if (this.message.trim().length > 0) { | ||
| this.validMessage = true; | ||
| } else { | ||
| this.validMessage = false; | ||
| } | ||
| } | ||
|
|
||
| send(){ | ||
| const message = this.messageReplySend.value.messageOnChain; | ||
| this.dismiss(message); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,36 @@ | ||
| export const CARD_IAB_CONFIG = | ||
| 'directories=no,titlebar=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,hidden=yes,clearcache=yes,hidespinner=yes,disallowoverscroll=yes,zoom=no,transitionstyle=crossdissolve'; | ||
| export const DUST_AMOUNT = 546; | ||
| export const currency = { | ||
| name: 'Lotus', | ||
| ticker: 'XPI', | ||
| legacyPrefix: 'bitcoincash', | ||
| prefixes: ['lotus'], | ||
| coingeckoId: 'bitcoin-cash-abc-2', | ||
| defaultFee: 1.01, | ||
| dustSats: 550, | ||
| etokenSats: 546, | ||
| cashDecimals: 6, | ||
| blockExplorerUrl: 'https://explorer.givelotus.org', | ||
| tokenExplorerUrl: 'https://explorer.be.cash', | ||
| blockExplorerUrlTestnet: 'https://texplorer.bitcoinabc.org', | ||
| tokenName: 'eToken', | ||
| tokenTicker: 'eToken', | ||
| tokenPrefixes: ['etoken'], | ||
| tokenIconsUrl: '', // https://tokens.bitcoin.com/32 for BCH SLP | ||
| txHistoryCount: 10, | ||
| hydrateUtxoBatchSize: 20, | ||
| defaultSettings: { fiatCurrency: 'usd' }, | ||
| opReturn: { | ||
| opReturnPrefixHex: '6a', | ||
| opReturnAppPrefixLengthHex: '04', | ||
| opPushDataOne: '4c', | ||
| appPrefixesHex: { | ||
| eToken: '534c5000', | ||
| lotusChat: '02020202', | ||
| lotusChatEncrypted: '03030303' | ||
| }, | ||
| encryptedMsgByteLimit: 206, | ||
| unencryptedMsgByteLimit: 215 | ||
| } | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.