@heyamiko/amiko-cli 0.3.2 → 0.3.4
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/dist/index.js +4 -18
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -26707,28 +26707,14 @@ function registerCreditsCommand(program2) {
|
|
|
26707
26707
|
const billingToken = auth.platformKey || auth.privyToken;
|
|
26708
26708
|
if (auth.billingBase && billingToken) {
|
|
26709
26709
|
try {
|
|
26710
|
-
const
|
|
26710
|
+
const res = await fetch(`${auth.billingBase}/api/credits`, {
|
|
26711
26711
|
headers: { Authorization: `Bearer ${billingToken}` }
|
|
26712
26712
|
});
|
|
26713
|
-
if (
|
|
26714
|
-
const
|
|
26715
|
-
|
|
26716
|
-
if (Number.isFinite(remaining)) {
|
|
26717
|
-
balance = remaining;
|
|
26718
|
-
}
|
|
26713
|
+
if (res.ok) {
|
|
26714
|
+
const data = await res.json();
|
|
26715
|
+
balance = data.displayBalance ?? Math.round(Number(data.credits?.balance || 0));
|
|
26719
26716
|
}
|
|
26720
26717
|
} catch {}
|
|
26721
|
-
if (balance === null) {
|
|
26722
|
-
try {
|
|
26723
|
-
const res = await fetch(`${auth.billingBase}/api/credits`, {
|
|
26724
|
-
headers: { Authorization: `Bearer ${billingToken}` }
|
|
26725
|
-
});
|
|
26726
|
-
if (res.ok) {
|
|
26727
|
-
const raw = await res.json();
|
|
26728
|
-
balance = Number(raw.credits?.balance || 0);
|
|
26729
|
-
}
|
|
26730
|
-
} catch {}
|
|
26731
|
-
}
|
|
26732
26718
|
}
|
|
26733
26719
|
spinner2.stop();
|
|
26734
26720
|
if (balance !== null) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heyamiko/amiko-cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "Amiko CLI — manage agents, wallets, credits, and marketplace on the MPP payment rail",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"test": "bun test"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"README.md"
|
|
17
18
|
],
|
|
18
19
|
"keywords": [
|
|
19
20
|
"amiko",
|