@needmoretruth/nmts-cli 0.48.1 → 0.49.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/CHANGELOG.md +11 -0
- package/README.ko.md +1 -1
- package/README.md +1 -1
- package/dist/artifact-about.d.ts +1 -1
- package/dist/commands/wallet-swap.d.ts +3 -7
- package/dist/commands/wallet-swap.js +110 -86
- package/dist/help-options.js +2 -1
- package/dist/help.js +4 -3
- package/dist/product.d.ts +1 -1
- package/dist/product.js +1 -1
- package/dist/shared/lib/wallet/swap-routes.d.ts +43 -0
- package/dist/shared/lib/wallet/swap-routes.js +62 -0
- package/dist/shared/lib/wallet/swap-rules.d.ts +48 -10
- package/dist/shared/lib/wallet/swap-rules.js +109 -21
- package/dist/shared/lib/wallet/venue-ids.d.ts +19 -2
- package/dist/shared/lib/wallet/venue-ids.js +35 -2
- package/dist/wallet-swap-chain.d.ts +12 -4
- package/dist/wallet-swap-chain.js +76 -36
- package/dist/wallet-swap-quote.d.ts +20 -3
- package/dist/wallet-swap-quote.js +101 -13
- package/dist/wallet-swap-words.d.ts +30 -0
- package/dist/wallet-swap-words.js +70 -0
- package/dist/wallet.d.ts +6 -0
- package/dist/wallet.js +11 -3
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -8,16 +8,54 @@
|
|
|
8
8
|
// fee paid in DEEP, then comparing output per unit actually spent. Bluefin's quote reports its
|
|
9
9
|
// fee outright (`fee_amount` + `protocol_fee`; both parts count).
|
|
10
10
|
//
|
|
11
|
+
// ⛔ THREE COINS, SIX DIRECTIONS (SUI, WAL, USDC). Each direction goes through the one pool that holds
|
|
12
|
+
// both coins. On DeepBook, WAL ↔ SUI is also asked THROUGH USDC (WAL_USDC then SUI_USDC in one
|
|
13
|
+
// transaction) and whichever route pays more is the answer — the route travels with the quote, and
|
|
14
|
+
// the swap is built along that same route.
|
|
15
|
+
//
|
|
11
16
|
// ⛔ A FEE RATE THAT CANNOT BE MEASURED IS NULL, NEVER 0. A quote that cannot be read THROWS — the
|
|
12
17
|
// command says "this venue did not answer", never a number in its place. An output of 0 is an
|
|
13
18
|
// answer, not a failure: the amount is below one lot, or the book is empty.
|
|
14
19
|
import { bcs } from "@mysten/sui/bcs";
|
|
15
20
|
import { Transaction } from "@mysten/sui/transactions";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
21
|
+
import { hopFor, PAIR_COINS, pickRoute, routeHops, venueRoutes, } from "./shared/lib/wallet/swap-routes.js";
|
|
22
|
+
import { combineFeeBps, deepbookRowFrom, directionCoins, feeRateBpsOf, measureDeepbookFeeBps, } from "./shared/lib/wallet/swap-rules.js";
|
|
23
|
+
import { BLUEFIN_MAX_SQRT_PRICE, BLUEFIN_MIN_SQRT_PRICE, DEEPBOOK_PACKAGE_IDS, DEEPBOOK_SUI_USDC_POOLS, DEEPBOOK_WAL_SUI_POOLS, DEEPBOOK_WAL_USDC_POOLS, USDC_COIN_TYPES, } from "./shared/lib/wallet/venue-ids.js";
|
|
18
24
|
import { SUI_COIN_TYPE, walCoinType } from "./wallet.js";
|
|
19
25
|
/** The zero address: a quote is a read, and a read needs no wallet. */
|
|
20
26
|
export const QUOTE_SENDER = `0x${"0".repeat(64)}`;
|
|
27
|
+
/** The three exact coin types of a network. ⛔ A coin is matched by this whole type, never a symbol. */
|
|
28
|
+
export function swapCoinTypes(network) {
|
|
29
|
+
return { SUI: SUI_COIN_TYPE, WAL: walCoinType(network), USDC: USDC_COIN_TYPES[network] };
|
|
30
|
+
}
|
|
31
|
+
/** DeepBook's order books on a network. */
|
|
32
|
+
export function deepbookPools(network) {
|
|
33
|
+
return {
|
|
34
|
+
WAL_SUI: DEEPBOOK_WAL_SUI_POOLS[network],
|
|
35
|
+
SUI_USDC: DEEPBOOK_SUI_USDC_POOLS[network],
|
|
36
|
+
WAL_USDC: DEEPBOOK_WAL_USDC_POOLS[network],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** The pool's two coin types, in pool order (first coin = DeepBook base = Bluefin coin_a). */
|
|
40
|
+
export function pairTypes(network, pair) {
|
|
41
|
+
const types = swapCoinTypes(network);
|
|
42
|
+
const [first, second] = PAIR_COINS[pair];
|
|
43
|
+
return [types[first], types[second]];
|
|
44
|
+
}
|
|
45
|
+
/** A pool's id, or a throw when this tool knows none on that network. */
|
|
46
|
+
export function poolIdOf(pools, pair, venue) {
|
|
47
|
+
const id = pools[pair];
|
|
48
|
+
if (id === null)
|
|
49
|
+
throw new Error(`this tool knows no ${venue} ${pair} pool on this network`);
|
|
50
|
+
return id;
|
|
51
|
+
}
|
|
52
|
+
/** The routes a venue can build for a direction with the pools it has. */
|
|
53
|
+
export function routesWithPools(venue, direction, pools) {
|
|
54
|
+
return venueRoutes(venue, direction).filter((route) => {
|
|
55
|
+
const hops = routeHops(direction, route);
|
|
56
|
+
return hops !== null && hops.every((hop) => pools[hop.pair] !== null);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
21
59
|
function readU64(value) {
|
|
22
60
|
return BigInt(bcs.U64.parse(Uint8Array.from(value[0])));
|
|
23
61
|
}
|
|
@@ -37,13 +75,15 @@ const BluefinSwapResultPrefix = bcs.struct("BluefinSwapResultPrefix", {
|
|
|
37
75
|
protocol_fee: bcs.u64(),
|
|
38
76
|
});
|
|
39
77
|
async function quoteBluefin(client, network, direction, amountInUnits, binding) {
|
|
40
|
-
const
|
|
78
|
+
const { in: from, out: to } = directionCoins(direction);
|
|
79
|
+
const hop = hopFor(from, to);
|
|
80
|
+
const a2b = hop.sellsFirst;
|
|
41
81
|
const tx = new Transaction();
|
|
42
82
|
tx.moveCall({
|
|
43
83
|
target: `${binding.packageId}::pool::calculate_swap_results`,
|
|
44
|
-
typeArguments:
|
|
84
|
+
typeArguments: pairTypes(network, hop.pair),
|
|
45
85
|
arguments: [
|
|
46
|
-
tx.object(binding.
|
|
86
|
+
tx.object(poolIdOf(binding.pools, hop.pair, "bluefin")),
|
|
47
87
|
tx.pure.bool(a2b),
|
|
48
88
|
tx.pure.bool(true),
|
|
49
89
|
tx.pure.u64(amountInUnits),
|
|
@@ -66,14 +106,17 @@ async function quoteBluefin(client, network, direction, amountInUnits, binding)
|
|
|
66
106
|
outUnits: BigInt(result.amount_calculated),
|
|
67
107
|
feeRateBps: feeRateBpsOf(BigInt(result.fee_amount) + BigInt(result.protocol_fee), amountInUnits),
|
|
68
108
|
leftoverInUnits: BigInt(result.amount_specified_remaining),
|
|
109
|
+
route: "direct",
|
|
110
|
+
leftoverMidUnits: 0n,
|
|
69
111
|
};
|
|
70
112
|
}
|
|
71
|
-
|
|
113
|
+
/** One DeepBook pool's answer: what comes out, what is left over, and the fee measured on that pool. */
|
|
114
|
+
async function quoteDeepbookHop(client, network, hop, amountInUnits) {
|
|
72
115
|
const pkg = DEEPBOOK_PACKAGE_IDS[network];
|
|
73
|
-
const pool =
|
|
74
|
-
const types =
|
|
75
|
-
const inputFeeFn =
|
|
76
|
-
const deepModeArgs =
|
|
116
|
+
const pool = poolIdOf(deepbookPools(network), hop.pair, "deepbook");
|
|
117
|
+
const types = pairTypes(network, hop.pair);
|
|
118
|
+
const inputFeeFn = hop.sellsFirst ? "get_quote_quantity_out_input_fee" : "get_base_quantity_out_input_fee";
|
|
119
|
+
const deepModeArgs = hop.sellsFirst ? [amountInUnits, 0n] : [0n, amountInUnits];
|
|
77
120
|
const build = (withDeepMode) => {
|
|
78
121
|
const tx = new Transaction();
|
|
79
122
|
tx.moveCall({
|
|
@@ -101,19 +144,64 @@ async function quoteDeepbook(client, network, direction, amountInUnits) {
|
|
|
101
144
|
if (res.error)
|
|
102
145
|
throw new Error(`the DeepBook quote was refused on chain: ${res.error}`);
|
|
103
146
|
const rowOf = (values) => values !== undefined && values.length >= 3 && values[0] !== undefined && values[1] !== undefined
|
|
104
|
-
? deepbookRowFrom(
|
|
147
|
+
? deepbookRowFrom(hop.sellsFirst, readU64(values[0]), readU64(values[1]))
|
|
105
148
|
: null;
|
|
106
149
|
const inputMode = rowOf(res.results?.[0]?.returnValues);
|
|
107
150
|
if (inputMode === null)
|
|
108
151
|
throw new Error("the DeepBook quote came back in a shape this tool does not read");
|
|
109
152
|
const deepMode = deepModeAnswered ? rowOf(res.results?.[1]?.returnValues) : null;
|
|
110
153
|
return {
|
|
111
|
-
venue: "deepbook",
|
|
112
154
|
outUnits: inputMode.outUnits,
|
|
113
|
-
feeRateBps: measureDeepbookFeeBps(amountInUnits, inputMode, deepMode),
|
|
114
155
|
leftoverInUnits: inputMode.leftoverInUnits,
|
|
156
|
+
feeRateBps: measureDeepbookFeeBps(amountInUnits, inputMode, deepMode),
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* One DeepBook route. Through USDC, the USDC the first pool gives is asked of the second; when the
|
|
161
|
+
* first gives nothing (below that book's one-coin minimum), the route answers 0 without asking —
|
|
162
|
+
* DeepBook refuses a question about 0.
|
|
163
|
+
*/
|
|
164
|
+
async function quoteDeepbookRoute(client, network, direction, route, amountInUnits) {
|
|
165
|
+
const hops = routeHops(direction, route);
|
|
166
|
+
const firstHop = hops?.[0];
|
|
167
|
+
if (hops === null || firstHop === undefined)
|
|
168
|
+
throw new Error(`DeepBook has no ${route} route for ${direction}`);
|
|
169
|
+
const first = await quoteDeepbookHop(client, network, firstHop, amountInUnits);
|
|
170
|
+
const secondHop = hops[1];
|
|
171
|
+
if (secondHop === undefined) {
|
|
172
|
+
return { venue: "deepbook", ...first, route, leftoverMidUnits: 0n };
|
|
173
|
+
}
|
|
174
|
+
if (first.outUnits <= 0n) {
|
|
175
|
+
return { venue: "deepbook", outUnits: 0n, feeRateBps: null, leftoverInUnits: first.leftoverInUnits, route, leftoverMidUnits: 0n };
|
|
176
|
+
}
|
|
177
|
+
const second = await quoteDeepbookHop(client, network, secondHop, first.outUnits);
|
|
178
|
+
return {
|
|
179
|
+
venue: "deepbook",
|
|
180
|
+
outUnits: second.outUnits,
|
|
181
|
+
feeRateBps: combineFeeBps(first.feeRateBps, second.feeRateBps),
|
|
182
|
+
leftoverInUnits: first.leftoverInUnits,
|
|
183
|
+
route,
|
|
184
|
+
leftoverMidUnits: second.leftoverInUnits,
|
|
115
185
|
};
|
|
116
186
|
}
|
|
187
|
+
async function quoteDeepbook(client, network, direction, amountInUnits) {
|
|
188
|
+
const routes = routesWithPools("deepbook", direction, deepbookPools(network));
|
|
189
|
+
if (routes.length === 0)
|
|
190
|
+
throw new Error(`this tool knows no DeepBook pool for ${direction} on ${network}`);
|
|
191
|
+
const settled = await Promise.allSettled(routes.map((route) => quoteDeepbookRoute(client, network, direction, route, amountInUnits)));
|
|
192
|
+
const answered = [];
|
|
193
|
+
let reason = null;
|
|
194
|
+
for (const outcome of settled) {
|
|
195
|
+
if (outcome.status === "fulfilled")
|
|
196
|
+
answered.push(outcome.value);
|
|
197
|
+
else
|
|
198
|
+
reason = outcome.reason;
|
|
199
|
+
}
|
|
200
|
+
const best = pickRoute(answered);
|
|
201
|
+
if (best === null)
|
|
202
|
+
throw reason instanceof Error ? reason : new Error(String(reason));
|
|
203
|
+
return best;
|
|
204
|
+
}
|
|
117
205
|
/** One venue's answer now. Bluefin needs its resolved binding; DeepBook needs nothing resolved. */
|
|
118
206
|
export async function quoteVenue(client, network, venue, direction, amountInUnits, bluefin) {
|
|
119
207
|
if (amountInUnits <= 0n)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Network } from "./network.ts";
|
|
2
|
+
import { type SwapCoin, type SwapExtreme, type SwapVenue } from "./shared/lib/wallet/swap-rules.ts";
|
|
3
|
+
import { type VenueQuote } from "./wallet-swap-quote.ts";
|
|
4
|
+
/** What the site's price route says, when it says anything. Null = no reference price just now. */
|
|
5
|
+
export interface MarketPrices {
|
|
6
|
+
suiUsd: number | null;
|
|
7
|
+
walUsd: number | null;
|
|
8
|
+
/** Absent from an older site; then the USDC directions are "uncompared", never assumed at 1. */
|
|
9
|
+
usdcUsd?: number | null;
|
|
10
|
+
}
|
|
11
|
+
export declare const EXTREME_WORDS: Record<SwapExtreme, string>;
|
|
12
|
+
export declare const USAGE = "`nmts wallet swap <SUI|WAL|USDC> <amount|max> --to <SUI|WAL|USDC> --venue deepbook|bluefin`";
|
|
13
|
+
/**
|
|
14
|
+
* A coin named on the command line: a symbol, or a full coin type. A symbol answers at once; a full
|
|
15
|
+
* type is kept as written and matched against the network's exact types once the network is known.
|
|
16
|
+
*/
|
|
17
|
+
export type CoinWord = {
|
|
18
|
+
coin: SwapCoin;
|
|
19
|
+
} | {
|
|
20
|
+
coinType: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function coinWordOf(raw: string | undefined, what: string): CoinWord;
|
|
23
|
+
/** The coin a word names on this network. ⛔ A full type must equal one of the three EXACT types. */
|
|
24
|
+
export declare function resolveCoin(word: CoinWord, network: Network): SwapCoin;
|
|
25
|
+
/** An amount of one coin, exactly, in that coin's own decimals (USDC keeps 6, SUI and WAL 9). */
|
|
26
|
+
export declare function amountOf(coin: SwapCoin, units: bigint): string;
|
|
27
|
+
export declare function pct(bps: number): string;
|
|
28
|
+
export declare function asMarketPrices(value: unknown): MarketPrices | null;
|
|
29
|
+
export declare function venueName(venue: SwapVenue | "exchange"): string;
|
|
30
|
+
export declare function quoteLine(q: VenueQuote, outCoin: SwapCoin, inCoin: SwapCoin): string;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// The words and figures `nmts wallet swap` prints and parses: which coin a word names (a symbol, or a
|
|
2
|
+
// full coin type matched EXACTLY — a coin that only shares the name "USDC" is refused), an amount in
|
|
3
|
+
// its own coin's decimals, a quote line, and the site's reference prices. Nothing here reads a chain,
|
|
4
|
+
// signs, or decides whether to swap; `commands/wallet-swap.ts` does that, in its fixed order.
|
|
5
|
+
import { NmtsError } from "./errors.js";
|
|
6
|
+
import { isRecord } from "./guards.js";
|
|
7
|
+
import { BINARY_NAME } from "./product.js";
|
|
8
|
+
import { COIN_DECIMALS, swapCoinOfType } from "./shared/lib/wallet/swap-rules.js";
|
|
9
|
+
import { coinAmount } from "./wallet.js";
|
|
10
|
+
import { swapCoinTypes } from "./wallet-swap-quote.js";
|
|
11
|
+
export const EXTREME_WORDS = {
|
|
12
|
+
lowSlippage: "the slippage is below 10 bps: the smallest price movement fails the swap, and the chain fee is spent for nothing",
|
|
13
|
+
highSlippage: "the slippage is above 200 bps: a thin order book may keep that much of what goes in",
|
|
14
|
+
lowFee: "the fee cap is under 1.2 times the measured fee: the swap may fail for want of gas, and that gas is gone",
|
|
15
|
+
highFee: "the fee cap is over ten times the measured fee and over 0.05 SUI",
|
|
16
|
+
deviation: "the quote is more than 3% from the site's reference price: the book may be thin or moved",
|
|
17
|
+
};
|
|
18
|
+
export const USAGE = `\`${BINARY_NAME} wallet swap <SUI|WAL|USDC> <amount|max> --to <SUI|WAL|USDC> --venue deepbook|bluefin\``;
|
|
19
|
+
export function coinWordOf(raw, what) {
|
|
20
|
+
const text = (raw ?? "").trim();
|
|
21
|
+
const up = text.toUpperCase();
|
|
22
|
+
if (up === "SUI" || up === "WAL" || up === "USDC")
|
|
23
|
+
return { coin: up };
|
|
24
|
+
if (text.includes("::"))
|
|
25
|
+
return { coinType: text };
|
|
26
|
+
throw new NmtsError(`Say which coin ${what}: SUI, WAL or USDC.`, { exitCode: 2, nextStep: USAGE });
|
|
27
|
+
}
|
|
28
|
+
/** The coin a word names on this network. ⛔ A full type must equal one of the three EXACT types. */
|
|
29
|
+
export function resolveCoin(word, network) {
|
|
30
|
+
if ("coin" in word)
|
|
31
|
+
return word.coin;
|
|
32
|
+
const coin = swapCoinOfType(word.coinType, swapCoinTypes(network));
|
|
33
|
+
if (coin === null) {
|
|
34
|
+
throw new NmtsError(`${word.coinType} is not SUI, WAL or Circle's native USDC on ${network}.`, {
|
|
35
|
+
exitCode: 2,
|
|
36
|
+
nextStep: `Nothing was signed. A coin is matched by its whole type, package address included — a coin that only shares the name is a different coin. The USDC this tool swaps is ${swapCoinTypes(network).USDC}.`,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return coin;
|
|
40
|
+
}
|
|
41
|
+
/** An amount of one coin, exactly, in that coin's own decimals (USDC keeps 6, SUI and WAL 9). */
|
|
42
|
+
export function amountOf(coin, units) {
|
|
43
|
+
const decimals = COIN_DECIMALS[coin];
|
|
44
|
+
if (decimals === 9)
|
|
45
|
+
return coinAmount(units);
|
|
46
|
+
const scale = 10n ** BigInt(decimals);
|
|
47
|
+
const fraction = units % scale;
|
|
48
|
+
if (fraction === 0n)
|
|
49
|
+
return (units / scale).toString();
|
|
50
|
+
return `${units / scale}.${fraction.toString().padStart(decimals, "0").replace(/0+$/, "")}`;
|
|
51
|
+
}
|
|
52
|
+
export function pct(bps) {
|
|
53
|
+
return `${(bps / 100).toFixed(2).replace(/0+$/, "").replace(/\.$/, "")}%`;
|
|
54
|
+
}
|
|
55
|
+
export function asMarketPrices(value) {
|
|
56
|
+
if (!isRecord(value) || value["unavailable"] === true)
|
|
57
|
+
return null;
|
|
58
|
+
const num = (v) => (typeof v === "number" && Number.isFinite(v) && v > 0 ? v : null);
|
|
59
|
+
return { suiUsd: num(value["suiUsd"]), walUsd: num(value["walUsd"]), usdcUsd: num(value["usdcUsd"]) };
|
|
60
|
+
}
|
|
61
|
+
export function venueName(venue) {
|
|
62
|
+
return venue === "deepbook" ? "DeepBook" : venue === "bluefin" ? "Bluefin" : "the official Walrus testnet exchange";
|
|
63
|
+
}
|
|
64
|
+
export function quoteLine(q, outCoin, inCoin) {
|
|
65
|
+
const fee = q.feeRateBps === null ? "venue fee could not be measured" : `venue fee about ${pct(q.feeRateBps)}`;
|
|
66
|
+
const via = q.route === "viaUsdc" ? ` — ${inCoin} → USDC → ${outCoin} in one transaction` : "";
|
|
67
|
+
const left = q.leftoverInUnits > 0n ? ` (${amountOf(inCoin, q.leftoverInUnits)} ${inCoin} would come back unused)` : "";
|
|
68
|
+
const mid = q.leftoverMidUnits > 0n ? ` (${amountOf("USDC", q.leftoverMidUnits)} USDC would come back unused)` : "";
|
|
69
|
+
return `${q.venue.padEnd(9)} ${amountOf(outCoin, q.outUnits)} ${outCoin} — ${fee}${via}${left}${mid}`;
|
|
70
|
+
}
|
package/dist/wallet.d.ts
CHANGED
|
@@ -122,6 +122,12 @@ export interface ChainReader {
|
|
|
122
122
|
* coins, and an answer for one of them is worth more than a matching pair of silences.
|
|
123
123
|
*/
|
|
124
124
|
export declare function readBalances(reader: ChainReader, walType: string): Promise<WalletBalances>;
|
|
125
|
+
/**
|
|
126
|
+
* One coin's balance, counted by its EXACT type — a coin with the same symbol and another package is
|
|
127
|
+
* not in the sum. The zero case is confirmed as for WAL: a chain that does not know the type answers
|
|
128
|
+
* 0 too, and that zero would mean nothing.
|
|
129
|
+
*/
|
|
130
|
+
export declare function readCoinOfType(reader: ChainReader, coinType: string, name: string): Promise<CoinBalance>;
|
|
125
131
|
/**
|
|
126
132
|
* Base units as a person reads them — the exact value, never rounded.
|
|
127
133
|
*
|
package/dist/wallet.js
CHANGED
|
@@ -165,9 +165,17 @@ async function readSui(reader) {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
async function readWal(reader, walType) {
|
|
168
|
+
return readCoinOfType(reader, walType, "WAL");
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* One coin's balance, counted by its EXACT type — a coin with the same symbol and another package is
|
|
172
|
+
* not in the sum. The zero case is confirmed as for WAL: a chain that does not know the type answers
|
|
173
|
+
* 0 too, and that zero would mean nothing.
|
|
174
|
+
*/
|
|
175
|
+
export async function readCoinOfType(reader, coinType, name) {
|
|
168
176
|
let total;
|
|
169
177
|
try {
|
|
170
|
-
total = await reader.totalOf(
|
|
178
|
+
total = await reader.totalOf(coinType);
|
|
171
179
|
}
|
|
172
180
|
catch (error) {
|
|
173
181
|
return { read: false, why: reasonOf(error) };
|
|
@@ -176,11 +184,11 @@ async function readWal(reader, walType) {
|
|
|
176
184
|
if (total > 0n)
|
|
177
185
|
return { read: true, baseUnits: total };
|
|
178
186
|
try {
|
|
179
|
-
if (await reader.knowsCoinType(
|
|
187
|
+
if (await reader.knowsCoinType(coinType))
|
|
180
188
|
return { read: true, baseUnits: total };
|
|
181
189
|
return {
|
|
182
190
|
read: false,
|
|
183
|
-
why:
|
|
191
|
+
why: `this chain does not know the ${name} coin type this version of the tool was built with, so a zero balance here would mean nothing`,
|
|
184
192
|
};
|
|
185
193
|
}
|
|
186
194
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@needmoretruth/nmts-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.49.0",
|
|
4
4
|
"description": "Command-line and MCP access to NMTS (NeedMoreTruthStorage, https://nmts.me): open-source, end-to-end encrypted storage on the Walrus network. No fee to NMTS; you pay the network from your own wallet. For people and for their agents.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"publishConfig": {
|
package/server.json
CHANGED
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
"url": "https://github.com/needmoretruth/nmts-cli",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.49.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
14
14
|
"identifier": "@needmoretruth/nmts-cli",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.49.0",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
},
|