@toon-protocol/rig 4.1.0 → 4.2.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.
package/dist/cli/rig.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import {
3
3
  GitError,
4
4
  GitRepoReader,
5
+ MAX_OBJECT_SIZE,
5
6
  NonFastForwardError,
6
7
  OversizeObjectsError,
7
8
  collectRepoObjects,
@@ -18,7 +19,7 @@ import {
18
19
  setHeadSymref,
19
20
  updateRef,
20
21
  writeGitObjects
21
- } from "../chunk-7VCVR4GK.js";
22
+ } from "../chunk-TJPIE5X4.js";
22
23
  import {
23
24
  DEFAULT_KEYSTORE_PASSWORD,
24
25
  MissingIdentityError,
@@ -54,9 +55,8 @@ import {
54
55
  standaloneForced
55
56
  } from "../chunk-YZRR2UO6.js";
56
57
  import {
57
- MAX_OBJECT_SIZE,
58
58
  uploadChargeFor
59
- } from "../chunk-GVXBUL3C.js";
59
+ } from "../chunk-CXREFXB6.js";
60
60
 
61
61
  // src/cli/rig.ts
62
62
  import { createInterface as createInterface2 } from "readline/promises";
@@ -1111,7 +1111,7 @@ function loadPaidSession(deps, relayUrl) {
1111
1111
  });
1112
1112
  }
1113
1113
  var defaultLoadStandalone = async (options) => {
1114
- const mod = await import("../standalone-mode-KTYRTUS6.js");
1114
+ const mod = await import("../standalone-mode-YOFWOAL5.js");
1115
1115
  return mod.createStandaloneContext(options);
1116
1116
  };
1117
1117
  function identityReport(ctx) {
@@ -1831,17 +1831,18 @@ import { dirname, join as join2 } from "path";
1831
1831
  import { parseArgs as parseArgs4 } from "util";
1832
1832
  var FAMILY_USDC = {
1833
1833
  evm: "EVM USDC (Base Sepolia on devnet)",
1834
- solana: "Solana USDC",
1835
- mina: "Mina USDC"
1834
+ solana: "Solana USDC"
1835
+ };
1836
+ var REMOVED_FAMILIES = {
1837
+ mina: "Mina settlement was removed in rig 4.0.0 along with the Mina client and `rig channel deploy-zkapp`"
1836
1838
  };
1837
1839
  var FAMILY_ALIASES = {
1838
1840
  evm: "evm",
1839
1841
  eth: "evm",
1840
1842
  sol: "solana",
1841
- solana: "solana",
1842
- mina: "mina"
1843
+ solana: "solana"
1843
1844
  };
1844
- var CHAIN_ARG_LIST = "evm | sol | solana | mina (or a full id like evm:base:84532)";
1845
+ var CHAIN_ARG_LIST = "evm | sol | solana (or a full id like evm:base:84532)";
1845
1846
  var CHAIN_USAGE = `Usage: rig chain [set <chain> | unset]
1846
1847
 
1847
1848
  Choose which chain \u2014 and therefore which USDC token \u2014 settles paid \`rig\`
@@ -1853,7 +1854,6 @@ the local config file is touched.
1853
1854
  rig chain set <chain> pin the settlement chain / USDC:
1854
1855
  evm \u2192 EVM USDC (Base Sepolia on devnet)
1855
1856
  sol \u2192 Solana USDC
1856
- mina \u2192 Mina USDC
1857
1857
  (a full id like evm:base:84532 or solana:devnet also
1858
1858
  works; \`solana\` is accepted for \`sol\`, \`eth\` for \`evm\`)
1859
1859
  rig chain unset clear the pin \u2014 revert to automatic selection
@@ -1887,16 +1887,27 @@ function writeChainConfig(configPath, file) {
1887
1887
  function normalizeChain(raw) {
1888
1888
  if (raw.includes(":")) {
1889
1889
  const family = raw.split(":")[0]?.toLowerCase() ?? "";
1890
+ const removed2 = REMOVED_FAMILIES[family];
1891
+ if (removed2) {
1892
+ throw new Error(`${removed2}; settle on evm or solana instead`);
1893
+ }
1890
1894
  if (!(family in FAMILY_USDC)) {
1891
1895
  throw new Error(
1892
- `unknown chain family in ${JSON.stringify(raw)} \u2014 must start with evm:, solana:, or mina:`
1896
+ `unknown chain family in ${JSON.stringify(raw)} \u2014 must start with evm: or solana:`
1893
1897
  );
1894
1898
  }
1895
1899
  return raw;
1896
1900
  }
1897
- const canonical = FAMILY_ALIASES[raw.toLowerCase()];
1901
+ const lowered = raw.toLowerCase();
1902
+ const removed = REMOVED_FAMILIES[lowered];
1903
+ if (removed) {
1904
+ throw new Error(`${removed}; settle on evm or solana instead`);
1905
+ }
1906
+ const canonical = FAMILY_ALIASES[lowered];
1898
1907
  if (!canonical) {
1899
- throw new Error(`chain must be one of ${CHAIN_ARG_LIST}, got ${JSON.stringify(raw)}`);
1908
+ throw new Error(
1909
+ `chain must be one of ${CHAIN_ARG_LIST}, got ${JSON.stringify(raw)}`
1910
+ );
1900
1911
  }
1901
1912
  return canonical;
1902
1913
  }
@@ -1930,7 +1941,9 @@ async function runChain(args, deps) {
1930
1941
  }
1931
1942
  const [sub, ...subRest] = positionals;
1932
1943
  if (sub !== void 0 && sub !== "set" && sub !== "unset") {
1933
- io2.err(`unknown subcommand ${JSON.stringify(sub)} \u2014 expected \`set\`, \`unset\`, or no argument`);
1944
+ io2.err(
1945
+ `unknown subcommand ${JSON.stringify(sub)} \u2014 expected \`set\`, \`unset\`, or no argument`
1946
+ );
1934
1947
  io2.err(CHAIN_USAGE);
1935
1948
  return 2;
1936
1949
  }
@@ -1993,7 +2006,9 @@ async function runChain(args, deps) {
1993
2006
  return 0;
1994
2007
  }
1995
2008
  io2.out(`Settlement chain set to ${value} \u2192 spends ${usdcFor(value)}.`);
1996
- io2.out(`Saved to ${configPath}. Applies to the next paid command (e.g. \`rig push\`).`);
2009
+ io2.out(
2010
+ `Saved to ${configPath}. Applies to the next paid command (e.g. \`rig push\`).`
2011
+ );
1997
2012
  for (const w of warnings) io2.err(`warning: ${w}`);
1998
2013
  return 0;
1999
2014
  }
@@ -2018,9 +2033,13 @@ async function runChain(args, deps) {
2018
2033
  had !== void 0 ? `Cleared the settlement-chain pin (was ${had}).` : "No settlement-chain pin was set."
2019
2034
  );
2020
2035
  if (stillPinned !== void 0) {
2021
- io2.out(`Still pinned to ${stillPinned} by ${envChain !== void 0 ? "TOON_CLIENT_CHAIN" : "config supportedChains"} \u2192 ${usdcFor(stillPinned)}.`);
2036
+ io2.out(
2037
+ `Still pinned to ${stillPinned} by ${envChain !== void 0 ? "TOON_CLIENT_CHAIN" : "config supportedChains"} \u2192 ${usdcFor(stillPinned)}.`
2038
+ );
2022
2039
  } else {
2023
- io2.out("Reverted to automatic selection (most-recent channel \u2192 first funded announced chain \u2192 first EVM).");
2040
+ io2.out(
2041
+ "Reverted to automatic selection (most-recent channel \u2192 first funded announced chain \u2192 first EVM)."
2042
+ );
2024
2043
  }
2025
2044
  return 0;
2026
2045
  }
@@ -2038,13 +2057,19 @@ async function runChain(args, deps) {
2038
2057
  }
2039
2058
  if (effective !== void 0) {
2040
2059
  const via = source === "env" ? "TOON_CLIENT_CHAIN env" : source === "config" ? `config \`chain\` (${configPath})` : `config \`supportedChains[0]\``;
2041
- io2.out(`Settlement chain: ${effective} \u2192 spends ${usdcFor(effective)} (from ${via}).`);
2042
- io2.out("Change it with `rig chain set <evm|sol|mina>`, or `rig chain unset` for auto.");
2060
+ io2.out(
2061
+ `Settlement chain: ${effective} \u2192 spends ${usdcFor(effective)} (from ${via}).`
2062
+ );
2063
+ io2.out(
2064
+ "Change it with `rig chain set <evm|sol>`, or `rig chain unset` for auto."
2065
+ );
2043
2066
  } else {
2044
2067
  io2.out("Settlement chain: (auto) \u2014 no pin set.");
2045
- io2.out("rig picks your most-recent open channel, else the first announced chain your");
2068
+ io2.out(
2069
+ "rig picks your most-recent open channel, else the first announced chain your"
2070
+ );
2046
2071
  io2.out("wallet holds USDC on, else the first announced EVM chain.");
2047
- io2.out("Pin one with `rig chain set <evm|sol|mina>`.");
2072
+ io2.out("Pin one with `rig chain set <evm|sol>`.");
2048
2073
  }
2049
2074
  return 0;
2050
2075
  } catch (err) {
@@ -7687,7 +7712,7 @@ Commands rig owns:
7687
7712
  balance wallet balances + payment-channel holdings
7688
7713
  (free \u2014 chain reads and local state only)
7689
7714
  chain [set <c>|unset] choose which chain/USDC settles paid writes
7690
- (evm|sol|mina); free \u2014 reads/writes local config
7715
+ (evm|sol); free \u2014 reads/writes local config
7691
7716
  entry <url> | entry clear choose the connector that prices and settles paid
7692
7717
  writes \u2014 one URL is the whole configuration, since
7693
7718
  its GET /ilp describes it; --relay <wss-url>
@@ -7739,7 +7764,11 @@ racing the channel. If a daemon is ALSO actively writing on this identity,
7739
7764
  stop it (its pid is in ~/.toon-client/daemon.pid) to avoid a claim race.`;
7740
7765
  function rigVersion() {
7741
7766
  const require2 = createRequire(import.meta.url);
7742
- for (const rel of ["../package.json", "../../package.json", "../../../package.json"]) {
7767
+ for (const rel of [
7768
+ "../package.json",
7769
+ "../../package.json",
7770
+ "../../../package.json"
7771
+ ]) {
7743
7772
  try {
7744
7773
  const pkg = require2(rel);
7745
7774
  if (pkg.name === "@toon-protocol/rig" && pkg.version) return pkg.version;