Feature: Implemented Secure Merchant Vault Architecture with On-chain segregation and Encryption
This commit is contained in:
@@ -52,7 +52,18 @@ export async function POST(request: Request) {
|
||||
|
||||
// 4. Define Merchant Address (Fetch from transaction's merchant)
|
||||
const merchantResult = await db.query('SELECT * FROM merchants WHERE id = $1', [transaction.merchant_id]);
|
||||
const merchantAddress = merchantResult.rows[0]?.wallet_address || platformAddress;
|
||||
const merchant = merchantResult.rows[0];
|
||||
|
||||
let merchantAddress = merchant?.wallet_address || platformAddress;
|
||||
|
||||
// Use merchant's specific vault if available
|
||||
if (selectedNetwork === 'SOLANA') {
|
||||
if (merchant?.sol_vault_address) merchantAddress = merchant.sol_vault_address;
|
||||
} else {
|
||||
if (merchant?.evm_vault_address) merchantAddress = merchant.evm_vault_address;
|
||||
}
|
||||
|
||||
console.log(`[Sweep] Destination for merchant: ${merchantAddress}`);
|
||||
|
||||
// 5. Initialize Engine and Verify Payment first
|
||||
const cryptoEngine = new CryptoEngine(selectedNetwork);
|
||||
|
||||
Reference in New Issue
Block a user