Skip to content

Commit dba74ad

Browse files
authored
Allow audio swap via sol relay (#12011)
1 parent 8faab37 commit dba74ad

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/discovery-provider/plugins/pedalboard/apps/solana-relay/src/routes/relay/assertRelayAllowedInstructions.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ const assertAllowedAssociatedTokenAccountProgramInstruction = async (
100100
isCreateAssociatedTokenAccountInstruction(decodedInstruction) ||
101101
isCreateAssociatedTokenAccountIdempotentInstruction(decodedInstruction)
102102
) {
103-
const allowedMints = [NATIVE_MINT.toBase58(), usdcMintAddress]
103+
const allowedMints = [
104+
NATIVE_MINT.toBase58(),
105+
usdcMintAddress,
106+
waudioMintAddress
107+
]
104108
const mintAddress = decodedInstruction.keys.mint.pubkey.toBase58()
105109
if (!allowedMints.includes(mintAddress)) {
106110
throw new InvalidRelayInstructionError(
@@ -273,7 +277,11 @@ const JupiterSharedSwapAccountIndex = {
273277
TOKEN_2022_PROGRAM: 10
274278
}
275279
// Only allow swaps from USDC (for withdrawals) or SOL (for userbank purchases)
276-
const allowedSourceMints = [NATIVE_MINT.toBase58(), usdcMintAddress]
280+
const allowedSourceMints = [
281+
NATIVE_MINT.toBase58(),
282+
usdcMintAddress,
283+
waudioMintAddress
284+
]
277285
const allowedDestinationMints = [
278286
NATIVE_MINT.toBase58(),
279287
usdcMintAddress,

0 commit comments

Comments
 (0)