Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Commit bc5e10c

Browse files
committed
feat: add anchor example, update welcome message and acks
1 parent 4ba0abb commit bc5e10c

6 files changed

Lines changed: 87 additions & 48 deletions

File tree

src/components/client/accounts/AirdropButton.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
VStack,
2727
} from "@chakra-ui/react";
2828
import { LAMPORTS_PER_SOL, PublicKey } from "@solana/web3.js";
29-
import { useSessionStoreWithUndo } from "hooks/useSessionStore";
3029
import { useTransactionStatusToast } from "hooks/useTransactionStatusToast";
3130
import { useWeb3Connection } from "hooks/useWeb3Connection";
3231
import React, { useRef, useState } from "react";
@@ -39,7 +38,6 @@ export const AirdropButton: React.FC<{ accountPubkey: IPubKey }> = ({
3938
accountPubkey,
4039
}) => {
4140
const [value, setValue] = useState("1.0");
42-
const rpcEndpoint = useSessionStoreWithUndo((state) => state.rpcEndpoint);
4341
const initialFocusRef = useRef(null);
4442

4543
const connection = useWeb3Connection();

src/components/client/results/Results.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,18 @@ export const Results = forwardRef<
8787

8888
<Spacer />
8989

90-
{endedAt && (
91-
<Tooltip
92-
label={`Last fetched @ ${new Date(endedAt).toLocaleString()}`}
93-
>
94-
<Tag height="20px" variant="outline">
95-
{new Date(endedAt).toLocaleTimeString()}
96-
</Tag>
97-
</Tooltip>
98-
)}
90+
{
91+
// do not display if transaction has been cleared, i.e. no signature
92+
endedAt && transactionRun.signature && (
93+
<Tooltip
94+
label={`Last fetched @ ${new Date(endedAt).toLocaleString()}`}
95+
>
96+
<Tag height="20px" variant="outline">
97+
{new Date(endedAt).toLocaleTimeString()}
98+
</Tag>
99+
</Tooltip>
100+
)
101+
}
99102
{transactionRun.inProgress ? (
100103
<Button
101104
color="red.600"

src/components/header/Examples.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
MenuButton,
66
MenuItem,
77
MenuList,
8+
Text,
89
Tooltip,
910
useToast,
1011
} from "@chakra-ui/react";
@@ -50,8 +51,15 @@ export const Example: React.FC = () => {
5051

5152
toast({
5253
title: "Welcome to Better Call Sol!",
53-
description:
54-
"To get started, you can try one of the options in the Example menu at the top.",
54+
description: (
55+
<Text>
56+
This is a client for composing and sending Solana transactions.
57+
<br />
58+
<br />
59+
To get started, you can try one of the options in the{" "}
60+
<strong>Example</strong> menu at the top.
61+
</Text>
62+
),
5563
status: "info",
5664
duration: 10000,
5765
isClosable: true,
@@ -90,6 +98,13 @@ export const Example: React.FC = () => {
9098
>
9199
System Program: Create Account
92100
</MenuItem>
101+
<MenuItem
102+
onClick={() => {
103+
loadExample("anchorSquads");
104+
}}
105+
>
106+
Anchor: Squads
107+
</MenuItem>
93108
</MenuList>
94109
</Menu>
95110
);

src/components/info/Acknowledgements.tsx

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { Box, Text, VStack } from "@chakra-ui/react";
22

3+
// TODO update this as part of the CI build automatically
4+
35
export const Acknowledgements: React.FC = () => (
46
<VStack spacing="5">
57
<Text>
@@ -18,45 +20,39 @@ export const Acknowledgements: React.FC = () => (
1820
boxShadow="inner"
1921
>
2022
<Text>
21-
@chakra-ui/icons (2.0.4), licenced MIT
23+
@chakra-ui/icons (2.0.14), licenced MIT
2224
<br />
23-
@chakra-ui/react (2.2.4), licenced MIT
25+
@chakra-ui/react (2.4.4), licenced MIT
2426
<br />
25-
@dnd-kit/core (6.0.5), licenced MIT
27+
@dnd-kit/core (6.0.6), licenced MIT
2628
<br />
27-
@dnd-kit/modifiers (6.0.0), licenced MIT
29+
@dnd-kit/modifiers (6.0.1), licenced MIT
2830
<br />
2931
@dnd-kit/sortable (7.0.1), licenced MIT
3032
<br />
31-
@emotion/react (11.9.3), licenced MIT
33+
@emotion/react (11.10.5), licenced MIT
3234
<br />
33-
@emotion/styled (11.9.3), licenced MIT
35+
@emotion/styled (11.10.5), licenced MIT
3436
<br />
3537
@project-serum/anchor (0.25.0), licenced (MIT OR Apache-2.0)
3638
<br />
37-
@sentry/react (7.28.1), licenced MIT
39+
@sentry/react (7.38.0), licenced MIT
3840
<br />
3941
@solana/buffer-layout (4.0.0), licenced MIT
4042
<br />
41-
@solana/wallet-adapter-backpack (0.1.7), licenced Apache-2.0
42-
<br />
43-
@solana/wallet-adapter-base (0.9.17), licenced Apache-2.0
44-
<br />
45-
@solana/wallet-adapter-brave (0.1.11), licenced Apache-2.0
46-
<br />
47-
@solana/wallet-adapter-glow (0.1.12), licenced Apache-2.0
43+
@solana/spl-token (0.3.7), licenced Apache-2.0
4844
<br />
49-
@solana/wallet-adapter-ledger (0.9.19), licenced Apache-2.0
45+
@solana/wallet-adapter-base (0.9.20), licenced Apache-2.0
5046
<br />
51-
@solana/wallet-adapter-phantom (0.9.16), licenced Apache-2.0
47+
@solana/wallet-adapter-brave (0.1.14), licenced Apache-2.0
5248
<br />
53-
@solana/wallet-adapter-react (0.15.19), licenced Apache-2.0
49+
@solana/wallet-adapter-react (0.15.26), licenced Apache-2.0
5450
<br />
55-
@solana/wallet-adapter-react-ui (0.9.17), licenced Apache-2.0
51+
@solana/wallet-adapter-react-ui (0.9.25), licenced Apache-2.0
5652
<br />
57-
@solana/wallet-adapter-solflare (0.6.16), licenced Apache-2.0
53+
@solana/wallet-adapter-solflare (0.6.20), licenced Apache-2.0
5854
<br />
59-
@solana/web3.js (1.63.1), licenced MIT
55+
@solana/web3.js (1.72.0), licenced MIT
6056
<br />
6157
assert (2.0.0), licenced MIT
6258
<br />
@@ -70,35 +66,35 @@ export const Acknowledgements: React.FC = () => (
7066
<br />
7167
crypto-browserify (3.12.0), licenced MIT
7268
<br />
73-
framer-motion (6.3.15), licenced MIT
69+
framer-motion (8.0.1), licenced MIT
7470
<br />
7571
immer (9.0.16), licenced MIT
7672
<br />
7773
js-sha256 (0.9.0), licenced MIT
7874
<br />
7975
jsbi (3.2.5), licenced Apache-2.0
8076
<br />
81-
pako (2.0.4), licenced (MIT AND Zlib)
77+
pako (2.1.0), licenced (MIT AND Zlib)
8278
<br />
8379
process (0.11.10), licenced MIT
8480
<br />
8581
protobufjs (7.1.2), licenced BSD-3-Clause
8682
<br />
8783
react (18.2.0), licenced MIT
8884
<br />
89-
react-aria (3.18.0), licenced Apache-2.0
85+
react-aria (3.22.0), licenced Apache-2.0
9086
<br />
9187
react-dom (18.2.0), licenced MIT
9288
<br />
93-
react-github-btn (1.3.0), licenced BSD-2-Clause
89+
react-github-btn (1.4.0), licenced BSD-2-Clause
9490
<br />
95-
react-icons (3.11.0), licenced MIT
91+
react-icons (4.7.1), licenced MIT
9692
<br />
97-
react-markdown (8.0.3), licenced MIT
93+
react-markdown (8.0.4), licenced MIT
9894
<br />
99-
react-router-dom (6.3.0), licenced MIT
95+
react-router-dom (6.6.0), licenced MIT
10096
<br />
101-
react-stately (3.16.0), licenced Apache-2.0
97+
react-stately (3.20.0), licenced Apache-2.0
10298
<br />
10399
snake-case (3.0.4), licenced MIT
104100
<br />

src/hooks/useTransactionStatusToast.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,7 @@ const TransactionStatusToast: React.FC<
201201
/>
202202
<Box>{description}</Box>
203203
{inProgress && (
204-
<Button
205-
leftIcon={<SmallCloseIcon />}
206-
onClick={cancel}
207-
colorScheme="red"
208-
>
204+
<Button leftIcon={<SmallCloseIcon />} onClick={cancel}>
209205
Cancel
210206
</Button>
211207
)}

src/library/examples.ts

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { ITransactionExt } from "types/external";
22

3-
// TODO add an Anchor example
4-
53
export const EXAMPLES: Record<string, ITransactionExt> = {
64
memoV2Program: {
75
version: "1.0.0",
@@ -164,4 +162,37 @@ _A lamport is 0.000,000,001 SOL._`,
164162
},
165163
],
166164
},
165+
166+
anchorSquads: {
167+
version: "1.0.0",
168+
txnVersion: "0",
169+
network: "devnet",
170+
name: "Anchor: Squads",
171+
description: `If an Anchor program has an on-chain IDL, _Better Call Sol_ can help you invoke it.
172+
173+
For this example, we are using [Squads MPL](https://squads.so/), a popular multisig program. We have pre-populated the program ID for you.
174+
175+
The tool detects the IDL and see shows ⚓ icon in the Program field.
176+
177+
1. Click on this button to get a list of possible instructions to pre-populate.
178+
1. Eject out of Anchor instruction into a plain one by clicking ⏏️ button next to the _Anchor Method_ field.
179+
1. Once you eject, you will see that the tool can also detect an Anchor program instruction. Convert back using the 🔁 button, next to the "Detected Anchor Method".
180+
181+
The latter is particularly useful when you import a transaction from the chain.`,
182+
addressLookupTables: [],
183+
instructions: [
184+
{
185+
name: "Squads",
186+
programId: "SMPLecH534NA9acpos4G6x7uf3LWbCAwZQE9e8ZekMu",
187+
accounts: [],
188+
data: {
189+
format: "raw",
190+
value: {
191+
encoding: "utf8",
192+
content: "",
193+
},
194+
},
195+
},
196+
],
197+
},
167198
};

0 commit comments

Comments
 (0)