Skip to content

Commit 5f9a888

Browse files
committed
fix: cleanup
2 parents 86cf2d9 + 4600181 commit 5f9a888

File tree

175 files changed

+3803
-3045
lines changed

Some content is hidden

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

175 files changed

+3803
-3045
lines changed

.github/actions/prepare-build/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ runs:
1111
with:
1212
cache-name: build
1313

14+
- name: Setup Rust toolchain
15+
run: rustup toolchain add nightly-2025-03-27
16+
shell: bash
17+
1418
- name: Install protoc
1519
run: sudo apt-get install -y protobuf-compiler
1620
shell: bash

.github/actions/release-project/action.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,3 @@ runs:
3030
zip -r ${{ inputs.bundle_filename }} .
3131
gh release upload ${{ inputs.tag }} ${{ inputs.bundle_filename }}
3232
shell: bash
33-
34-
- name: Merge main branch into stable
35-
run: |
36-
git config --global user.name "github-actions[bot]"
37-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
38-
git fetch
39-
git checkout stable-interface
40-
git merge origin/main --no-edit
41-
git push origin stable-interface
42-
shell: bash

.github/workflows/docker.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ name: Docker Namadillo 🐳
33
on:
44
push:
55
tags:
6-
- namadillo@v*
6+
- 'namadillo@v*'
77
branches:
88
- main
99
- stable-interface
10+
workflow_dispatch:
1011

1112
env:
1213
GIT_LFS_SKIP_SMUDGE: 1

.release-please-manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"apps/namadillo": "1.20.1",
3-
"apps/extension": "0.5.0",
4-
"packages/sdk": "0.18.1",
5-
"packages/types": "0.6.0"
2+
"apps/namadillo": "1.28.2",
3+
"apps/extension": "0.8.1",
4+
"packages/sdk": "0.19.1",
5+
"packages/types": "0.7.0"
66
}

apps/extension/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22

3+
## [0.8.1](https://github.com/anoma/namada-interface/compare/extension@v0.8.0...extension@v0.8.1) (2025-06-19)
4+
5+
6+
### Bug Fixes
7+
8+
* Extension sliced address ([#2169](https://github.com/anoma/namada-interface/issues/2169)) ([901cdfa](https://github.com/anoma/namada-interface/commit/901cdfaab5bf496537a69ee96cfe4fb7c69cb5a8))
9+
* Use correct derivation path for masp signs using ledger AND sign all sapling inputs ([#2163](https://github.com/anoma/namada-interface/issues/2163)) ([96539ed](https://github.com/anoma/namada-interface/commit/96539ed2f9e06752e7cb595ab9029e5237c46c1b))
10+
11+
## [0.8.0](https://github.com/anoma/namada-interface/compare/extension@v0.7.0...extension@v0.8.0) (2025-06-10)
12+
13+
14+
### Features
15+
16+
* Keychain - Increase session timeout from 5 to 30 minutes ([#2122](https://github.com/anoma/namada-interface/issues/2122)) ([243c013](https://github.com/anoma/namada-interface/commit/243c013356059cc7723b39ff2d60265b57b35cd1))
17+
18+
## [0.7.0](https://github.com/anoma/namada-interface/compare/extension@v0.6.0...extension@v0.7.0) (2025-06-07)
19+
20+
21+
### Features
22+
23+
* Mark Ledger accounts missing shielded account as outdated ([#2099](https://github.com/anoma/namada-interface/issues/2099)) ([ddb2f5c](https://github.com/anoma/namada-interface/commit/ddb2f5cb568a20a8dc94110ec81adf59d39e2f78))
24+
325
## [0.6.0](https://github.com/anoma/namada-interface/compare/extension@v0.5.0...extension@v0.6.0) (2025-04-18)
426

527

apps/extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@namada/extension",
3-
"version": "0.6.0",
3+
"version": "0.8.1",
44
"description": "Namada Keychain",
55
"repository": "https://github.com/anoma/namada-interface/",
66
"author": "Heliax Dev <info@heliax.dev>",

apps/extension/src/App/Accounts/ParentAccounts.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,20 @@ export const ParentAccounts = (): JSX.Element => {
5353
}
5454
});
5555

56+
// We check whether a Ledger parent has an associated shielded account
57+
allAccounts
58+
.filter(
59+
(account) => !account.parentId && account.type === AccountType.Ledger
60+
)
61+
.forEach(({ id }) => {
62+
const shieldedAccount = allAccounts.find(
63+
({ parentId }) => parentId === id
64+
);
65+
if (!shieldedAccount) {
66+
allParentAccounts[id]["outdated"] = true;
67+
}
68+
});
69+
5670
const accounts = Object.values(allParentAccounts);
5771

5872
useEffect(() => {

apps/extension/src/App/Accounts/UpdateRequired.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ export const UpdateRequired = (): JSX.Element => {
7171
</li>
7272
<li>Delete the marked account from 
the keychain</li>
7373
<li>
74-
Re-Import the account using your seed phrase / private key
74+
Re-Import the account using your seed phrase / private key /
75+
Ledger HW wallet
7576
</li>
7677
</ol>
7778
</Stack>

apps/extension/src/App/Accounts/ViewAccount.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export const ViewAccount = (): JSX.Element => {
128128
transparentAccountPath={transparentPath}
129129
shieldedAccountAddress={shieldedAccount?.address}
130130
shieldedAccountPath={shieldedPath}
131-
trimCharacters={21}
131+
trimCharacters={16}
132132
/>
133133
{viewingKey && (
134134
<>

apps/extension/src/Approvals/ConfirmSignLedgerTx.tsx

Lines changed: 62 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { getSdk } from "@namada/sdk/web";
2+
import sdkInit from "@namada/sdk/web-init";
13
import clsx from "clsx";
24
import { ReactNode, useCallback, useEffect, useState } from "react";
35

@@ -84,8 +86,9 @@ export const ConfirmSignLedgerTx: React.FC<Props> = ({ details }) => {
8486
const signMaspTx = async (
8587
ledger: Ledger,
8688
bytes: Uint8Array,
87-
path: string
88-
): Promise<{ sbar: Uint8Array; rbar: Uint8Array }> => {
89+
path: string,
90+
shieldedHash?: string
91+
): Promise<{ sbar: Uint8Array; rbar: Uint8Array }[]> => {
8992
const signMaspSpendsResponse = await ledger.namadaApp.signMaspSpends(
9093
path,
9194
Buffer.from(bytes)
@@ -97,14 +100,36 @@ export const ConfirmSignLedgerTx: React.FC<Props> = ({ details }) => {
97100
);
98101
}
99102

100-
const spendSignatureResponse = await ledger.namadaApp.getSpendSignature();
101-
if (spendSignatureResponse.returnCode !== LedgerError.NoErrors) {
102-
throw new Error(
103-
`Getting spends signature error encountered: ${signMaspSpendsResponse.errorMessage}`
104-
);
103+
if (!shieldedHash) {
104+
throw new Error("Shielded hash is required for MASP transactions");
105105
}
106106

107-
return spendSignatureResponse;
107+
const { cryptoMemory } = await sdkInit();
108+
// TODO: Find a better way to init the sdk, token has to be any valid token
109+
const sdk = getSdk(
110+
cryptoMemory,
111+
"",
112+
"",
113+
"",
114+
"tnam1q9gr66cvu4hrzm0sd5kmlnjje82gs3xlfg3v6nu7"
115+
);
116+
const descriptors = await sdk
117+
.getMasp()
118+
.getDescriptorMap(bytes, fromBase64(shieldedHash));
119+
120+
const responses = [];
121+
// TODO: this probably means that we do not really need descriptor map, but just to iterate over the sapling inputs
122+
for (const _ of descriptors) {
123+
const spendSignatureResponse = await ledger.namadaApp.getSpendSignature();
124+
if (spendSignatureResponse.returnCode !== LedgerError.NoErrors) {
125+
throw new Error(
126+
`Getting spends signature error encountered: ${signMaspSpendsResponse.errorMessage}`
127+
);
128+
}
129+
responses.push(spendSignatureResponse);
130+
}
131+
132+
return responses;
108133
};
109134

110135
const signLedgerTx = async (
@@ -130,15 +155,20 @@ export const ConfirmSignLedgerTx: React.FC<Props> = ({ details }) => {
130155
ledger: Ledger,
131156
tx: string,
132157
zip32Path: string,
133-
signatures: string[]
158+
signatures: string[],
159+
shieldedHash?: string
134160
) => {
135-
const { sbar, rbar } = await signMaspTx(
161+
const responses = await signMaspTx(
136162
ledger,
137163
fromBase64(tx),
138-
zip32Path
164+
zip32Path,
165+
shieldedHash
139166
);
140-
const signature = toBase64(new Uint8Array([...rbar, ...sbar]));
141-
signatures.push(signature);
167+
168+
responses.forEach(({ sbar, rbar }) => {
169+
const signature = toBase64(new Uint8Array([...rbar, ...sbar]));
170+
signatures.push(signature);
171+
});
142172
},
143173
[]
144174
);
@@ -197,10 +227,12 @@ export const ConfirmSignLedgerTx: React.FC<Props> = ({ details }) => {
197227
if (!accountDetails) {
198228
throw new Error(`Failed to query account details for ${signer}`);
199229
}
230+
const [transparentAccount, shieldedAccount] = accountDetails;
231+
200232
const path = {
201-
account: accountDetails.path.account,
202-
change: accountDetails.path.change || 0,
203-
index: accountDetails.path.index || 0,
233+
account: transparentAccount.path.account,
234+
change: transparentAccount.path.change || 0,
235+
index: transparentAccount.path.index || 0,
204236
};
205237

206238
const pendingTxs = await requester.sendMessage(
@@ -247,7 +279,7 @@ export const ConfirmSignLedgerTx: React.FC<Props> = ({ details }) => {
247279
transferTypes.includes("Unshielding") ||
248280
transferTypes.includes("IbcUnshieldTransfer");
249281

250-
for await (const tx of pendingTxs) {
282+
for await (const { tx, shieldedHash } of pendingTxs) {
251283
if (txCount > 1) {
252284
setStepTwoDescription(
253285
<p>
@@ -259,11 +291,22 @@ export const ConfirmSignLedgerTx: React.FC<Props> = ({ details }) => {
259291
}
260292

261293
if (fromMasp) {
294+
if (!shieldedAccount) {
295+
throw new Error(
296+
`Shielded account details for ${signer} not found!`
297+
);
298+
}
262299
const zip32Path = makeSaplingPath(chains.namada.bip44.coinType, {
263-
account: path.account,
300+
account: shieldedAccount.path.account,
264301
});
265302
// Adds new signature to the collection
266-
await handleMaspSignTx(ledger, tx, zip32Path, maspSignatures);
303+
await handleMaspSignTx(
304+
ledger,
305+
tx,
306+
zip32Path,
307+
maspSignatures,
308+
shieldedHash
309+
);
267310
} else {
268311
const bip44Path = makeBip44Path(chains.namada.bip44.coinType, path);
269312
// Adds new signature to the collection

0 commit comments

Comments
 (0)