Skip to content

Commit 7ce5299

Browse files
feat: port Namadillo to @namada/sdk-multicore v0.20.5 (#2279)
Co-authored-by: Mateusz Jasiuk <mateusz.jasiuk@gmail.com>
1 parent 4800000 commit 7ce5299

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+270
-306
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,6 @@ jobs:
3939
bundle_filename: ${{ needs.release-please.outputs.namadillo_tag }}.zip
4040
working_dir: ./apps/namadillo
4141

42-
build-sdk:
43-
needs: [release-please]
44-
if: ${{ needs.release-please.outputs.sdk_tag }}
45-
name: Release SDK
46-
runs-on: ubuntu-latest
47-
env:
48-
GH_TOKEN: ${{ github.token }}
49-
steps:
50-
- name: Checkout repository
51-
uses: actions/checkout@v4
52-
- name: Build and Release SDK
53-
uses: ./.github/actions/release-project
54-
with:
55-
tag: ${{ needs.release-please.outputs.sdk_tag }}
56-
bundle_filename: namada-${{ needs.release-please.outputs.sdk_tag }}.zip
57-
working_dir: ./packages/sdk
58-
- name: Publish to NPM repository
59-
run: cd ./packages/sdk && yarn npm publish
60-
env:
61-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
62-
6342
build-types:
6443
needs: [release-please]
6544
if: ${{ needs.release-please.outputs.types_tag }}

.github/workflows/verify-pull-request.yml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -78,39 +78,6 @@ jobs:
7878
id: run-unit-tests
7979
run: yarn test:ci
8080

81-
unit-tests-wasm:
82-
name: WASM unit tests
83-
needs: [check-yarn-lock-poisoning]
84-
runs-on: ubuntu-latest
85-
steps:
86-
- name: Checkout repository
87-
uses: actions/checkout@v4
88-
89-
- name: Setup Rust toolchain
90-
run: rustup toolchain add nightly-2025-03-27
91-
92-
- name: Restore Rust cache
93-
uses: ./.github/actions/rust-cache
94-
with:
95-
cache-name: unit-tests-wasm
96-
97-
- name: Install yarn dependencies
98-
uses: ./.github/actions/yarn-cache
99-
100-
- name: Apt update
101-
run: sudo apt update
102-
shell: bash
103-
104-
- name: Install protoc
105-
run: sudo apt-get install -y protobuf-compiler
106-
107-
- name: Install wsrun
108-
run: npm install -g wsrun
109-
110-
- name: Run unit tests
111-
id: run-unit-tests
112-
run: yarn test-wasm:ci
113-
11481
build-interface:
11582
name: Build Namadillo
11683
needs: [check-yarn-lock-poisoning]

apps/namadillo/package.json

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"@keplr-wallet/types": "^0.12.136",
1313
"@namada/chain-registry": "^1.3.0",
1414
"@namada/indexer-client": "3.3.2",
15+
"@namada/sdk-multicore": "^0.20.5",
1516
"@tailwindcss/container-queries": "^0.1.1",
1617
"@tanstack/query-core": "^5.40.0",
1718
"@tanstack/react-query": "^5.40.0",
@@ -51,24 +52,18 @@
5152
"dev": "VITE_REVISION=$(git rev-parse HEAD) vite",
5253
"dev:local": "NODE_ENV=development NAMADA_INTERFACE_LOCAL=\"true\" yarn dev",
5354
"dev:proxy": "VITE_PROXY=true && ./scripts/start-proxies.sh && yarn dev:local",
54-
"build": "NODE_ENV=production && yarn wasm:build:multicore && VITE_REVISION=$(git rev-parse HEAD) vite build",
55-
"build:only": "NODE_ENV=production && VITE_REVISION=$(git rev-parse HEAD) vite build",
55+
"build": "NODE_ENV=production VITE_REVISION=$(git rev-parse HEAD) vite build",
5656
"lint": "eslint src --ext .ts,.tsx",
5757
"lint:fix": "yarn lint -- --fix",
5858
"lint:ci": "yarn lint --max-warnings 0",
5959
"lint:version": "eslint --version",
60-
"test": "yarn wasm:build:test && yarn jest",
61-
"test:watch": "yarn wasm:build:test && yarn jest --watchAll=true",
62-
"test:coverage": "yarn wasm:build:test && yarn test --coverage",
60+
"test": "yarn jest",
61+
"test:watch": "yarn jest --watchAll=true",
62+
"test:coverage": "yarn test --coverage",
6363
"test:ci": "jest",
6464
"test:watch-only": "yarn jest --watchAll=true",
6565
"e2e-test": "PLAYWRIGHT_BASE_URL=http://localhost:3000 yarn playwright test",
66-
"e2e-test:headed": "PLAYWRIGHT_BASE_URL=http://localhost:3000 yarn playwright test --project=chromium --headed",
67-
"wasm:build": "node ./scripts/build.js --release",
68-
"wasm:build:multicore": "node ./scripts/build.js --release --multicore",
69-
"wasm:build:dev": "node ./scripts/build.js",
70-
"wasm:build:dev:multicore": "node ./scripts/build.js --multicore",
71-
"wasm:build:test": "./scripts/build-test.sh"
66+
"e2e-test:headed": "PLAYWRIGHT_BASE_URL=http://localhost:3000 yarn playwright test --project=chromium --headed"
7267
},
7368
"browserslist": {
7469
"production": [
@@ -84,6 +79,8 @@
8479
},
8580
"devDependencies": {
8681
"@eslint/js": "^9.9.1",
82+
"@namada/sdk-node": "^0.20.5",
83+
"@namada/vite-esbuild-plugin": "^1.0.1",
8784
"@playwright/test": "^1.24.1",
8885
"@svgr/webpack": "^6.5.1",
8986
"@testing-library/dom": "^10.4.0",

apps/namadillo/src/App/Ibc/IbcWithdraw.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Chain } from "@chain-registry/types";
2-
import { AccountType, IbcTransferMsgValue } from "@namada/types";
2+
import { IbcTransferProps } from "@namada/sdk-multicore";
3+
import { AccountType } from "@namada/types";
34
import { mapUndefined } from "@namada/utils";
45
import { params, routes } from "App/routes";
56
import {
@@ -275,7 +276,7 @@ export const IbcWithdraw = (): JSX.Element => {
275276
});
276277

277278
const storeTransferTransaction = (
278-
tx: TransactionPair<IbcTransferMsgValue>,
279+
tx: TransactionPair<IbcTransferProps>,
279280
displayAmount: BigNumber,
280281
destinationChainId: string,
281282
asset: Asset

apps/namadillo/src/App/Settings/SettingsLedger.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ActionButton, Stack } from "@namada/components";
2-
import { requestLedgerDevice } from "@namada/sdk/web";
2+
import { requestLedgerDevice } from "@namada/sdk-multicore";
33

44
export const SettingsLedger = (): JSX.Element => {
55
const onInvalidateShieldedContext = async (): Promise<void> => {

apps/namadillo/src/App/Settings/SettingsMain.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export const SettingsMain = (): JSX.Element => {
207207
<div>
208208
SDK Version:{" "}
209209
<a
210-
href="https://www.npmjs.com/package/@namada/sdk"
210+
href="https://www.npmjs.com/package/@namada/sdk-multicore"
211211
target="_blank"
212212
rel="noreferrer"
213213
className="underline"

apps/namadillo/src/App/Staking/ClaimRewardsSubmitModalStage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ActionButton, Stack } from "@namada/components";
2-
import { ClaimRewardsMsgValue } from "@namada/types";
2+
import { ClaimRewardsProps } from "@namada/sdk-multicore";
33
import { InlineError } from "App/Common/InlineError";
44
import { NamCurrency } from "App/Common/NamCurrency";
55
import { TransactionFeeButton } from "App/Common/TransactionFeeButton";
@@ -15,7 +15,7 @@ import { ValidatorCard } from "./ValidatorCard";
1515

1616
type ClaimRewardsPanelProps = {
1717
rewards: AddressBalance;
18-
rewardsToClaim: ClaimRewardsMsgValue[];
18+
rewardsToClaim: ClaimRewardsProps[];
1919
isClaimAndStake: boolean;
2020
feeProps: TransactionFeeProps;
2121
onClaim: () => Promise<void>;

apps/namadillo/src/App/Staking/IncrementBonding.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ActionButton, Alert, Modal, Panel } from "@namada/components";
2-
import { BondMsgValue } from "@namada/types";
2+
import { BondProps } from "@namada/sdk-multicore";
33
import { AtomErrorBoundary } from "App/Common/AtomErrorBoundary";
44
import { Info } from "App/Common/Info";
55
import { ModalContainer } from "App/Common/ModalContainer";
@@ -56,7 +56,7 @@ const IncrementBonding = (): JSX.Element => {
5656
onChangeValidatorAmount,
5757
} = useStakeModule({ account });
5858

59-
const parseUpdatedAmounts = (): BondMsgValue[] => {
59+
const parseUpdatedAmounts = (): BondProps[] => {
6060
if (!account?.address) return [];
6161
return Object.keys(updatedAmountByAddress)
6262
.map((validatorAddress) => ({

apps/namadillo/src/App/Staking/ReDelegate.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ActionButton, Alert, Modal, Panel } from "@namada/components";
2-
import { RedelegateMsgValue } from "@namada/types";
2+
import { RedelegateProps } from "@namada/sdk-multicore";
33
import { Info } from "App/Common/Info";
44
import { ModalContainer } from "App/Common/ModalContainer";
55
import { routes } from "App/routes";
@@ -37,7 +37,7 @@ export const ReDelegate = (): JSX.Element => {
3737
myValidators,
3838
} = useStakeModule({ account });
3939

40-
const parseRedelegateParams = (): RedelegateMsgValue[] => {
40+
const parseRedelegateParams = (): RedelegateProps[] => {
4141
if (!account?.address) return [];
4242
return getAmountDistribution(
4343
amountsRemovedByAddress,
@@ -47,7 +47,7 @@ export const ReDelegate = (): JSX.Element => {
4747
({
4848
...distribution,
4949
owner: account?.address,
50-
}) as RedelegateMsgValue
50+
}) as RedelegateProps
5151
);
5252
};
5353

apps/namadillo/src/App/Staking/StakingRewards.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Modal } from "@namada/components";
2-
import { ClaimRewardsMsgValue } from "@namada/types";
2+
import { ClaimRewardsProps } from "@namada/sdk-multicore";
33
import { BackButton } from "App/Common/BackButton";
44
import { ModalContainer } from "App/Common/ModalContainer";
55
import { defaultAccountAtom } from "atoms/accounts";
@@ -18,9 +18,7 @@ import { ClaimRewardsSubmitModalStage } from "./ClaimRewardsSubmitModalStage";
1818

1919
export const StakingRewards = (): JSX.Element => {
2020
const { data: account } = useAtomValue(defaultAccountAtom);
21-
const [rewardsToClaim, setRewardsToClaim] = useState<ClaimRewardsMsgValue[]>(
22-
[]
23-
);
21+
const [rewardsToClaim, setRewardsToClaim] = useState<ClaimRewardsProps[]>([]);
2422

2523
const [shouldClaimAndStake, setShouldClaimAndStake] = useState(false);
2624
const {
@@ -32,7 +30,7 @@ export const StakingRewards = (): JSX.Element => {
3230

3331
const parseStakingRewardsParams = (
3432
rewards: AddressBalance
35-
): ClaimRewardsMsgValue[] => {
33+
): ClaimRewardsProps[] => {
3634
if (!rewards || Object.values(rewards).length === 0 || !account) return [];
3735
return Object.keys(rewards).map((validatorAddress) => {
3836
return {

0 commit comments

Comments
 (0)