Opening Intents

Open a private intent

EVM -> Aztec

Check the full codearrow-up-right

Open Order on EVM chain

Create a new OrderData objectarrow-up-right with the intent data:

const orderData = new OrderData({
    sender: USER_ADDRESS,
    recipient: SECRET_HASH,
    inputToken: TOKEN_ON_EVM,
    outputToken: TOKEN_ON_AZTEC,
    amountIn: AMOUNT_IN,
    amountOut: AMOUNT_OUT,
    senderNonce: INTENT_NONCE,
    originDomain: L2_EVM_GATEWAY_7683_DOMAIN,
    destinationDomain: AZTEC_7683_DOMAIN,
    destinationSettler: GATEWAY_ON_AZTEC,
    fillDeadline: FILL_DEADLINE,
    orderType: PRIVATE_ORDER=1,
    data: DATA = padHex("0x00"),
})

The SECRET_HASH is a Poseidon2Hash of a chosen secret word. It can be achieved using import { poseidon2Hash } from "@aztec/foundation/crypto"

Open Intent on L2_EVM chain:

with: ORDER_DATA_TYPE = 0xf00c3bf60c73eb97097f1c9835537da014e0b755fe94b25d7ac8401df66716a0

Claim private on Aztec:

Claim funds on aztec using aztec.jsarrow-up-right calling claim_privatearrow-up-right on the aztec gateway:

Aztec -> EVM

Check the full codearrow-up-right

Open Order on Aztec

Create a new OrderData objectarrow-up-right with the intent data:

The SECRET_HASH is a Poseidon2Hash of a chosen secret word. It can be achieved using import { poseidon2Hash } from "@aztec/foundation/crypto"

Open the intent using aztec.jsarrow-up-right:

with ORDER_DATA_TYPE = 0xf00c3bf60c73eb97097f1c9835537da014e0b755fe94b25d7ac8401df66716a0

Last updated