@ixo/asks-mcp 2.0.1 → 2.1.0

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.
Files changed (2) hide show
  1. package/dist/asks-mcp.mjs +45 -4
  2. package/package.json +1 -1
package/dist/asks-mcp.mjs CHANGED
@@ -266881,7 +266881,7 @@ var init_takeBack = __esm({
266881
266881
 
266882
266882
  // ../../app/lib/cashout/words.ts
266883
266883
  function waysFor(list7, country) {
266884
- const shown2 = list7.filter((one) => one.reason !== "not_in_country");
266884
+ const shown2 = list7;
266885
266885
  const fits = STRIPE_COUNTRIES.has(country) ? "stripe_bank" : "yellowcard_bank";
266886
266886
  const bank = shown2.filter((one) => one.method.endsWith("_bank")).sort((a, b) => Number(b.enabled !== false) - Number(a.enabled !== false) || Number(b.method === fits) - Number(a.method === fits))[0];
266887
266887
  return shown2.filter((one) => !one.method.endsWith("_bank") || one === bank);
@@ -266894,6 +266894,36 @@ var init_words = __esm({
266894
266894
  }
266895
266895
  });
266896
266896
 
266897
+ // ../../app/lib/payee.ts
266898
+ var init_payee = __esm({
266899
+ "../../app/lib/payee.ts"() {
266900
+ "use strict";
266901
+ }
266902
+ });
266903
+
266904
+ // ../../app/lib/cashout/client.ts
266905
+ var init_client2 = __esm({
266906
+ "../../app/lib/cashout/client.ts"() {
266907
+ "use strict";
266908
+ init_payee();
266909
+ }
266910
+ });
266911
+
266912
+ // ../../app/lib/cashout/yellowcard.ts
266913
+ async function ycRate(url4, country, fetchImpl = (input, init) => fetch(input, init)) {
266914
+ const response = await fetchImpl(`${url4.replace(/\/+$/, "")}/countries?ramp=offramp&limits=true`).catch(() => null);
266915
+ if (!response?.ok) return null;
266916
+ const body = await response.json().catch(() => null);
266917
+ const one = body?.limits?.[country.toUpperCase()];
266918
+ return one?.currency && typeof one.rate === "number" && one.rate > 0 ? { currency: one.currency, rate: one.rate } : null;
266919
+ }
266920
+ var init_yellowcard = __esm({
266921
+ "../../app/lib/cashout/yellowcard.ts"() {
266922
+ "use strict";
266923
+ init_client2();
266924
+ }
266925
+ });
266926
+
266897
266927
  // src/cashout.ts
266898
266928
  var cashout_exports = {};
266899
266929
  __export(cashout_exports, {
@@ -266902,8 +266932,7 @@ __export(cashout_exports, {
266902
266932
  identityLine: () => identityLine
266903
266933
  });
266904
266934
  function whyOff(one) {
266905
- if (one.enabled === false) return one.reason === "coming_soon" ? "coming soon" : "busy right now, try later";
266906
- if (one.provider === "yellowcard-worker" || one.method.startsWith("yellowcard")) return "coming soon";
266935
+ if (one.enabled === false) return one.reason === "coming_soon" ? "coming soon" : one.reason === "not_in_country" ? "not in this country" : "busy right now, try later";
266907
266936
  return null;
266908
266937
  }
266909
266938
  async function call2(deps, path, body) {
@@ -266965,6 +266994,7 @@ async function cashOut(deps, input) {
266965
266994
  if (chosen2.maxUsd && Number(amount3) > Number(chosen2.maxUsd)) return `The largest you can cash out this way is $${chosen2.maxUsd}.`;
266966
266995
  const to = input.to?.trim();
266967
266996
  if (chosen2.fields.includes("address") && !(to && BASE_ADDRESS.test(to))) return "Which Base account should receive it? (Its address starts with 0x; then call cash_out with to.)";
266997
+ if (chosen2.method.startsWith("yellowcard")) return yellowCard(deps, chosen2, country, amount3, input.confirm === true);
266968
266998
  const quote = await signedCall(deps, "quote", { method: chosen2.method, country, amountUsd: amount3 });
266969
266999
  if (quote.status !== 201) return said3(quote);
266970
267000
  const q = quote.body;
@@ -266979,6 +267009,16 @@ async function cashOut(deps, input) {
266979
267009
  if (to) link5.searchParams.set("to", to);
266980
267010
  return [receive, named, `Open this and tap Confirm: ${link5.toString()}`, "Your money leaves only when you confirm there. I sent nothing. (Later, cash_out_status with the id that page shows says where it stands.)"].filter(Boolean).join("\n");
266981
267011
  }
267012
+ async function yellowCard(deps, chosen2, country, amount3, confirm) {
267013
+ const rate = chosen2.flow?.url ? await ycRate(chosen2.flow.url, country, deps.fetch) : null;
267014
+ const about = rate ? `You'll receive about ${rate.currency} ${(Number(amount3) * rate.rate).toFixed(2)}, before Yellow Card's fee (the page shows the exact amount).` : "The page shows what you'll receive in your own money.";
267015
+ if (!confirm) return [`Cash out $${amount3}: ${WAYS[chosen2.method]}.`, about, NAME_LINE, "Nothing is sent yet. To go ahead, call cash_out again with the same answers and confirm: true."].join("\n");
267016
+ const link5 = new URL(`${deps.site.replace(/\/+$/, "")}/me/cash-out`);
267017
+ link5.searchParams.set("method", chosen2.method);
267018
+ link5.searchParams.set("amount", amount3);
267019
+ link5.searchParams.set("country", country);
267020
+ return [about, NAME_LINE, `Open this, pick your ${chosen2.method === "yellowcard_momo" ? "mobile money network and number" : "bank and account number"}, see your quote and tap Confirm: ${link5.toString()}`, "Your money leaves only when you confirm there. I sent nothing."].join("\n");
267021
+ }
266982
267022
  async function cashOutStatus(deps, id) {
266983
267023
  const answer = await signedCall(deps, "status", { id });
266984
267024
  if (answer.status === 404) return `No cash-out "${id}" for you on this network.`;
@@ -267020,6 +267060,7 @@ var init_cashout = __esm({
267020
267060
  init_accountProof();
267021
267061
  init_inviteProof();
267022
267062
  init_words();
267063
+ init_yellowcard();
267023
267064
  WAYS = {
267024
267065
  stripe_bank: "To your bank account (through Stripe)",
267025
267066
  yellowcard_bank: "To your bank account (through Yellow Card)",
@@ -292396,7 +292437,7 @@ import { randomBytes as randomBytes7 } from "node:crypto";
292396
292437
  // package.json
292397
292438
  var package_default = {
292398
292439
  name: "@ixo/asks-mcp",
292399
- version: "2.0.1",
292440
+ version: "2.1.0",
292400
292441
  description: "The Openhands Network MCP server: read the board, answer asks, post work and get paid on the ixo chain, with a key of its own on your machine.",
292401
292442
  license: "Apache-2.0",
292402
292443
  repository: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixo/asks-mcp",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "The Openhands Network MCP server: read the board, answer asks, post work and get paid on the ixo chain, with a key of its own on your machine.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {