Skip to content

Commit

Permalink
Add eth_balance checkOp (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoiacovino authored Oct 14, 2024
1 parent 99811fb commit 03cf3fe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/web3/src/entitlement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 03cf3fe

Please sign in to comment.