const instruction = await client.instructions.submit({
templateSlug: "cross_platform_dvp",
role: "seller",
party: {
externalReference: "KSFI-II-4401",
name: "Securitize Fund I",
walletAddress: "0x1234567890abcdef1234567890abcdef12345678",
},
legs: [
{
legType: "asset_delivery",
instrumentId: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
quantity: "12000000",
direction: "deliver", // seller delivers the asset
chainId: 11155111,
},
{
legType: "payment",
instrumentId: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
quantity: "12120000000000",
direction: "receive", // seller receives payment
chainId: 11155111,
},
],
timeoutAt: new Date(Date.now() + 86400000).toISOString(),
idempotencyKey: client.generateIdempotencyKey(),
});
console.log(instruction.tradeReference); // "KS-abc12345"
console.log(instruction.status); // "pending_match" or "matched"
console.log(instruction.settlementId); // UUID if matched, null if pending