Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
231f12c
rub-3003, init deposit-form architecture
PseudoElement Sep 10, 2026
41c4af5
rub-3003, add timer
PseudoElement Sep 10, 2026
ccd4591
rub-3003, start deposit-form UI
PseudoElement Sep 11, 2026
d5caebe
rub-3003, add models, add tui-accordions to UI
PseudoElement Sep 14, 2026
e6036da
rub-3003, complete models and 1st step UI
PseudoElement Sep 15, 2026
3979771
rub-3003, added step 2, started step 3
PseudoElement Sep 16, 2026
73a6659
rub-3003, finish 3-4 steps, add boilerplate for qr code, fix rerender
PseudoElement Sep 17, 2026
240ca7b
rub-3003, remove spaces between scss props
PseudoElement Sep 17, 2026
3460646
rub-3003, refactor transfer methods, revive swapDirect method in ccr
PseudoElement Sep 18, 2026
9cf9a94
rub-3003, add connect & send logic to swap via wallet
PseudoElement Sep 18, 2026
5b18631
rub-3003, add maps for mupltiple action buttons in DepositStepWithAction
PseudoElement Sep 19, 2026
4e87ec1
rub-3003, finish statuses and success form
PseudoElement Sep 21, 2026
80b8f84
rub-3003, fix tx swap bugs, when new depositAddress used
PseudoElement Sep 21, 2026
03d53ef
rub-3003, fix isDepositTrade bug, shorten trade id
PseudoElement Sep 21, 2026
c377909
Merge master into rub-3003
PseudoElement Sep 22, 2026
1879c8f
rub-3003, fix fot-family name
PseudoElement Sep 22, 2026
8e10502
rub-3003, implement all qr code logic and rendering
PseudoElement Sep 22, 2026
90051a5
rub-3003, fix bugs 3180,3176,3175,3178; remove lastTransactionConfig
PseudoElement Sep 23, 2026
6723f59
rub-3003, fix bug 3172 when swapsStateService.tradeState is used from
PseudoElement Sep 23, 2026
83eabd4
rub-3003, fix 3184, 3190, 3178
PseudoElement Sep 23, 2026
f19dbbd
rub-3003, fix 3184, 3182
PseudoElement Sep 24, 2026
bd83945
rub-3003, fix 3191, 3192
PseudoElement Sep 24, 2026
324964b
Merge master into rub-3003
PseudoElement Sep 24, 2026
48fafb4
rub-3003, fix rub 3171, 3183
PseudoElement Sep 24, 2026
ddbceb0
rub-3003, disable button on start signing and enable form on swap error
PseudoElement Sep 24, 2026
f072d7a
rub-3003, remove qr code with amount from code
PseudoElement Sep 25, 2026
92ee4f0
rub-3003, change success window, fix texts, remove old trade on
PseudoElement Sep 25, 2026
936ea09
rub-3003, fix styles in deposit success window
PseudoElement Sep 28, 2026
156f62e
rub-3003, fix type of fontWeight
PseudoElement Sep 28, 2026
d3477ed
rub-3003, add states to button "Connect & Send", fix wrong chains in
PseudoElement Sep 28, 2026
bc59fcf
rub-3003, remove hardcoded status failed
PseudoElement Sep 28, 2026
d940355
rub-3003, handle real toAmount/toAmountWei from status response, move
PseudoElement Sep 28, 2026
711a902
rub-3003, enable 2 step on swap_via_wallet error
PseudoElement Sep 28, 2026
872d6b6
rub-3003, unlock step 2 if wallet not connected
PseudoElement Sep 28, 2026
4e400bc
rub-3003, fix duration and network === chainType check
PseudoElement Sep 29, 2026
ec70732
rub-3003, fix startedAt infinite overriding
PseudoElement Sep 29, 2026
b7802b1
rub-3003, fix getDefaultSelectedTrade
PseudoElement Sep 29, 2026
d3281f2
rub-3003, reset duration
PseudoElement Sep 29, 2026
4f2b9ec
rub-3003, monorepo 1.9.1
PseudoElement Sep 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ module.exports = {
true,
{
'border-in-box-model': false,
'empty-line-between-groups': true
'empty-line-between-groups': false
}
],
/* css rules */
'selector-type-no-unknown': null,
'at-rule-no-unknown': null,
'order/properties-order': null,
'order/properties-alphabetical-order': null,
'max-nesting-depth': 8, // Better if <= 4. Now it's 8 because of current css state of project.
'selector-no-vendor-prefix': null,
Expand Down
73 changes: 73 additions & 0 deletions RUB-3003.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
TODO:

- fix doubled alerts on swap error
- ++ fix /swap error "Trade can not be executed. You have not enough balance on
0x2210f8de2f3406aa38e7388c176b5e5c9b8352e8 wallet address."
- ++'Connect Wallet & Send' always same text even if wallet is connected
- ++fix tradeId crosses formTitle on mobile
- ++ add mobile UI
- ++ add success modal OR ask maybe add success info in 4 step when it's done, because statuses will
be not visible otherwise
- remove SwapPrivateResponseInterface from monorepo
- ++ add data/to/value in swap response
- ++ pass receiver and refund params in CrossChainService.swapTrade and OnChainService.swapTrade

**DEPOSIT_FORM_STATES: DepositFormState**

- TRADE_EXPIRED
- IDLE
- WAITING_FOR_SENDING_DEPOSIT
- STATUS_TRACKING: DepositTradeStatus(awaiting, confirming, exchanging, sending_to_receiver,
completed)
- COMPLETED

**DEPOSIT_TRADE_STEPS: DepositTradeStep**

- EXCHANGE_DETAILS
- INPUT_ADDRESSES
- TRADE_INFO
- TRADE_STATUS

`service class DepositFormManager`

- public closeForm(): void { this.depositStatusSrv.stopPolling() } - called in onDestroy hook
- private depositFormState: DepositFormState
- private _steps$ = nwe BehaviourSubject<Array<DepositStep | DepositStepWithBtn>>([])
- public steps$ = this._steps$.asObservable()
- private setLockedSteps(): void
- private setUnlockedSteps(): void
- public setDepositFormState(state: DepositFormState): void
- public doBtnAction(actionType: DepositTradeStep): void
- public getActionBtnText(): string
- public getFormTitle(): string

`service class DepositStatusService`

- private _pollingSub$: Subscription | null = null;
- private _status$ = new BehaviourSubject<DepositTradeStatus>('awaiting')
- public status$ = this._status$.asObservable()
- private async fetchStatus(rubicId: string): DepositTxStatus
- public stopPolling(): void { this._pollingSub$.unsubscribe() }
- public initPolling(): void { interval(30_000)... }

`abstract class DepositStep`

- active: boolean
- formTitle: string
- setActive(active: boolean): void
- setFormTitle(title: string): void

`abstract class DepositStepWithBtn extends DepositStep`

- confirmed: boolean
- setConfirmed(confirmed: boolean): void
- actionBtnText: string
- async doBtnAction(): void
- updateActionBtnText(text: string): void

**UI**

- for each accordion - different component DepositStepComponent
- for the whole form DepositForm with 4 steps
- also create wrapper for TRADE_EXPIRED and COMPLETED
- on InputAddressesDepositStep: new FormGroup({ receiverAddr: string, refundAddr: string })
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"style": "scss",
"changeDetection": "OnPush",
"standalone": false,
"skipTests": true
"skipTests": true,
"type": "component"
}
},
"architect": {
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
"@angular/platform-browser": "20.3.21",
"@angular/router": "20.3.21",
"@coinbase/wallet-sdk": "^4.0.3",
"@cryptorubic/core": "1.9.0",
"@cryptorubic/web3": "1.9.0",
"@cryptorubic/core": "1.9.1",
"@cryptorubic/web3": "1.9.1",
"@hakimio/ngx-google-analytics": "^15.0.0",
"@hinkal/common": "0.2.33",
"@maskito/angular": "^3.11.1",
Expand Down Expand Up @@ -127,6 +127,7 @@
"patch-package": "^8.0.1",
"privacycash": "^1.1.15",
"process": "^0.11.10",
"qrcode": "^1.5.4",
"querystring-es3": "^0.2.1",
"rpc-websockets": "7.9.0",
"rxjs": "7.8.1",
Expand Down Expand Up @@ -158,6 +159,7 @@
"@types/jasmine": "^3.6.11",
"@types/jasminewd2": "^2.0.9",
"@types/node": "^12.20.13",
"@types/qrcode": "^1.5.6",
"@typescript-eslint/eslint-plugin": "^8.59.3",
"@typescript-eslint/parser": "^8.59.3",
"assert": "^2.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<router-outlet></router-outlet>
<div id="turnstile-container-invisible"></div>
</main>

<app-rubic-footer *noFrame class="footer"></app-rubic-footer>
</div>
<ng-container *noFrame>
Expand Down
3 changes: 1 addition & 2 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
tui-root {
font-size: 0.75rem;
line-height: 1.25rem;

border-image: none;
}

.wrapper {
position: relative;

display: flex;
flex-direction: column;

Expand All @@ -38,6 +36,7 @@ tui-root {

> :last-child {
flex: 0;
margin-top: 20px;
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { QueryParams } from '@core/services/query-params/models/query-params';
import { QueryParamsService } from '@core/services/query-params/query-params.service';
import { isSupportedLanguage } from '@shared/models/languages/supported-languages';
import { catchError, delay, first, map } from 'rxjs/operators';
import { forkJoin, Observable, of } from 'rxjs';
import { forkJoin, Observable, of, timer } from 'rxjs';
import { RubicWindow } from '@shared/utils/rubic-window';
import { IframeService } from '@core/services/iframe-service/iframe.service';
import { WalletConnectorService } from './core/services/wallets/wallet-connector-service/wallet-connector.service';
Expand Down Expand Up @@ -37,6 +37,8 @@ export class AppComponent implements AfterViewInit {

public readonly chartVisibile$ = this.chartService.chartVisibile$;

public readonly expiresAtMs$ = timer(0, 100_000).pipe(map(() => 10_000));

constructor(
@Inject(DOCUMENT) private document: Document,
private readonly translateService: TranslateService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@
&__icon {
position: absolute;
top: 2px;

margin-left: 7px;

::ng-deep svg {
width: auto;
height: 15px;

cursor: pointer;
opacity: 0.5;

transition: 0.2s ease-in-out;

fill: var(--secondary-text);

&:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,14 @@
&__icon {
position: absolute;
top: 2px;

margin-left: 7px;

::ng-deep svg {
width: auto;
height: 15px;

cursor: pointer;
opacity: 0.5;

transition: 0.2s ease-in-out;

fill: var(--secondary-text);

&:hover {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { RubicError } from '@core/errors/models/rubic-error';
import { BlockchainName } from '@cryptorubic/core';
import { ERROR_TYPE } from 'src/app/core/errors/models/error-type';

export class NotSupportedNetworkForDepositError extends RubicError<ERROR_TYPE.TEXT> {
constructor(network: BlockchainName) {
super('errors.notSupportedNetworkForDeposit', { network });
Object.setPrototypeOf(this, NotSupportedNetworkForDepositError.prototype);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
height: 57px;
max-height: 57px;
overflow: hidden;

font-size: 18px;

text-decoration: none;

background-repeat: no-repeat;
background-position: center;
background-size: cover;
Expand All @@ -39,7 +37,6 @@

@include b($mobile-md) {
width: 220px;

line-height: normal;
text-align: left;
}
Expand All @@ -48,12 +45,10 @@
.banner__button {
display: block;
padding: 5px 20px;

font-size: 18px;
text-align: center;
text-wrap: nowrap;
text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);

background: var(--tui-background-accent-1);
border-radius: 8px;

Expand All @@ -67,7 +62,6 @@

&:hover {
transform: scale(1.1);

transition: all 0.1s;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
width: 15px;
height: 15px;
margin-right: 10px;

border-radius: 3px;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.navbar-toggler {
margin-top: -5px;
padding: 10px 6px;

background: none;
border: 0 none;
cursor: pointer;
Expand All @@ -10,17 +9,13 @@
display: block;
width: 22px;
height: 2px;

background-color: black;
border-radius: 1px;

transition: transform 0.3s ease-in-out;

&:nth-child(2) {
margin-top: 4px;

opacity: 1;

transition: opacity 0.3s ease-in-out;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
&__link {
display: block;
padding: 20px 28px;

color: var(--primary-text);
font-size: 16px;

border-bottom: 1px solid var(--tui-border-normal);

&:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

&__card {
padding: 1rem;

background-color: var(--io-background);

background-image: url('/assets/images/rubic-account-card.png');
Expand All @@ -27,7 +26,6 @@

&-address {
margin-left: 0.5rem;

color: #aaa;
font-weight: 600;
font-size: 16px;
Expand Down Expand Up @@ -55,15 +53,13 @@
&-body {
&-title {
margin-bottom: 8px;

color: var(--tui-text-tertiary);
font-weight: 600;
font-size: 14px;
}

&-balance {
min-height: 20px;

font-size: 24px;

&.tui-skeleton {
Expand All @@ -82,15 +78,13 @@

path {
opacity: 0.7;

fill: var(--tui-text-primary);
}

&:active,
&:hover {
path {
opacity: 1;

fill: #00e28e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
&__line {
width: 100%;
height: 2px;

background-color: var(--tui-text-action);
border-radius: 5px;

transition: 0.3s ease-in-out;

transition-property: opacity, transform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
&__line {
width: 100%;
height: 2px;

background-color: var(--tui-text-action);
border-radius: 5px;

transition: 0.3s ease-in-out;

transition-property: opacity, transform;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

margin: 0 var(--tui-padding-m) var(--tui-padding-xs) var(--tui-padding-m);
padding: var(--tui-padding-s) var(--tui-padding-m);

background: var(--io-background);

border-radius: 20px;
Expand Down
Loading
Loading