@heyamiko/amiko-cli 0.5.11 → 0.5.12
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 +11 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -75660,14 +75660,15 @@ function registerSwapCommand(program2) {
|
|
|
75660
75660
|
try {
|
|
75661
75661
|
const config2 = loadConfig();
|
|
75662
75662
|
const auth = resolveAuth(config2);
|
|
75663
|
-
|
|
75664
|
-
|
|
75665
|
-
if (!wallet) {
|
|
75666
|
-
console.error(error("No Solana wallet found. Provide --wallet or run: amiko connect"));
|
|
75663
|
+
if (auth.mode === "none") {
|
|
75664
|
+
console.error(error("Not connected. Set up .amiko.json or run: amiko connect"));
|
|
75667
75665
|
process.exit(1);
|
|
75668
75666
|
}
|
|
75669
|
-
|
|
75670
|
-
|
|
75667
|
+
const allWallets = auth.agentWallets || config2.agentWallets || [];
|
|
75668
|
+
const solanaAgentWallet = allWallets.find((w5) => w5.chain === "solana")?.address;
|
|
75669
|
+
const wallet = opts.wallet || config2.wallet || solanaAgentWallet;
|
|
75670
|
+
if (!wallet) {
|
|
75671
|
+
console.error(error("No Solana wallet found. Provide --wallet <address>"));
|
|
75671
75672
|
process.exit(1);
|
|
75672
75673
|
}
|
|
75673
75674
|
const input = resolveToken(fromToken);
|
|
@@ -75709,11 +75710,11 @@ function registerSwapCommand(program2) {
|
|
|
75709
75710
|
}
|
|
75710
75711
|
}
|
|
75711
75712
|
const swapSpinner = ora("Executing swap via Crossmint...").start();
|
|
75712
|
-
const billingToken = auth.platformKey || auth.privyToken;
|
|
75713
|
-
const billingBase2 = auth.billingBase;
|
|
75714
|
-
if (!
|
|
75713
|
+
const billingToken = auth.platformKey || auth.twinToken || auth.privyToken;
|
|
75714
|
+
const billingBase2 = auth.billingBase || "https://billing.heyamiko.com";
|
|
75715
|
+
if (!billingToken) {
|
|
75715
75716
|
swapSpinner.stop();
|
|
75716
|
-
console.error(error("No
|
|
75717
|
+
console.error(error("No auth token available for swap"));
|
|
75717
75718
|
process.exit(1);
|
|
75718
75719
|
}
|
|
75719
75720
|
const swapRes = await fetch(`${billingBase2}/api/crossmint/wallets/${encodeURIComponent(wallet)}/swap`, {
|