@insumermodel/mppx-condition-gate 3.1.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +9 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -268,6 +268,15 @@ if (receipt.reference.startsWith('condition-gate:free:')) {
268
268
  }
269
269
  ```
270
270
 
271
+ The same check applies on the server. mppx reports a free grant through its `payment.success` event (`onPaymentSuccess`), because the gate returns a successful receipt. If you count revenue or log payments from that event, read `receipt.reference` first: a reference starting with `condition-gate:free:` means access was granted and no money moved.
272
+
273
+ ```ts
274
+ mppx.onPaymentSuccess(({ receipt }) => {
275
+ if (receipt.reference.startsWith('condition-gate:free:')) return // free access, nothing settled
276
+ recordPayment(receipt)
277
+ })
278
+ ```
279
+
271
280
  ## When the API is unreachable
272
281
 
273
282
  If the attestation API is unreachable, the adapter falls through to the original payment method. Wallets that would have qualified for free access pay normally; everyone else is unaffected.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insumermodel/mppx-condition-gate",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "Condition-based access for mppx routes. Wallet auth via signed attestations. Six condition types: token balance, NFT ownership, EAS attestation, Farcaster ID, ratio_to_amount, ratio_to_supply.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -49,8 +49,8 @@
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/node": "^25.5.0",
52
- "mppx": "0.9.3",
52
+ "mppx": "0.13.1",
53
53
  "typescript": "^5.7.0",
54
- "viem": "2.56.5"
54
+ "viem": "2.57.2"
55
55
  }
56
56
  }