IntentGuard SDK
    Preparing search index...

    Function computeIntentHash

    • Compute an intent hash using SHA-256.

      The hash input is app-defined — pass whatever parameters the target dApp needs to bind. The only requirement is that both the commit side (mobile/CLI) and the verify side (browser/dApp) use the same inputs.

      Parameters

      • buffers: Buffer[]

      Returns number[]

      // For a swap intent:
      const hash = computeIntentHash([
      jupiterProgramId.toBuffer(),
      userWallet.toBuffer(),
      inputMint.toBuffer(),
      outputMint.toBuffer(),
      amountIn.toArrayLike(Buffer, 'le', 8),
      minAmountOut.toArrayLike(Buffer, 'le', 8),
      ]);