Skip to content

Commit c78d9ad

Browse files
authored
[RELEASE] tangle-dapp v0.1.2 (#2974)
1 parent 6fc7404 commit c78d9ad

File tree

8 files changed

+124
-93
lines changed

8 files changed

+124
-93
lines changed

apps/tangle-dapp/CHANGELOG.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,78 @@
1+
## 0.1.2 (2025-04-16)
2+
3+
### 🚀 Features
4+
5+
- **tangle-cloud:** blueprint deployment request args configuration & finalization ([#2957](https://github.com/tangle-network/dapp/pull/2957))
6+
- **tangle-dapp:** Add Protocol Stats Component ([#2966](https://github.com/tangle-network/dapp/pull/2966))
7+
- **tangle-dapp:** Add Phantom wallet to dApp wallet provider ([#2885](https://github.com/tangle-network/dapp/pull/2885))
8+
- **leaderboard:** Show Validator Identity, Use Timestamp ([#2947](https://github.com/tangle-network/dapp/pull/2947))
9+
- **tangle-dapp:** Add XP & Points Banner to Sidebar ([#2949](https://github.com/tangle-network/dapp/pull/2949))
10+
- **leaderboard:** Integrate Leaderboard with GraphQL Server ([#2938](https://github.com/tangle-network/dapp/pull/2938))
11+
- **tangle-cloud:** implement logic update pending service request ([#2917](https://github.com/tangle-network/dapp/pull/2917))
12+
- **tangle-dapp:** Add LS pools loading state ([#2914](https://github.com/tangle-network/dapp/pull/2914))
13+
- **leaderboard:** Add Leaderboard dApp ([#2913](https://github.com/tangle-network/dapp/pull/2913))
14+
- **ui-components:** Setup Release Automation [skip ci] ([#2888](https://github.com/tangle-network/dapp/pull/2888))
15+
- **tangle-dapp:** Add LS pools update nominations modal & tx ([#2911](https://github.com/tangle-network/dapp/pull/2911))
16+
- **tangle-dapp:** Add LS pool bouncer controls (close/open pool) ([#2898](https://github.com/tangle-network/dapp/pull/2898))
17+
- **tangle-cloud:** implement logic for registered blueprints and running blueprints ([#2902](https://github.com/tangle-network/dapp/pull/2902))
18+
19+
### 🩹 Fixes
20+
21+
- **tangle-shared-ui:** Correct memo check ([aab0c101](https://github.com/tangle-network/dapp/commit/aab0c101))
22+
- **tangle-shared-ui:** Update Tx Eligible Check ([#2969](https://github.com/tangle-network/dapp/pull/2969))
23+
- **tangle-dapp:** Fix Theme Flickering, Disable Link ([#2953](https://github.com/tangle-network/dapp/pull/2953))
24+
- **libs/tangle-shared-ui:** update the TVL calculation in use blueprint hook ([#2903](https://github.com/tangle-network/dapp/pull/2903))
25+
- **tangle-dapp:** Fix Incorrect Precompile Reward, Bump Types ([#2901](https://github.com/tangle-network/dapp/pull/2901))
26+
27+
### 💅 Refactors
28+
29+
- **tangle-dapp:** Relocate Claim Rewards in Top Navigation ([#2948](https://github.com/tangle-network/dapp/pull/2948))
30+
- **repo:** move useAgnosticTx to common ([#2920](https://github.com/tangle-network/dapp/pull/2920))
31+
- **repo:** move evmPrecompiles to common ([#2919](https://github.com/tangle-network/dapp/pull/2919))
32+
- **repo:** move graphql to common ([#2899](https://github.com/tangle-network/dapp/pull/2899))
33+
34+
### 🏡 Chore
35+
36+
- **tangle-dapp:** Refactor restake page with new tab navigation and content structure ([#2973](https://github.com/tangle-network/dapp/pull/2973))
37+
- **tangle-dapp:** Revert release notes ([c5b6d902](https://github.com/tangle-network/dapp/commit/c5b6d902))
38+
- bump @hookform/resolvers from 3.10.0 to 5.0.1 ([#2972](https://github.com/tangle-network/dapp/pull/2972))
39+
- bump eslint-config-prettier from 9.1.0 to 10.1.2 ([#2971](https://github.com/tangle-network/dapp/pull/2971))
40+
- bump actions/setup-node from 4.3.0 to 4.4.0 ([#2970](https://github.com/tangle-network/dapp/pull/2970))
41+
- bump vite-plugin-dts from 4.3.0 to 4.5.3 ([#2968](https://github.com/tangle-network/dapp/pull/2968))
42+
- bump typescript-eslint from 8.29.1 to 8.30.0 ([#2967](https://github.com/tangle-network/dapp/pull/2967))
43+
- **tangle-dapp:** Update asset selection modal ([#2965](https://github.com/tangle-network/dapp/pull/2965))
44+
- bump actions/create-github-app-token from 1 to 2 ([#2961](https://github.com/tangle-network/dapp/pull/2961))
45+
- bump @polkadot/keyring from 13.3.1 to 13.4.3 ([#2962](https://github.com/tangle-network/dapp/pull/2962))
46+
- **tangle-dapp:** Improve Vault Table ([#2956](https://github.com/tangle-network/dapp/pull/2956))
47+
- **tangle-dapp:** Group chains by chain type in ChainList component ([#2954](https://github.com/tangle-network/dapp/pull/2954))
48+
- **tangle-dapp:** Update Account Card Components ([#2951](https://github.com/tangle-network/dapp/pull/2951))
49+
- bump lycheeverse/lychee-action from 2.3.0 to 2.4.0 ([#2943](https://github.com/tangle-network/dapp/pull/2943))
50+
- bump @commitlint/config-conventional from 19.7.1 to 19.8.0 ([#2929](https://github.com/tangle-network/dapp/pull/2929))
51+
- bump @testing-library/react from 16.1.0 to 16.2.0 ([#2928](https://github.com/tangle-network/dapp/pull/2928))
52+
- bump actions/setup-node from 4.2.0 to 4.3.0 ([#2930](https://github.com/tangle-network/dapp/pull/2930))
53+
- bump actions/setup-node from 4.2.0 to 4.3.0 ([#2906](https://github.com/tangle-network/dapp/pull/2906))
54+
- **repo:** bump `tangle-substrate-type` version ([#2900](https://github.com/tangle-network/dapp/pull/2900))
55+
56+
### 🎨 Styles
57+
58+
- **ui-components:** Improve modal scrollable behavior ([#2952](https://github.com/tangle-network/dapp/pull/2952))
59+
60+
### 🤖 CI
61+
62+
- **tools:** Add Netlify Build Ignore to Improve Release Process ([#2912](https://github.com/tangle-network/dapp/pull/2912))
63+
64+
### ❤️ Thank You
65+
66+
- Daniel Bui @danielbui12
67+
- Pavan Soratur @devpavan04
68+
- Trung-Tin Pham @AtelyPham
69+
- yurixander @yurixander
70+
171
## 0.1.1 (2025-03-10)
272

373
### 🩹 Fixes
474

5-
- ***:** Fix other commit types not rendering on changelog ([0b6ed055](https://github.com/tangle-network/dapp/commit/0b6ed055))
75+
- **\*:** Fix other commit types not rendering on changelog ([0b6ed055](https://github.com/tangle-network/dapp/commit/0b6ed055))
676
- **tangle-shared-ui:** Fix Incorrect Vault Data Display ([#2894](https://github.com/tangle-network/dapp/pull/2894))
777

878
### 💅 Refactors

apps/tangle-dapp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tangle-network/tangle-dapp",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"license": "Apache-2.0",
55
"type": "module"
66
}

apps/tangle-dapp/src/pages/restake/delegate/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ const RestakeDelegateForm: FC<Props> = ({ assets }) => {
235235
[closeChainModal, switchChain],
236236
);
237237

238+
const selectedAssetId = watch('assetId');
238239
const selectedAsset = useMemo(() => {
239-
return assets?.get(watch('assetId')) ?? null;
240-
// eslint-disable-next-line react-hooks/exhaustive-deps
241-
}, [watch('assetId')]);
240+
return assets?.get(selectedAssetId) ?? null;
241+
}, [assets, selectedAssetId]);
242242

243243
const isReady =
244244
restakeApi !== null &&

apps/tangle-dapp/src/pages/restake/deposit/DepositForm.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ const DepositForm: FC<Props> = ({
172172
[closeTokenModal, setValue],
173173
);
174174

175+
const depositAssetId = watch('depositAssetId');
175176
const asset = useMemo(() => {
176-
return assets?.get(watch('depositAssetId')) ?? null;
177-
// eslint-disable-next-line react-hooks/exhaustive-deps
178-
}, [watch('depositAssetId'), assets]);
177+
return assets?.get(depositAssetId) ?? null;
178+
}, [assets, depositAssetId]);
179179

180180
const isReady = restakeApi !== null && asset !== null && !isSubmitting;
181181

libs/tangle-shared-ui/src/data/restake/useDelegatorTVL.ts

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { useObservable, useObservableState } from 'observable-hooks';
2-
import { of, switchMap } from 'rxjs';
3-
import type { RestakeAssetMap, DelegatorInfo } from '../../types/restake';
1+
import { useMemo } from 'react';
2+
import type { DelegatorInfo, RestakeAssetMap } from '../../types/restake';
43

54
const calculateDelegatorTVL = (
65
delegatorInfo: DelegatorInfo,
@@ -37,19 +36,11 @@ export function useDelegatorTVL(
3736
delegatorInfo: DelegatorInfo | null,
3837
assetMap: RestakeAssetMap | null,
3938
) {
40-
const tvl$ = useObservable(
41-
(input$) =>
42-
input$.pipe(
43-
switchMap(([delegatorInfo, assetMap]) =>
44-
of(
45-
!delegatorInfo || !assetMap
46-
? { delegatorTVL: {}, totalDelegatorTVL: 0 }
47-
: calculateDelegatorTVL(delegatorInfo, assetMap),
48-
),
49-
),
50-
),
51-
[delegatorInfo, assetMap],
52-
);
39+
return useMemo(() => {
40+
if (delegatorInfo === null || assetMap === null) {
41+
return { delegatorTVL: {}, totalDelegatorTVL: 0 };
42+
}
5343

54-
return useObservableState(tvl$, { delegatorTVL: {}, totalDelegatorTVL: 0 });
44+
return calculateDelegatorTVL(delegatorInfo, assetMap);
45+
}, [delegatorInfo, assetMap]);
5546
}
Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,27 @@
11
import { assertSubstrateAddress } from '@tangle-network/ui-components';
22
import { SubstrateAddress } from '@tangle-network/ui-components/types/address';
3-
import { useObservable, useObservableState } from 'observable-hooks';
4-
import { of, switchMap } from 'rxjs';
3+
import { useMemo } from 'react';
54

65
export type OperatorConcentration = Map<SubstrateAddress, number | null>;
76

87
export function useOperatorConcentration(
98
operatorTVL: Map<SubstrateAddress, number>,
109
totalNetworkTVL: number,
1110
) {
12-
const concentration$ = useObservable(
13-
(input$) =>
14-
input$.pipe(
15-
switchMap(([operatorTVL, totalNetworkTVL]) => {
16-
const operatorConcentration = Object.entries(operatorTVL).reduce(
17-
(acc, [operatorId_, operatorTVL]) => {
18-
const operatorId = assertSubstrateAddress(operatorId_);
19-
acc.set(
20-
operatorId,
21-
totalNetworkTVL > 0
22-
? (operatorTVL / totalNetworkTVL) * 100
23-
: null,
24-
);
11+
return useMemo(() => {
12+
const operatorConcentration = Object.entries(operatorTVL).reduce(
13+
(acc, [operatorId_, operatorTVL]) => {
14+
const operatorId = assertSubstrateAddress(operatorId_);
15+
acc.set(
16+
operatorId,
17+
totalNetworkTVL > 0 ? (operatorTVL / totalNetworkTVL) * 100 : null,
18+
);
2519

26-
return acc;
27-
},
28-
new Map<SubstrateAddress, number | null>(),
29-
);
20+
return acc;
21+
},
22+
new Map<SubstrateAddress, number | null>(),
23+
);
3024

31-
return of<OperatorConcentration>(operatorConcentration);
32-
}),
33-
),
34-
[operatorTVL, totalNetworkTVL],
35-
);
36-
37-
return useObservableState(concentration$, new Map());
25+
return operatorConcentration;
26+
}, [operatorTVL, totalNetworkTVL]);
3827
}

libs/tangle-shared-ui/src/data/restake/useOperatorTVL.ts

Lines changed: 23 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { useObservable, useObservableState } from 'observable-hooks';
2-
import { of, switchMap } from 'rxjs';
3-
import { RestakeAssetMap, OperatorMap } from '../../types/restake';
4-
import safeFormatUnits from '../../utils/safeFormatUnits';
51
import { SubstrateAddress } from '@tangle-network/ui-components/types/address';
6-
import { RestakeAssetId } from '../../types';
72
import { assertSubstrateAddress } from '@tangle-network/ui-components/utils';
3+
import { useMemo } from 'react';
4+
import { RestakeAssetId } from '../../types';
5+
import { OperatorMap, RestakeAssetMap } from '../../types/restake';
6+
import safeFormatUnits from '../../utils/safeFormatUnits';
87

98
export type OperatorTVLType = {
109
operatorTVLByAsset: Map<SubstrateAddress, Map<RestakeAssetId, number>>;
@@ -82,36 +81,23 @@ export const useOperatorTVL = (
8281
operatorMap: OperatorMap,
8382
assetMap: RestakeAssetMap | null,
8483
) => {
85-
const tvl$ = useObservable(
86-
(input$) =>
87-
input$.pipe(
88-
switchMap(([operatorMap, assetMap]) => {
89-
if (assetMap === null) {
90-
return of<OperatorTVLType>({
91-
operatorTVLByAsset: new Map(),
92-
vaultTVL: new Map(),
93-
operatorTVL: new Map(),
94-
});
95-
}
96-
97-
const { operatorTVLByAsset, operatorTVL, vaultTVL } = calculateTVL(
98-
operatorMap,
99-
assetMap,
100-
);
101-
102-
return of<OperatorTVLType>({
103-
operatorTVLByAsset,
104-
operatorTVL,
105-
vaultTVL,
106-
});
107-
}),
108-
),
109-
[operatorMap, assetMap],
110-
);
111-
112-
return useObservableState<OperatorTVLType>(tvl$, {
113-
operatorTVLByAsset: new Map(),
114-
operatorTVL: new Map(),
115-
vaultTVL: new Map(),
116-
});
84+
return useMemo(() => {
85+
if (assetMap === null)
86+
return {
87+
operatorTVLByAsset: new Map(),
88+
vaultTVL: new Map(),
89+
operatorTVL: new Map(),
90+
};
91+
92+
const { operatorTVLByAsset, operatorTVL, vaultTVL } = calculateTVL(
93+
operatorMap,
94+
assetMap,
95+
);
96+
97+
return {
98+
operatorTVLByAsset,
99+
operatorTVL,
100+
vaultTVL,
101+
};
102+
}, [assetMap, operatorMap]);
117103
};

libs/tangle-shared-ui/src/hooks/useApiRx.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,6 @@ const useApiRx = <T>(factory: ObservableFactory<T>) => {
116116
};
117117
}, [factory, apiRx, reset]);
118118

119-
// Reset the result when the RPC endpoint changes.
120-
useEffect(() => {
121-
setResult(null);
122-
}, [rpcEndpoint]);
123-
124119
return { result, isLoading, error };
125120
};
126121

0 commit comments

Comments
 (0)