From 03cf3fedb45794a9675e5449eadb7bc362a65d14 Mon Sep 17 00:00:00 2001 From: Nacho Iacovino <50103937+nachoiacovino@users.noreply.github.com> Date: Mon, 14 Oct 2024 22:33:19 +0200 Subject: [PATCH] Add eth_balance checkOp (#1235) --- packages/web3/src/entitlement.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/web3/src/entitlement.ts b/packages/web3/src/entitlement.ts index f757da5d4..4e02b986b 100644 --- a/packages/web3/src/entitlement.ts +++ b/packages/web3/src/entitlement.ts @@ -792,9 +792,11 @@ export function createOperationsTree( switch (op.type) { case CheckOperationType.ERC20: case CheckOperationType.ERC721: - case CheckOperationType.ETH_BALANCE: params = encodeThresholdParams({ threshold: op.threshold ?? BigInt(1) }) break + case CheckOperationType.ETH_BALANCE: + params = encodeThresholdParams({ threshold: op.threshold ?? BigInt(0) }) + break case CheckOperationType.ERC1155: params = encodeERC1155Params({ threshold: op.threshold ?? BigInt(1), @@ -857,7 +859,8 @@ export function createDecodedCheckOperationFromTree( }) } else if ( operation.checkType === CheckOperationType.ERC20 || - operation.checkType === CheckOperationType.ERC721 + operation.checkType === CheckOperationType.ERC721 || + operation.checkType === CheckOperationType.ETH_BALANCE ) { const { threshold } = decodeThresholdParams(operation.params) checkOpSubsets.push({