Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Develop

See merge request papers/airgap/airgap-wallet!666
  • Loading branch information
godenzim committed May 16, 2023
2 parents 458b443 + d06673f commit 95c9488
Show file tree
Hide file tree
Showing 45 changed files with 2,662 additions and 559 deletions.
812 changes: 619 additions & 193 deletions package-lock.json

Large diffs are not rendered by default.

39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,27 @@
}
},
"dependencies": {
"@airgap/aeternity": "0.13.14",
"@airgap/angular-core": "0.0.36",
"@airgap/angular-ngrx": "0.0.36",
"@airgap/astar": "0.13.14",
"@airgap/aeternity": "0.13.15",
"@airgap/angular-core": "0.0.37",
"@airgap/angular-ngrx": "0.0.37",
"@airgap/astar": "0.13.15",
"@airgap/beacon-sdk": "3.1.5-beta.0",
"@airgap/bitcoin": "0.13.14",
"@airgap/coinlib-core": "0.13.14",
"@airgap/coreum": "0.13.14",
"@airgap/cosmos": "0.13.14",
"@airgap/cosmos-core": "0.13.14",
"@airgap/crypto": "0.13.14",
"@airgap/ethereum": "0.13.14",
"@airgap/groestlcoin": "0.13.14",
"@airgap/icp": "0.13.14",
"@airgap/module-kit": "0.13.14",
"@airgap/moonbeam": "0.13.14",
"@airgap/polkadot": "0.13.14",
"@airgap/bitcoin": "0.13.15",
"@airgap/coinlib-core": "0.13.15",
"@airgap/coreum": "0.13.15",
"@airgap/cosmos": "0.13.15",
"@airgap/cosmos-core": "0.13.15",
"@airgap/crypto": "0.13.15",
"@airgap/ethereum": "0.13.15",
"@airgap/groestlcoin": "0.13.15",
"@airgap/icp": "0.13.15",
"@airgap/module-kit": "0.13.15",
"@airgap/moonbeam": "0.13.15",
"@airgap/polkadot": "0.13.15",
"@airgap/sapling-wasm": "0.0.7",
"@airgap/serializer": "0.13.14",
"@airgap/substrate": "0.13.14",
"@airgap/tezos": "0.13.14",
"@airgap/serializer": "0.13.15",
"@airgap/substrate": "0.13.15",
"@airgap/tezos": "0.13.15",
"@angular/animations": "^11.2.9",
"@angular/common": "^11.2.9",
"@angular/core": "^11.2.9",
Expand Down Expand Up @@ -147,6 +147,7 @@
"graphql": "^16.0.1",
"graphql-request": "^3.6.1",
"html-loader": "^2.1.2",
"humanize-duration": "^3.28.0",
"ionicons": "^5.5.1",
"localforage-cordovasqlitedriver": "^1.7.0",
"moment": "^2.29.1",
Expand Down
11 changes: 9 additions & 2 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ const routes: Routes = [
special: DataResolverService
},
canActivate: [ProtocolGuard, ServiceKeyGuard],
loadChildren: () => import('./pages/sub-account-add-generic/sub-account-add-generic.module').then((m) => m.SubAccountAddGenericPageModule)
loadChildren: () =>
import('./pages/sub-account-add-generic/sub-account-add-generic.module').then((m) => m.SubAccountAddGenericPageModule)
},
{
path: 'sub-account-select/:id',
Expand Down Expand Up @@ -155,8 +156,10 @@ const routes: Routes = [
},
{
path: 'delegation-detail/:id/:publicKey/:protocolID/:addressIndex',
resolve: {
special: DataResolverService
},
canActivate: [ProtocolGuard, ServiceKeyGuard],

loadChildren: () => import('./pages/delegation-detail/delegation-detail.module').then((m) => m.DelegationDetailPageModule)
},
{
Expand Down Expand Up @@ -223,6 +226,10 @@ const routes: Routes = [
(m) => m.InteractionSelectionSettingsPageModule
)
},
{
path: 'trading-settings',
loadChildren: () => import('./pages/trading-settings/trading-settings.module').then((m) => m.TradingSettingsPageModule)
},
{
path: 'collectibles-list/:id/:publicKey/:protocolID/:addressIndex',
resolve: {
Expand Down
15 changes: 11 additions & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ import {
MainProtocolSymbols,
NetworkType
} from '@airgap/coinlib-core'
import {
generateId,
IACMessageType
} from '@airgap/serializer'
import { generateId, IACMessageType } from '@airgap/serializer'
import {
TezosProtocolNetwork,
TezosBlockExplorer,
Expand Down Expand Up @@ -66,6 +63,7 @@ import { WalletStorageKey, WalletStorageService } from './services/storage/stora
import { WalletconnectService } from './services/walletconnect/walletconnect.service'
import { faProtocolSymbol } from './types/GenericProtocolSymbols'
import { generateGUID } from './utils/utils'
import { HttpClient } from '@angular/common/http'

@Component({
selector: 'app-root',
Expand Down Expand Up @@ -96,6 +94,7 @@ export class AppComponent implements AfterViewInit {
private readonly themeService: ThemeService,
private readonly navigationService: NavigationService,
private readonly isolatedModulesService: IsolatedModulesService,
private readonly http: HttpClient,
@Inject(APP_PLUGIN) private readonly app: AppPlugin,
@Inject(APP_INFO_PLUGIN) private readonly appInfo: AppInfoPlugin,
@Inject(SPLASH_SCREEN_PLUGIN) private readonly splashScreen: SplashScreenPlugin
Expand Down Expand Up @@ -143,6 +142,14 @@ export class AppComponent implements AfterViewInit {
})
}

// Mt Perelin
this.http
.get('https://api.mtpelerin.com/currencies/tokens')
.toPromise()
.then((result) => {
this.storageProvider.setCache('mtperelin-currencies', result)
})

this.appSerivce.setReady()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ export class AccountEditPopoverComponent implements OnInit {
this.isTezosKT = true
}
if (supportsDelegation(this.wallet.protocol)) {
this.isDelegated = await this.operationsProvider.getDelegationStatusOfAddress(
this.wallet.protocol,
this.wallet.receivingPublicAddress
)
this.isDelegated = await this.operationsProvider.getDelegationStatus(this.wallet)
}
// tezos end
}
Expand Down
3 changes: 3 additions & 0 deletions src/app/components/components.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { WidgetAccountSummary } from './widget-account-summary/widget-account-su
import { WidgetAccount } from './widget-account/widget-account'
import { WidgetAlert } from './widget-alert/widget-alert'
import { WidgetIconText } from './widget-icon-text/widget-icon-text'
import { WidgetInputDelay } from './widget-input-delay/widget-input-delay'
import { WidgetInputText } from './widget-input-text/widget-input-text'
import { WidgetOptionButtonGroup } from './widget-option-button-group/widget-option-button-group'
import { WidgetRewardList } from './widget-reward-list/widget-reward-list'
Expand Down Expand Up @@ -76,6 +77,7 @@ import { WidgetSelector } from './widget-selector/widget-selector'
WidgetAccountExtendedDetails,
WidgetAlert,
WidgetIconText,
WidgetInputDelay,
WidgetInputText,
WidgetRewardList,
WidgetOptionButtonGroup,
Expand Down Expand Up @@ -126,6 +128,7 @@ import { WidgetSelector } from './widget-selector/widget-selector'
WidgetAccountExtendedDetails,
WidgetAlert,
WidgetIconText,
WidgetInputDelay,
WidgetInputText,
WidgetRewardList,
WidgetOptionButtonGroup,
Expand Down
35 changes: 22 additions & 13 deletions src/app/components/portfolio-item/portfolio-item.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
<ion-item *ngIf="wallet; else skeletonWallet" lines="none">
<ion-avatar slot="start">
<airgap-identicon *ngIf="!isToken" [address]="wallet.receivingPublicAddress"></airgap-identicon>
<airgap-currency-symbol [symbol]="wallet.protocol.symbol" [protocolIdentifier]="wallet.protocol.identifier" *ngIf="isToken"></airgap-currency-symbol>
<airgap-currency-symbol [symbol]="wallet.protocol.symbol" [protocolIdentifier]="wallet.protocol.identifier" *ngIf="!isToken" class="symbol--icon"></airgap-currency-symbol>
<airgap-currency-symbol
[symbol]="wallet.protocol.symbol"
[protocolIdentifier]="wallet.protocol.identifier"
*ngIf="isToken"
></airgap-currency-symbol>
<airgap-currency-symbol
[symbol]="wallet.protocol.symbol"
[protocolIdentifier]="wallet.protocol.identifier"
*ngIf="!isToken"
class="symbol--icon"
></airgap-currency-symbol>
</ion-avatar>
<ion-label>
<h2
Expand All @@ -14,7 +23,7 @@
</h2>
<ng-template #syncingHeading>
<h2>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 80%;"></ion-skeleton-text>
</h2>
</ng-template>
<ng-container *ngIf="!isToken">
Expand All @@ -37,7 +46,7 @@ <h3 *ngIf="wallet.addresses.length > 0; else syncingHeadingLow" class="typograph
<ng-template #syncingHeadingLow>
<div>
<h3>
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 60%;"></ion-skeleton-text>
</h3>
</div>
</ng-template>
Expand All @@ -46,25 +55,25 @@ <h3>
<div slot="end" *ngIf="!isExpendable && !hideFiatAmounts">
<ng-container *ngIf="balance && marketPrice; else syncingBalance">
<p class="ion-text-right font--weight__bold porfolio-item__margin" *ngIf="marketPrice && marketPrice.toNumber() > 0">
${{ balance | cryptoToFiat: { protocolIdentifier: wallet.protocol.identifier, currentMarketPrice:
marketPrice } | async | number: '1.2-2' }}
${{ balance | cryptoToFiat: { protocolIdentifier: wallet.protocol.identifier, currentMarketPrice: marketPrice } | async | number:
'1.2-2' }}
</p>
</ng-container>
<ng-template #syncingBalance>
<p>
<ion-skeleton-text animated style="width: 40px"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 40px;"></ion-skeleton-text>
</p>
</ng-template>
<p *ngIf="balance; else syncingPrice">
<ion-text color="blackLight">
<span *ngIf="balance && balance.toNumber() > 0 && marketPrice && marketPrice.toNumber() > 0">
<span *ngIf="marketPrice && marketPrice.toNumber() > 0">
${{ marketPrice.toNumber() | number: '1.2-4' }}
</span>
</ion-text>
</p>
<ng-template #syncingPrice>
<p>
<ion-skeleton-text animated style="width: 40px"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 40px;"></ion-skeleton-text>
</p>
</ng-template>
</div>
Expand All @@ -87,18 +96,18 @@ <h3>
</ion-avatar>
<ion-label>
<h2>
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 80%;"></ion-skeleton-text>
</h2>
<h3 *ngIf="!isToken">
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 50%;"></ion-skeleton-text>
</h3>
</ion-label>
<div slot="end">
<p>
<ion-skeleton-text animated style="width: 40px"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 40px;"></ion-skeleton-text>
</p>
<p>
<ion-skeleton-text animated style="width: 40px"></ion-skeleton-text>
<ion-skeleton-text animated style="width: 40px;"></ion-skeleton-text>
</p>
</div>
</ion-item>
Expand Down
9 changes: 3 additions & 6 deletions src/app/components/portfolio-item/portfolio-item.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AmountConverterPipe, ProtocolService } from '@airgap/angular-core'
import { Component, Input } from '@angular/core'
import { AirGapMarketWallet, ICoinDelegateProtocol } from '@airgap/coinlib-core'
import { AirGapMarketWallet } from '@airgap/coinlib-core'
import { NetworkType } from '@airgap/coinlib-core/utils/ProtocolNetwork'
import { Component, Input } from '@angular/core'
import BigNumber from 'bignumber.js'
import { Observable, Subscription } from 'rxjs'

Expand Down Expand Up @@ -78,10 +78,7 @@ export class PortfolioItemComponent {
if (!supportsDelegation(this.wallet.protocol)) {
this.isDelegated = null
} else {
this.isDelegated = await this.operationsProvider.getDelegationStatusObservableOfAddress(
this.wallet?.protocol as ICoinDelegateProtocol,
this.wallet?.receivingPublicAddress
)
this.isDelegated = await this.operationsProvider.getDelegationStatusObservable(this.wallet)
}
}
}
Expand Down
31 changes: 31 additions & 0 deletions src/app/components/widget-input-delay/widget-input-delay.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<form [formGroup]="widgetForm">
<ion-row class="ion-padding-horizontal padding-top ion-align-items-center value__container">
<ion-col size="9" class="value--container__input ion-no-padding">
<ion-item class="ion-no-padding" lines="none">
<ion-label color="blackLight" class="ion-no-margin" position="stacked">{{ widget.label | translate }}</ion-label>
<ion-input [type]="widget.inputType" [placeholder]="widget.fixedMinValue" [formControlName]="widget.id"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row class="ion-padding-horizontal">
<ion-col size="12">
<ion-range
[min]="widget.fixedMinValue"
[max]="widget.maxValue"
[value]="value"
step="1"
(ionChange)="onRangeChange($event)"
></ion-range>
<ion-text class="ion-no-margin ion-no-padding" color="blackLight" *ngIf="widget.extraLabel || widget.createExtraLabel">
<p [innerHTML]="widget.extraLabel | translate"></p>
</ion-text>
</ion-col>
</ion-row>
<ion-row class="ion-padding-horizontal ion-padding-bottom" *ngIf="widget.formControl && (widget.errorLabel)">
<ion-col size="12" *ngIf="widget.formControl.invalid">
<ion-text class="ion-no-margin" color="danger">
<p class="ion-no-margin">{{ widget.errorLabel | translate }}</p>
</ion-text>
</ion-col>
</ion-row>
</form>
17 changes: 17 additions & 0 deletions src/app/components/widget-input-delay/widget-input-delay.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.value__container {
.item-inner {
border-bottom-color: transparent !important;
box-shadow: none !important;
}
ion-input {
font-size: 1.4em;
font-weight: bold;
margin: 0;
--padding-top: 12px;
--padding-bottom: 12px;
}
.value--container__input,
.value--container__input .item-inner {
padding-right: 0;
}
}
48 changes: 48 additions & 0 deletions src/app/components/widget-input-delay/widget-input-delay.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'
import { FormGroup } from '@angular/forms'
import BigNumber from 'bignumber.js'
import { Subscription } from 'rxjs'
import { UIInputDelay } from 'src/app/models/widgets/input/UIInputDelay'

@Component({
selector: 'widget-input-delay',
templateUrl: 'widget-input-delay.html',
styleUrls: ['widget-input-delay.scss']
})
export class WidgetInputDelay implements OnChanges {
@Input()
public widget: UIInputDelay

@Input()
public widgetForm: FormGroup

public value: string | undefined

private valueSubscription: Subscription | undefined

public ngOnChanges(changes: SimpleChanges): void {
const currentWidget = changes.widget.currentValue as UIInputDelay
this.value = currentWidget.fixedMinValue

if (changes.widgetForm.previousValue !== changes.widgetForm.currentValue) {
this.valueSubscription?.unsubscribe()
const currentWidgetForm = changes.widgetForm.currentValue as FormGroup
this.valueSubscription = currentWidgetForm.get(this.widget.id).valueChanges.subscribe((value) => {
const control = currentWidgetForm.get(this.widget.id)
if (control.dirty && control.valid && new BigNumber(value).gte(currentWidget.fixedMinValue)) {
this.value = value
}
})
}
}

public onRangeChange(event) {
const value: number = event.detail.value
if (isNaN(value)) {
return
}

this.widgetForm.get(this.widget.id).markAsPristine()
this.widgetForm.patchValue({ [this.widget.id]: event.detail.value.toString() })
}
}
1 change: 1 addition & 0 deletions src/app/components/widget-selector/widget-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<widget-account *ngIf="widget.type === UIWidgetType.ACCOUNT" [widget]="widget"></widget-account>
<widget-account-summary *ngIf="widget.type === UIWidgetType.ACCOUNT_SUMMARY" [widget]="widget"></widget-account-summary>
<widget-icon-text *ngIf="widget.type === UIWidgetType.ICON_TEXT" [widget]="widget"></widget-icon-text>
<widget-input-delay *ngIf="widget.type === UIWidgetType.INPUT_DELAY && widgetForm" [widget]="widget" [widgetForm]="widgetForm"></widget-input-delay>
<widget-input-text *ngIf="widget.type === UIWidgetType.INPUT_TEXT && widgetForm" [widget]="widget" [widgetForm]="widgetForm"></widget-input-text>
<widget-option-button-group *ngIf="widget.type === UIWidgetType.OPTION_BUTTON_GROUP && widgetForm" [widget]="widget" [widgetForm]="widgetForm"></widget-option-button-group>
</ng-container>

0 comments on commit 95c9488

Please sign in to comment.