nirium-pollar-adapter 0.6.3 → 0.6.5
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.
- package/README.md +32 -2
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
[](https://github.com/nirium-protocol/nirium-pollar-adapter/actions/workflows/security-gate.yml)
|
|
5
5
|
[](https://www.npmjs.com/package/nirium-pollar-adapter)
|
|
6
6
|
|
|
7
|
-
Nirium adapter for the [Pollar](https://pollar.xyz) SDK. It lets the wallet a user onboarded through Pollar pay for APIs (x402) and anchor tamper-
|
|
7
|
+
Nirium adapter for the [Pollar](https://pollar.xyz) SDK. It lets the wallet a user onboarded through Pollar pay for APIs (x402) and anchor tamper-evident records to IPFS, without your app touching keys or learning the x402 protocol.
|
|
8
8
|
|
|
9
|
-
Two things matter most here: **x402** pays per request, and `anchorOnTransactionSuccess()` (see [API](#api) below) anchors an Audit Trail receipt to IPFS for every Pollar transaction that reaches `success
|
|
9
|
+
Two things matter most here: **x402** pays per request, and `anchorOnTransactionSuccess()` (see [API](#api) below) anchors an Audit Trail receipt to IPFS for every Pollar transaction that reaches `success`. The payment itself is already on the ledger; the receipt is worth more when you bind it to your own order or request record (see [`anchorOnTransactionSuccess`](#anchorontransactionsuccesspollarclient-adapter-options) below).
|
|
10
|
+
|
|
11
|
+
**What a receipt adds over the ledger:** a Stellar payment is already public, so a receipt that only repeats payer, payee and amount proves nothing new; link the transaction instead. Receipts are for what the ledger doesn't hold: policy decisions (including refused payments that were never signed), what a payment was for, off-chain records, and who declared them. More in the [design FAQ](https://github.com/nirium-protocol/nirium/blob/main/docs/DESIGN-FAQ.md).
|
|
10
12
|
|
|
11
13
|
Both surfaces are **software-only and non-custodial**, and both are **live on Stellar mainnet**: the last x402 payment settled on [29 Sep 2026](https://stellar.expert/explorer/public/tx/b34630f6637d6773ad4f7378dac8690ae6d1809173ff9c9541d22165aeef5788) (a real USDC transfer on mainnet), and the last Audit Trail anchor is from 12 Nov 2026, checked live against the mainnet agent's `GET /api/reporting/summary?network=mainnet` at the time of writing (`anchors.lastAnchoredAt`).
|
|
12
14
|
|
|
@@ -16,6 +18,32 @@ Wraps [`nirium`](https://github.com/nirium-protocol/nirium), the TypeScript/Pyth
|
|
|
16
18
|
|
|
17
19
|
**Try it in a browser:** [nirium-pollar-x402-demo.vercel.app](https://nirium-pollar-x402-demo.vercel.app) (testnet): log in with Pollar, pay 0.05 test USDC, open the receipt at nirium.xyz/verify.
|
|
18
20
|
|
|
21
|
+
## How it works
|
|
22
|
+
|
|
23
|
+
The user logs in with email or Google, the Pollar wallet signs, the facilitator pays the network fee, and the app gets a receipt anyone can verify.
|
|
24
|
+
|
|
25
|
+
```mermaid
|
|
26
|
+
sequenceDiagram
|
|
27
|
+
autonumber
|
|
28
|
+
participant U as User<br/>(email or Google login)
|
|
29
|
+
participant W as Pollar wallet
|
|
30
|
+
participant A as Your app<br/>+ nirium-pollar-adapter
|
|
31
|
+
participant S as Paid API (x402)
|
|
32
|
+
participant F as x402 facilitator
|
|
33
|
+
participant N as Nirium Audit Trail
|
|
34
|
+
U->>A: logs in with Pollar
|
|
35
|
+
A->>S: request
|
|
36
|
+
S-->>A: 402, price in USDC
|
|
37
|
+
A->>W: signAuthEntry (adapter translates SEP-43 to Pollar)
|
|
38
|
+
W-->>A: signed auth entry, the key stays in the wallet
|
|
39
|
+
A->>S: retry with the payment
|
|
40
|
+
S->>F: settle, facilitator pays the fee (user holds 0 XLM)
|
|
41
|
+
S-->>A: 200 + the data
|
|
42
|
+
A->>N: anchorOnTransactionSuccess()
|
|
43
|
+
N-->>A: receipt CID, anyone can verify it
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
|
|
19
47
|
## Install
|
|
20
48
|
|
|
21
49
|
```bash
|
|
@@ -223,6 +251,8 @@ const stop = anchorOnTransactionSuccess(pollar, adapter, {
|
|
|
223
251
|
|
|
224
252
|
The receipt carries only `chain`, `network`, `hash` and `observedAt` (no app id), because what goes into IPFS is not deleted. Pollar replays the current state when you subscribe, so the function deduplicates by hash inside the process. It does not deduplicate across restarts: the same hash can be anchored twice. A failed anchor goes to `onError` and never throws into Pollar's listener; the hash can be retried when Pollar sends it again. Options: `chain` (default `"stellar"`), `tag` (default `"pollar-tx"`), `onError`.
|
|
225
253
|
|
|
254
|
+
**What this receipt adds:** the transaction itself is already on the ledger, so this record only shows that your app observed it, at the time its own clock gave. To make a receipt worth more than the ledger, bind the transaction to something only you hold: call `adapter.anchorAuditRecord()` yourself with the hash of your order or request ID next to `txHash`.
|
|
255
|
+
|
|
226
256
|
Checked against `@pollar/core` 0.11.4 and 0.12.0 in CI.
|
|
227
257
|
|
|
228
258
|
**Live check, 2026-11-01, testnet.** `examples/spike-19/anchor-on-success.mjs` logs in to a Pollar testnet app, sends 1 XLM through `pollar.sendPayment`, and anchors the receipt. Transaction [`95717202...b7b`](https://horizon-testnet.stellar.org/transactions/95717202be514ed0ae6d59d88c5950d79ff94b40dad709a430691ad6c4449b7b) (successful, ledger 5506358, 1 payment op) produced Audit Trail receipt [`QmboKKkuwck3zvRx2bqnzUdDFkrEtc1VUHo6rrzm9nyBtD`](https://gateway.pinata.cloud/ipfs/QmboKKkuwck3zvRx2bqnzUdDFkrEtc1VUHo6rrzm9nyBtD). The record holds only `chain`, `network`, `hash` and `observedAt`, and `content_sha256` equals the sha-256 of that record as sent. This is a Nirium self-test on testnet, not third-party use.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nirium-pollar-adapter",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.6.5",
|
|
4
|
+
"description": "Let Pollar users who sign in with email or Google pay per request (x402) on Stellar and get a receipt anyone can verify. The facilitator sponsors network fees.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -38,12 +38,16 @@
|
|
|
38
38
|
"typescript": "^5.7.0"
|
|
39
39
|
},
|
|
40
40
|
"keywords": [
|
|
41
|
-
"nirium",
|
|
42
|
-
"pollar",
|
|
43
41
|
"stellar",
|
|
44
|
-
"soroban",
|
|
45
42
|
"x402",
|
|
46
|
-
"
|
|
43
|
+
"usdc",
|
|
44
|
+
"payments",
|
|
45
|
+
"pay-per-request",
|
|
46
|
+
"ai-agents",
|
|
47
|
+
"agentic-payments",
|
|
48
|
+
"receipts",
|
|
49
|
+
"audit-trail",
|
|
50
|
+
"pollar"
|
|
47
51
|
],
|
|
48
52
|
"homepage": "https://nirium.xyz",
|
|
49
53
|
"repository": {
|