-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
2,042 additions
and
1,324 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -36,5 +36,7 @@ | |
"Greenplum", | ||
"hamcejdc", | ||
"Сleaning" | ||
"Unstake", | ||
"Unstaking" | ||
] | ||
} |
This file contains 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 |
---|---|---|
|
@@ -10,8 +10,8 @@ jobs: | |
outputs: | ||
matrix: ${{ steps.matrix.outputs.value }} | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- id: matrix | ||
if: env.IS_TAIGA_FAMILY_BOT_PR_AUTHOR == 'true' | ||
run: echo "value=$PR_JOBS_NAME" >> $GITHUB_OUTPUT | ||
|
@@ -24,7 +24,7 @@ jobs: | |
matrix: | ||
value: ${{ fromJSON(needs.setup.outputs.matrix) }} | ||
steps: | ||
- uses: taiga-family/ci/actions/run/[email protected].4 | ||
- uses: taiga-family/ci/actions/run/[email protected].6 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
job: ${{ matrix.value }} | ||
|
@@ -33,13 +33,13 @@ jobs: | |
needs: [wait] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/auto/approve/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/auto/approve/[email protected].6 | ||
with: | ||
token1: ${{ secrets.GITHUB_TOKEN }} | ||
token2: ${{ secrets.TAIGA_FAMILY_APPROVE_BOT_PAT }} | ||
- uses: taiga-family/ci/actions/run/[email protected].4 | ||
- uses: taiga-family/ci/actions/run/[email protected].6 | ||
if: env.IS_RELEASE_BRANCH == 'false' | ||
with: | ||
token: ${{ secrets.TAIGA_FAMILY_BOT_PAT }} | ||
|
This file contains 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 |
---|---|---|
|
@@ -10,9 +10,9 @@ jobs: | |
name: Build app | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- run: npx nx build | ||
|
||
concurrency: | ||
|
This file contains 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 |
---|---|---|
|
@@ -6,9 +6,9 @@ jobs: | |
name: Firebase | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- run: npx nx build --base-href='/' | ||
- name: Debug output | ||
run: tree dist/apps/taiga-lumbermill/browser -P '*.html' | ||
|
This file contains 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 |
---|---|---|
|
@@ -9,9 +9,9 @@ jobs: | |
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- run: npx nx build-gh-pages taiga-lumbermill | ||
- uses: JamesIves/[email protected] | ||
with: | ||
|
This file contains 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 |
---|---|---|
|
@@ -5,41 +5,41 @@ jobs: | |
typecheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- run: npm run typecheck | ||
|
||
cspell: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- run: npm run cspell -- --no-progress | ||
|
||
prettier: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- run: npm run prettier -- --check | ||
|
||
stylelint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- run: npm run stylelint | ||
|
||
eslint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- run: npm run lint | ||
|
||
result: | ||
|
This file contains 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 |
---|---|---|
|
@@ -11,9 +11,9 @@ jobs: | |
name: Run tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].4 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- uses: taiga-family/ci/actions/setup/[email protected].6 | ||
- name: Install Playwright | ||
run: npx playwright install --with-deps | ||
- name: Run Tests | ||
|
This file contains 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
113 changes: 113 additions & 0 deletions
113
apps/taiga-lumbermill/src/dashboards/crypto/components/staking/staking.component.html
This file contains 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,113 @@ | ||
@let data = tokens(); | ||
@if (data) { | ||
<div | ||
tuiAppearance="whiteblock" | ||
tuiCardLarge="normal" | ||
[style.height]="'100%'" | ||
> | ||
<header | ||
tuiHeader | ||
class="info" | ||
> | ||
<tui-avatar | ||
size="l" | ||
[src]="'btc' | coinIcon" | ||
/> | ||
<h2 | ||
tuiTitle | ||
[style.text-align]="'center'" | ||
> | ||
Staking Bitcoin | ||
</h2> | ||
<div | ||
tuiSubtitle | ||
[style.text-align]="'center'" | ||
> | ||
Earn a share of the protocol`s fees | ||
<br /> | ||
while staking BITCOIN | ||
</div> | ||
</header> | ||
<div class="group-buttons"> | ||
<button | ||
appearance="accent" | ||
tuiButton | ||
(click)="[(stake = true), showDialog(template)]" | ||
> | ||
Stake | ||
</button> | ||
<button | ||
appearance="whiteblock" | ||
tuiButton | ||
(click)="[(stake = false), showDialog(template)]" | ||
> | ||
Unstake | ||
</button> | ||
</div> | ||
<div class="position"> | ||
<div class="position-title">My position</div> | ||
<hr /> | ||
<div class="block-position"> | ||
<div class="tui-space_top-0 tui-space_bottom-0 bold">{{ amount() }} BTC</div> | ||
<div>${{ price() | number: '1.2-2' }}</div> | ||
</div> | ||
<hr /> | ||
<div class="block-position"> | ||
<div>Rewards</div> | ||
<div class="tui-space_top-0 tui-space_bottom-0 bold">0 BTC</div> | ||
<div>$0</div> | ||
</div> | ||
</div> | ||
<div class="position"> | ||
<div class="position-title">Overview</div> | ||
<hr /> | ||
<div class="block-position"> | ||
<div class="tui-space_top-0 tui-space_bottom-0">Total stacked</div> | ||
<div class="bold">1.5M BTC</div> | ||
</div> | ||
<hr /> | ||
<div class="block-position"> | ||
<div class="tui-space_top-0 tui-space_bottom-0">APR</div> | ||
<div class="bold">5%</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<ng-template | ||
#template | ||
let-observer | ||
> | ||
<header tuiHeader> | ||
<h2 tuiTitle>{{ stake ? 'Staking' : 'Unstaking' }} Bitcoin</h2> | ||
</header> | ||
<p>Available for {{ stake ? 'stake' : 'unstake' }}: {{ stake ? available - amount() : amount() }} BTC</p> | ||
@if (stake) { | ||
<tui-input-number | ||
tuiAutoFocus | ||
[max]="available - amount()" | ||
[min]="0" | ||
[(ngModel)]="inputStake" | ||
> | ||
Amount BTC | ||
</tui-input-number> | ||
} @else { | ||
<tui-input-number | ||
tuiAutoFocus | ||
[max]="amount()" | ||
[min]="0" | ||
[(ngModel)]="inputUnstake" | ||
> | ||
Amount BTC | ||
</tui-input-number> | ||
} | ||
<p> | ||
<button | ||
tuiButton | ||
type="submit" | ||
(click)="[observer.complete(), addAmount(stake ? inputStake : -inputUnstake), (inputStake = 0)]" | ||
> | ||
{{ stake ? 'Stake' : 'Unstake' }} | ||
</button> | ||
</p> | ||
</ng-template> | ||
} |
36 changes: 36 additions & 0 deletions
36
apps/taiga-lumbermill/src/dashboards/crypto/components/staking/staking.component.less
This file contains 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,36 @@ | ||
.info { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.group-buttons { | ||
display: flex; | ||
gap: 0.5rem; | ||
|
||
& button { | ||
flex-grow: 1; | ||
} | ||
} | ||
|
||
.position { | ||
border: solid 1px var(--tui-border-normal); | ||
border-radius: 1rem; | ||
|
||
&-title { | ||
padding: 0.5rem; | ||
padding-left: 1rem; | ||
font-weight: 600; | ||
} | ||
} | ||
|
||
.bold { | ||
font-weight: 700; | ||
font-size: 1.2rem; | ||
} | ||
|
||
.block-position { | ||
display: flex; | ||
padding: 0.5rem 1rem; | ||
flex-direction: column; | ||
} |
76 changes: 76 additions & 0 deletions
76
apps/taiga-lumbermill/src/dashboards/crypto/components/staking/staking.component.ts
This file contains 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,76 @@ | ||
import {CommonModule, DecimalPipe} from '@angular/common'; | ||
import { | ||
ChangeDetectionStrategy, | ||
Component, | ||
computed, | ||
inject, | ||
signal, | ||
} from '@angular/core'; | ||
import {toSignal} from '@angular/core/rxjs-interop'; | ||
import {FormsModule} from '@angular/forms'; | ||
import {TuiAutoFocus} from '@taiga-ui/cdk'; | ||
import type {TuiDialogContext} from '@taiga-ui/core'; | ||
import { | ||
TuiAppearance, | ||
TuiButton, | ||
TuiDialog, | ||
TuiDialogService, | ||
TuiTitle, | ||
} from '@taiga-ui/core'; | ||
import {TuiAvatar} from '@taiga-ui/kit'; | ||
import {TuiCardLarge, TuiHeader} from '@taiga-ui/layout'; | ||
import {TuiInputNumberModule} from '@taiga-ui/legacy'; | ||
import type {PolymorpheusContent} from '@taiga-ui/polymorpheus'; | ||
|
||
import {CryptoService} from '../../../../services/crypto.service'; | ||
import {CoinIconPipe} from '../../pipes/coin-icon.pipe'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'lmb-staking', | ||
imports: [ | ||
CoinIconPipe, | ||
CommonModule, | ||
DecimalPipe, | ||
FormsModule, | ||
TuiAppearance, | ||
TuiAutoFocus, | ||
TuiAvatar, | ||
TuiButton, | ||
TuiCardLarge, | ||
TuiDialog, | ||
TuiHeader, | ||
TuiInputNumberModule, | ||
TuiTitle, | ||
], | ||
templateUrl: './staking.component.html', | ||
styleUrl: './staking.component.less', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class StakingComponent { | ||
private readonly dialogs = inject(TuiDialogService); | ||
private readonly cryptoService = inject(CryptoService); | ||
protected tokens = toSignal(this.cryptoService.getTokens()); | ||
protected price = computed( | ||
() => | ||
this.amount() * | ||
(Number( | ||
(this.tokens() ?? []).find((token) => token.symbol === 'BTC')?.priceUsd, | ||
) ?? 0), | ||
); | ||
|
||
protected inputStake = 0; | ||
protected inputUnstake = 0; | ||
protected amount = signal(0); | ||
protected available = 100; | ||
|
||
protected stake = false; | ||
|
||
protected addAmount(add: number): void { | ||
this.amount.update((val) => val + add); | ||
} | ||
|
||
protected showDialog(content: PolymorpheusContent<TuiDialogContext>): void { | ||
this.dialogs.open(content).subscribe(); | ||
} | ||
} |
This file contains 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
Oops, something went wrong.