moltspay 0.9.6 → 0.9.7
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 +68 -45
- package/dist/cli/index.js +23 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +23 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/index.js +11 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +11 -1
- package/dist/client/index.mjs.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -31753,7 +31753,17 @@ var MoltsPayClient = class {
|
|
|
31753
31753
|
throw new Error(`Insufficient balance: need $${amount}, have ${balances.usdc} USDC / ${balances.usdt} USDT`);
|
|
31754
31754
|
}
|
|
31755
31755
|
}
|
|
31756
|
-
|
|
31756
|
+
if (token === "USDT") {
|
|
31757
|
+
const balances = await this.getBalance();
|
|
31758
|
+
if (balances.native < 1e-4) {
|
|
31759
|
+
throw new Error(
|
|
31760
|
+
`USDT requires ETH for gas (~$0.01 on Base). Your ETH balance: ${balances.native.toFixed(6)} ETH. Please add a small amount of ETH to your wallet, or use USDC (gasless).`
|
|
31761
|
+
);
|
|
31762
|
+
}
|
|
31763
|
+
console.log(`[MoltsPay] \u26A0\uFE0F USDT requires gas (~$0.01). Proceeding with payment...`);
|
|
31764
|
+
} else {
|
|
31765
|
+
console.log(`[MoltsPay] Signing payment: $${amount} ${token} (gasless)`);
|
|
31766
|
+
}
|
|
31757
31767
|
const payTo = req.payTo || req.resource;
|
|
31758
31768
|
if (!payTo) {
|
|
31759
31769
|
throw new Error("Missing payTo address in payment requirements");
|