@alleyboss/micropay-solana-x402-paywall 3.1.1 → 3.1.2
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 +0 -19
- package/dist/next/index.cjs +3 -1
- package/dist/next/index.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -120,26 +120,7 @@ const withMicropay = createX402Middleware({
|
|
|
120
120
|
// The library will verify transactions locally using this RPC connection.
|
|
121
121
|
rpcUrl: process.env.NEXT_PUBLIC_RPC_URL
|
|
122
122
|
});
|
|
123
|
-
### 🛡️ Verification Flow (Self-Sovereign Mode)
|
|
124
123
|
|
|
125
|
-
```mermaid
|
|
126
|
-
sequenceDiagram
|
|
127
|
-
participant User
|
|
128
|
-
participant App
|
|
129
|
-
participant Lib as x402 Lib
|
|
130
|
-
participant RPC as Solana RPC
|
|
131
|
-
|
|
132
|
-
User->>App: Request Premium Content
|
|
133
|
-
App->>Lib: Create Payment Options
|
|
134
|
-
Lib-->>User: Return 402 + Payment Link
|
|
135
|
-
User->>RPC: Submit Transaction
|
|
136
|
-
User->>App: Send Receipt/Signature
|
|
137
|
-
App->>Lib: Verify Transaction
|
|
138
|
-
Lib->>RPC: Get Transaction Status (Local)
|
|
139
|
-
RPC-->>Lib: Confirmed
|
|
140
|
-
Lib-->>App: Valid Session Token
|
|
141
|
-
App-->>User: Unlock Content
|
|
142
|
-
```
|
|
143
124
|
|
|
144
125
|
### 🆚 Hosted vs. Self-Sovereign Mode
|
|
145
126
|
|
package/dist/next/index.cjs
CHANGED
|
@@ -69,7 +69,8 @@ var LocalSvmFacilitator = class {
|
|
|
69
69
|
const amountVal = requirements.amount || requirements.maxAmountRequired || "0";
|
|
70
70
|
const requiredAmount = BigInt(amountVal);
|
|
71
71
|
console.log(`[LocalSvmFacilitator] Verifying signature: ${signature}`);
|
|
72
|
-
console.log(`[LocalSvmFacilitator]
|
|
72
|
+
console.log(`[LocalSvmFacilitator] Requirements - Amount: ${requiredAmount}, PayTo: ${payTo}`);
|
|
73
|
+
console.log(`[LocalSvmFacilitator] Full Requirements:`, JSON.stringify(requirements));
|
|
73
74
|
const tx = await this.connection.getParsedTransaction(signature, {
|
|
74
75
|
maxSupportedTransactionVersion: 0,
|
|
75
76
|
commitment: "confirmed"
|
|
@@ -85,6 +86,7 @@ var LocalSvmFacilitator = class {
|
|
|
85
86
|
for (const ix of instructions) {
|
|
86
87
|
if ("program" in ix && ix.program === "system") {
|
|
87
88
|
const parsed = ix.parsed;
|
|
89
|
+
console.log(`[LocalSvmFacilitator] Inspecting IX:`, JSON.stringify(parsed));
|
|
88
90
|
if (parsed.type === "transfer") {
|
|
89
91
|
const info = parsed.info;
|
|
90
92
|
console.log(`[LocalSvmFacilitator] Found transfer: ${info.lamports} lamports to ${info.destination}`);
|
package/dist/next/index.js
CHANGED
|
@@ -68,7 +68,8 @@ var LocalSvmFacilitator = class {
|
|
|
68
68
|
const amountVal = requirements.amount || requirements.maxAmountRequired || "0";
|
|
69
69
|
const requiredAmount = BigInt(amountVal);
|
|
70
70
|
console.log(`[LocalSvmFacilitator] Verifying signature: ${signature}`);
|
|
71
|
-
console.log(`[LocalSvmFacilitator]
|
|
71
|
+
console.log(`[LocalSvmFacilitator] Requirements - Amount: ${requiredAmount}, PayTo: ${payTo}`);
|
|
72
|
+
console.log(`[LocalSvmFacilitator] Full Requirements:`, JSON.stringify(requirements));
|
|
72
73
|
const tx = await this.connection.getParsedTransaction(signature, {
|
|
73
74
|
maxSupportedTransactionVersion: 0,
|
|
74
75
|
commitment: "confirmed"
|
|
@@ -84,6 +85,7 @@ var LocalSvmFacilitator = class {
|
|
|
84
85
|
for (const ix of instructions) {
|
|
85
86
|
if ("program" in ix && ix.program === "system") {
|
|
86
87
|
const parsed = ix.parsed;
|
|
88
|
+
console.log(`[LocalSvmFacilitator] Inspecting IX:`, JSON.stringify(parsed));
|
|
87
89
|
if (parsed.type === "transfer") {
|
|
88
90
|
const info = parsed.info;
|
|
89
91
|
console.log(`[LocalSvmFacilitator] Found transfer: ${info.lamports} lamports to ${info.destination}`);
|
package/package.json
CHANGED