Commit bffe729
fix(allow-block-list-token): address review feedback on kit migration
- remove_wallet.rs: declare ab_wallet's PDA seeds (seeds = [AB_WALLET_SEED,
wallet.key()]) instead of requiring the caller to pre-derive and pass the
PDA directly, so getRemoveWalletInstructionAsync({ authority, wallet })
resolves it the same way getInitWalletInstructionAsync already does.
Also aligns config's seeds with the CONFIG_SEED constant, matching
init_wallet.rs. Regenerated the IDL/client and simplified the two
frontend callers (removeWallet, processBatchWallets) accordingly.
- Bump @solana/kit and @solana/program-client-core to ^7.1.0 (both the
app's own deps and the generated client's peerDependencies, via a new
dependencyVersions option on the codama renderVisitor call) and
@solana-program/token-2022 to ^0.15.0.
- cluster-data-access.tsx: drop useClusterRpc/deriveWebsocketUrl in favor
of @solana/connector's useSolanaClient across every consumer, and fix
addCluster's endpoint validation, which silently accepted any string -
createSolanaRpc doesn't parse its endpoint eagerly despite a comment
claiming otherwise. new URL(endpoint) is the actual check.
- use-send-instruction.ts: adopt @solana/connector's useTransactionPreparer
for blockhash + simulation-derived compute unit limit, sourcing
rpc/rpcSubscriptions for the send-and-confirm step from useSolanaClient
instead of the removed custom hook. (client.sendAndConfirmTransaction,
suggested in review, doesn't actually exist in the installed - and
latest published - @solana/connector@0.2.6, despite one JSDoc example;
kept sendAndConfirmTransactionFactory from kit for that step.)
- account-data-access.tsx: useSendTokens now resolves the transfer-hook's
extra accounts via @solana-program/token-2022's
getTransferCheckedWithTransferHookInstructionAsync (reads the mint's
on-chain extra-account-metas list) instead of hardcoding this program's
ab_wallet PDA convention client-side. useRequestAirdrop now uses kit's
airdropFactory, which confirms the airdrop instead of returning
immediately after requesting it. useTransferSol now checks
signer.address against the viewed account instead of silently signing
with a possibly-different connected wallet than the page's address.
(useGetBalance/useGetTokenAccounts/useGetSignatures stay on a
cluster-scoped RPC call, not connector's useBalance/useTokens/
useTransactions - those hooks are scoped to the connected wallet only
and don't take an address, so they can't back the generic
/account/[address] page, which needs to read arbitrary addresses.)
- abl-token-data-access.tsx: fixed transferHookAuthority being set to
mintAuthority instead of the form's own transferHookAuthority field (a
legacy bug predating this migration). mintTo now uses
getMintToATAInstructionPlanAsync + flattenInstructionPlan instead of
manually assembling the create-ATA and mint-to instructions.
- Added anchor/tests/basic.test.ts: LiteSVM-backed tests exercising the
generated Kit client directly (init_config, init_wallet, the new
seeds-based remove_wallet, and an authority-mismatch rejection case).
This project's `anchor test` has no local-validator step to test
against - its Anchor.toml [scripts] test command fully replaces
Anchor's normal build+validator+deploy flow - so a real RPC connection
isn't available; LiteSVM gives the TS client something real to run
against without one. The old placeholder test never actually exercised
anything.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 4636ecd commit bffe729
13 files changed
Lines changed: 461 additions & 211 deletions
File tree
- tokens/token-2022/transfer-hook/allow-block-list-token
- anchor
- programs/abl-token/src/instructions
- tests
- idl
- scripts
- src
- components
- abl-token
- account
- cluster
- generated
- instructions
- hooks
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
Lines changed: 134 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
4 | 24 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
8 | 33 | | |
9 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
10 | 37 | | |
11 | | - | |
12 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
13 | 138 | | |
14 | 139 | | |
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
367 | 370 | | |
368 | 371 | | |
369 | | - | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
370 | 395 | | |
371 | 396 | | |
372 | 397 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
0 commit comments