Skip to content

Commit e9d315a

Browse files
authored
Merge pull request #4 from nachopiris/master
General Improvements
2 parents c4d6e91 + 7bc6179 commit e9d315a

Some content is hidden

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

42 files changed

+2235
-662
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ jobs:
2323
- name: Install
2424
run: pnpm install
2525

26+
- name: Lint
27+
run: pnpm lint
28+
29+
- name: Spellcheck
30+
run: pnpm spellcheck
31+
2632
- name: Build
2733
run: pnpm build
2834

cspell.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"version": "0.2",
3+
"language": "en",
4+
"dictionaries": ["typescript", "softwareTerms", "filetypes", "npm", "fonts", "css", "html"],
5+
"ignorePaths": [
6+
"**/node_modules/**",
7+
"pnpm-lock.yaml"
8+
],
9+
"words": ["xsequence", "subdigest", "predecorate", "arrayify", "signhub", "hexlify", "viem", "wagmi", "transactionish", "delphiview", "numberish", "tabler", "keccak", "wordlists", "connectkit", "ipfs", "godmode"]
10+
}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "tsc && vite build",
9-
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
9+
"lint": "eslint .",
10+
"spellcheck": "cspell '**'",
1011
"preview": "vite preview"
1112
},
1213
"dependencies": {
1314
"@0xsequence/account": "^1.9.13",
1415
"@0xsequence/core": "^1.9.13",
15-
"@0xsequence/signhub": "^1.9.13",
16+
"@0xsequence/indexer": "^2.0.4",
1617
"@0xsequence/network": "^1.9.13",
1718
"@0xsequence/sessions": "^1.9.13",
19+
"@0xsequence/signhub": "^1.9.13",
1820
"@mantine/core": "^7.7.1",
1921
"@mantine/form": "^7.7.1",
2022
"@mantine/hooks": "^7.7.1",
@@ -37,6 +39,7 @@
3739
"@typescript-eslint/eslint-plugin": "^7.2.0",
3840
"@typescript-eslint/parser": "^7.2.0",
3941
"@vitejs/plugin-react-swc": "^3.5.0",
42+
"cspell": "^8.14.2",
4043
"eslint": "^8.57.0",
4144
"eslint-plugin-react-hooks": "^4.6.0",
4245
"eslint-plugin-react-refresh": "^0.4.6",

pnpm-lock.yaml

Lines changed: 718 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import { ConnectKitButton } from 'connectkit';
1313
import { Transaction } from './sections/Transaction';
1414
import { Message } from './sections/Message';
1515
import { Transactions } from './sections/Transactions';
16-
import { useImport } from './sections/Import';
16+
import { useImport } from './hooks/Import';
1717
import { ImportWallet } from './sections/ImportWallet';
1818
import { useWallets } from './stores/db/Wallets';
1919
import { Update } from './sections/Update';
2020
import { Updates } from './sections/Updates';
2121
import { UpdateDetail } from './sections/UpdateDetail';
2222
import { Messages } from './sections/Messages';
2323

24-
declare var __COMMIT_HASH__: string
24+
declare const __COMMIT_HASH__: string
2525

2626
export function App() {
2727
const importModal = useImport()
@@ -84,7 +84,9 @@ export function App() {
8484
<Divider />
8585
<NativeSelect
8686
description="Selected wallet"
87-
data={['Select wallet', ...wallets.map(w => w.address)]}
87+
data={['Select wallet', ...wallets.map(w => {
88+
return {label: `${w.name} (${w.address})`, value: w.address}
89+
})]}
8890
mt="md"
8991
mb="md"
9092
onChange={(event) => {

src/Names.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ export const nameForAddress = (address: string): string => {
1212
}
1313

1414
export const nameGenerator = (seed: string, length: number): string => {
15-
const wordlistSize = 2048
15+
const wordListSize = 2048
1616
const words = ethers.wordlists.en
1717

1818
let output = ''
1919
let subSeed = ethers.utils.keccak256(seed)
2020
for (let i = 0; i < length; i++) {
21-
const index = ethers.BigNumber.from(subSeed).mod(wordlistSize).toNumber()
21+
const index = ethers.BigNumber.from(subSeed).mod(wordListSize).toNumber()
2222
output = `${words.getWord(index)} ${output}`
2323
subSeed = ethers.utils.keccak256(subSeed)
2424
}

src/Utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function parseFunctionSelector(selector: string): ParsedFunctionSelector
6767
}
6868

6969
for (const input of res.inputs) {
70-
if (!/^(address|uint\d+|int\d+|bool|bytes\d*|string)$/.test(input.type)) {
70+
if (!/^(address|uint\d+|int\d+|bool|bytes\d*|string|uint256\[\])$/.test(input.type)) {
7171
throw new Error('Invalid type: ' + input.type)
7272
}
7373
}

src/components/Actions.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
import { Text, Table, Box } from "@mantine/core";
22
import { TransactionsEntry } from "../stores/db/Transactions";
33

4-
export function Actions(props: { transaction: TransactionsEntry}) {
4+
export function Actions(props: { transaction: TransactionsEntry }) {
55
const rows = props.transaction.transactions.map((element, i) => (
66
<Table.Tr key={i} style={{ verticalAlign: "text-top" }}>
77
<Table.Td>{element.to}</Table.Td>
88
<Table.Td>{element.value || "0"}</Table.Td>
99
<Table.Td>
1010
<Box>
11-
<Text style={{ lineBreak: "anywhere"}}>
12-
<p>
13-
{element.data || "0x"}
14-
</p>
15-
</Text>
11+
<Text style={{ lineBreak: "anywhere" }}>{element.data || "0x"}</Text>
1612
</Box>
1713
</Table.Td>
18-
<Table.Td>{element.gasLimit || element.revertOnError ? "Auto" : "0"}</Table.Td>
14+
<Table.Td>
15+
{element.gasLimit || element.revertOnError ? "Auto" : "0"}
16+
</Table.Td>
1917
<Table.Td>{element.revertOnError ? "Yes" : "No"}</Table.Td>
20-
<Table.Td>{element.delegateCall ? "Yes" : "No"}</Table.Td>
18+
<Table.Td>{element.delegateCall ? "Yes" : "No"}</Table.Td>
2119
</Table.Tr>
22-
))
20+
));
2321

2422
return (
2523
<Table>
@@ -35,5 +33,5 @@ export function Actions(props: { transaction: TransactionsEntry}) {
3533
</Table.Thead>
3634
<Table.Tbody>{rows}</Table.Tbody>
3735
</Table>
38-
)
36+
);
3937
}

src/components/ActionsDecoded.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function ActionArguments(props: { action: FlatTransaction, signature: Fun
2727
return <>
2828
{decoded && <Box>
2929
{decoded.args?.map((input, i) => <Box key={i}>
30-
- <b>{parsed?.inputs[i]?.name || i.toString()}</b>: {(input as any).toString()}
30+
- <b>{parsed?.inputs[i]?.name || i.toString()}</b>: {String(input)}
3131
</Box>)}
3232
</Box>}
3333
{error && <Box>
@@ -132,7 +132,7 @@ export function ActionsDecoded(props: { transaction: TransactionsEntry, state: {
132132

133133
return <>
134134
<Space h="md" />
135-
{transaction.transactions.map((action, i) => <Box>
135+
{transaction.transactions.map((action, i) => <Box key={i}>
136136
<Title order={6}>Action #{i}</Title>
137137
<ActionDecode key={i} action={action} state={state} />
138138
</Box>

src/components/MiniCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export function MiniCard(args: {
1313
try {
1414
await navigator.clipboard.writeText(args.value);
1515
notifications.show({
16-
title: "Text copied",
17-
message: "Text successfully copied to clipboard",
16+
title: `${args.title} copied`,
17+
message: `${args.title} successfully copied to clipboard`,
1818
color: "green",
1919
});
2020
} catch (error) {

src/components/SignerEditor.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ export type SignerEditorEntry = {
1010

1111
export type SignerEditorProps<T> = {
1212
form: UseFormReturnType<T>,
13-
formKey: string
13+
formKey: "signers"
14+
}
15+
16+
export type FormValues = {
17+
signers: SignerEditorEntry[],
1418
}
1519

1620
export function SignerEditorValidator() {
@@ -38,7 +42,7 @@ export function SignerEditorValidator() {
3842

3943
export function SignerEditor<T>(props: SignerEditorProps<T>) {
4044
const { form, formKey } = props
41-
const values = form.values as any
45+
const values = form.values as FormValues
4246

4347
return <>
4448
{ (values[formKey] as SignerEditorEntry[]).map((_, index) => (

0 commit comments

Comments
 (0)