Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spl-tokens/app/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"@coral-xyz/anchor": "^0.32.1",
"@craco/craco": "^7.1.0",
"@magicblock-labs/ephemeral-rollups-sdk": "^0.10.0",
"@magicblock-labs/ephemeral-rollups-sdk": "0.10.1",
"@solana/wallet-adapter-base": "^0.9.23",
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/wallet-adapter-react-ui": "^0.9.35",
Expand Down
23 changes: 17 additions & 6 deletions spl-tokens/app/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,9 @@ const App: React.FC = () => {
| { minDelayMs: bigint; maxDelayMs: bigint; split: number }
| undefined;
if (usesQueuedPrivateTransfer) {
if (!validator.current) {
throw new Error('Validator not loaded yet for encrypted private transfers');
Comment on lines 726 to +728
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Limit validator gating to base-origin private transfers

This guard is too broad for the privatebase path. transferSpl only requires a validator for the encrypted fromBalance === 'base' route; the fromBalance === 'ephemeral' queue path does not use validator at all. With the current check, an ephemeral→base private transfer now fails whenever validator.current has not been populated yet by the async getIdentity effect (or if that RPC call fails), even though the SDK can build that transfer without a validator.

Useful? React with 👍 / 👎.

}
const minDelayMsNumber = Number(privateMinDelayMs);
const maxDelayMsNumber = Number(privateMaxDelayMs);
const splitCountNumber = Number(privateSplitCount);
Expand Down Expand Up @@ -778,11 +781,15 @@ const App: React.FC = () => {
mint,
shuttleEphemeralAta,
);
// User ATAs
// User ATAslog pu
const srcAta = getAssociatedTokenAddressSync(
mint,
src.keypair.publicKey
);
const dstAta = getAssociatedTokenAddressSync(
mint,
dst.keypair.publicKey
);
console.log("Shuttle wallet ata: ", shuttleWalletAta.toBase58());
console.log("Shuttle eata: ", shuttleEphemeralAta.toBase58());
console.log("Src ata: ", srcAta.toBase58());
Expand Down Expand Up @@ -812,7 +819,11 @@ const App: React.FC = () => {
await conn.confirmTransaction(sig, 'confirmed');
}
setTransactionSuccess(`${usesQueuedPrivateTransfer ? 'Private transfer queued' : 'Transfer confirmed'}: ${sig.substring(0, 10)}...${sig.substring(sig.length - 10, sig.length)}`);
console.log("Transfer: ", sig);
console.log(
"Transfer: ",
sig,
`(from ${src.keypair.publicKey.toBase58()} (sender ata: ${srcAta.toBase58()}), to ${dst.keypair.publicKey.toBase58()} (destination ata: ${dstAta.toBase58()}))`
);
await ephemeralConnection!.current!.getAccountInfo(shuttleWalletAta);
await refreshBalances();
} catch (e: any) {
Expand Down Expand Up @@ -1198,7 +1209,7 @@ const App: React.FC = () => {
mint,
shuttleEphemeralAta,
);
await eConn.getAccountInfo(shuttleWalletAta);
// await eConn.getAccountInfo(shuttleWalletAta);

console.log("Shuttle wallet ata: ", shuttleWalletAta.toBase58());
console.log("Shuttle eata: ", shuttleEphemeralAta.toBase58());
Expand Down Expand Up @@ -1295,9 +1306,9 @@ const App: React.FC = () => {
shuttleEphemeralAta,
);
const [shuttleAta] = deriveShuttleAta(shuttleEphemeralAta, mint);
await eConn.getAccountInfo(shuttleAta);
await eConn.getAccountInfo(shuttleWalletAta);
await eConn.getAccountInfo(shuttleEphemeralAta);
// await eConn.getAccountInfo(shuttleAta);
// await eConn.getAccountInfo(shuttleWalletAta);
// await eConn.getAccountInfo(shuttleEphemeralAta);
console.log("Shuttle wallet ata: ", shuttleWalletAta.toBase58());
console.log("Shuttle eata: ", shuttleEphemeralAta.toBase58());
console.log("Shuttle ata: ", shuttleAta.toBase58());
Expand Down
10 changes: 6 additions & 4 deletions spl-tokens/app/app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1870,11 +1870,13 @@
dependencies:
"@lit-labs/ssr-dom-shim" "^1.5.0"

"@magicblock-labs/ephemeral-rollups-sdk@^0.10.0":
version "0.10.0"
resolved "https://registry.yarnpkg.com/@magicblock-labs/ephemeral-rollups-sdk/-/ephemeral-rollups-sdk-0.10.0.tgz#a4d623ba5d037861e1c6bbeaeb401489f95ecca6"
integrity sha512-tnkDkUr9jpTyRYHp0/pPHRhu+lDEV3aHQj1OnAATib8b3YDKEnqozNBcoZCLIV1PEfwB9yVzCDDwTwfKRuQixw==
"@magicblock-labs/[email protected].1":
version "0.10.1"
resolved "https://registry.yarnpkg.com/@magicblock-labs/ephemeral-rollups-sdk/-/ephemeral-rollups-sdk-0.10.1.tgz#22d28bfe206a934b8ecec3565c39f434122691d1"
integrity sha512-l5zUMapymZidmnhL78DnOLZO9NPsbDzHW3L0XngrqsedbjKNXRv2AMl3E8JDGq82/50UnPz1YFET2M2kiAx5ag==
dependencies:
"@noble/curves" "^1.4.2"
"@noble/hashes" "^1.4.0"
"@phala/dcap-qvl" "^0.3.9"
"@solana/web3.js" "^1.98.0"
bs58 "^6.0.0"
Expand Down
Loading