@esseyonsui/sui-mcp-v3 0.1.1 → 0.1.3
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/README.md +42 -10
- package/dist/agent.d.ts +19 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +33 -0
- package/dist/args.d.ts +10 -1
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +9 -9
- package/dist/client.d.ts +10 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +33 -2
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/failure.d.ts +4 -0
- package/dist/failure.d.ts.map +1 -1
- package/dist/failure.js +22 -2
- package/dist/fund.d.ts +21 -0
- package/dist/fund.d.ts.map +1 -0
- package/dist/fund.js +44 -0
- package/dist/io.d.ts +3 -1
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js +22 -0
- package/dist/keys.d.ts +3 -2
- package/dist/keys.d.ts.map +1 -1
- package/dist/keys.js +17 -2
- package/dist/main.js +24 -8
- package/dist/records.d.ts +9 -2
- package/dist/records.d.ts.map +1 -1
- package/dist/records.js +29 -3
- package/dist/tools-badge.d.ts +5 -0
- package/dist/tools-badge.d.ts.map +1 -0
- package/dist/tools-badge.js +18 -0
- package/dist/tools-more.d.ts +3 -0
- package/dist/tools-more.d.ts.map +1 -0
- package/dist/tools-more.js +227 -0
- package/dist/tools-sales.d.ts +3 -0
- package/dist/tools-sales.d.ts.map +1 -0
- package/dist/tools-sales.js +222 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +14 -2
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { dirname } from "node:path";
|
|
4
4
|
import { ESSEY_ERROR_CODES, Essey, isEsseyError, parseConfig as parseDeployment, } from "@esseyonsui/sui-sdk-v3";
|
|
5
|
+
import { graphqlExecute, itemHandOver } from "./agent.js";
|
|
5
6
|
import { clientOf, withInvite } from "./client.js";
|
|
6
7
|
import { ConfigError, parseConfig } from "./config.js";
|
|
8
|
+
import { agentDepositIo } from "./fund.js";
|
|
7
9
|
import { chainIo } from "./io.js";
|
|
8
|
-
import {
|
|
10
|
+
import { loadAgentKey, loadNoteSeed } from "./keys.js";
|
|
9
11
|
import { serve } from "./protocol.js";
|
|
10
12
|
import { fileRecords } from "./records.js";
|
|
11
13
|
import { bind } from "./tools.js";
|
|
@@ -13,10 +15,17 @@ const VERSION = JSON.parse(readFileSync(new URL("../package.json", import.meta.u
|
|
|
13
15
|
.version;
|
|
14
16
|
const INSTRUCTIONS = "Essey V3 private testnet tools. Note and agent keys are files on this server, never tool arguments, and no tool " +
|
|
15
17
|
"returns a key, seed, or spend secret. The invite, when there is one, is ESSEY_INVITE. Amounts are whole-number " +
|
|
16
|
-
"strings in the coin's smallest unit. The server builds every proof itself and keeps loan terms
|
|
17
|
-
"records in its own files; no tool returns them. Borrow: essey_loan_open, wait for the window,
|
|
18
|
-
"essey_loan_repay, essey_loan_release. Lend: essey_loan_list, essey_loan_request,
|
|
19
|
-
"essey_loan_collect after repay or essey_loan_reclaim if the offer lost.
|
|
18
|
+
"strings in the coin's smallest unit. The server builds every proof itself and keeps loan terms, offer, seller " +
|
|
19
|
+
"and bid records in its own files; no tool returns them. Borrow: essey_loan_open, wait for the window, " +
|
|
20
|
+
"essey_loan_settle, essey_loan_repay, essey_loan_release. Lend: essey_loan_list, essey_loan_request, " +
|
|
21
|
+
"essey_loan_offer, then essey_loan_collect after repay or essey_loan_reclaim if the offer lost. Refinance: " +
|
|
22
|
+
"essey_loan_refi_open, lenders offer, essey_loan_refi_settle; the old lender calls essey_loan_collect. Keeper: " +
|
|
23
|
+
"essey_keeper_judge, then essey_keeper_liquidate or essey_keeper_fault, after which the lender calls " +
|
|
24
|
+
"essey_loan_fault_liquidate. essey_notes_deposit is paid from the agent wallet. Sell: put the item at " +
|
|
25
|
+
"essey_agent_address, essey_sale_open, after close essey_sale_finish (essey_sale_slash each bid it names " +
|
|
26
|
+
"first); or essey_sale_cancel before any bid, or essey_sale_expire after the finish window, then " +
|
|
27
|
+
"essey_sale_claim as seller. Buy: essey_sale_list, essey_sale_bid, and once the room ended essey_sale_claim as " +
|
|
28
|
+
"bidder if won and essey_sale_reclaim (residual if won, else the deposit).";
|
|
20
29
|
/**
|
|
21
30
|
* `source` is what `Essey.connect` takes: the URL, which names the v3api, or the parsed file. The io reads the
|
|
22
31
|
* same record as JSON (Seal set, pools, circuit pins).
|
|
@@ -63,12 +72,19 @@ function startupCode(err) {
|
|
|
63
72
|
/** Refuses to run, on stderr, when the config or a key file is wrong. stdout carries only MCP. */
|
|
64
73
|
async function start() {
|
|
65
74
|
const cfg = parseConfig(process.env);
|
|
66
|
-
|
|
75
|
+
const agent = loadAgentKey(cfg.agentKeyFile);
|
|
67
76
|
const seed = loadNoteSeed(cfg.noteKeyFile);
|
|
68
77
|
try {
|
|
69
78
|
const { source, raw } = await deploymentOf(cfg);
|
|
70
|
-
const
|
|
71
|
-
const
|
|
79
|
+
const io = chainIo(raw, { graphql: cfg.graphql });
|
|
80
|
+
const deliverSaleItem = itemHandOver({
|
|
81
|
+
signer: agent,
|
|
82
|
+
execute: graphqlExecute(cfg.graphql, agent),
|
|
83
|
+
readObjectRef: io.readObjectRef,
|
|
84
|
+
});
|
|
85
|
+
const essey = await Essey.connect({ network: "testnet", statePath: cfg.stateFile, config: source, seed, relayer: cfg.relayer }, { ...io, ...agentDepositIo(raw, cfg.agentKeyFile, cfg.graphql), deliverSaleItem });
|
|
86
|
+
const sale = { agentAddress: agent.toSuiAddress(), vaultOf: io.readVaultOf };
|
|
87
|
+
const client = withInvite(clientOf(essey, sale), cfg.invite);
|
|
72
88
|
const tools = bind({
|
|
73
89
|
client,
|
|
74
90
|
records: fileRecords(dirname(cfg.stateFile)),
|
package/dist/records.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { Essey } from "@esseyonsui/sui-sdk-v3";
|
|
1
|
+
import type { Essey, SaleRecord } from "@esseyonsui/sui-sdk-v3";
|
|
2
2
|
export type Terms = Parameters<Essey["loans"]["payBack"]>[0]["terms"];
|
|
3
3
|
export type OfferRecord = Awaited<ReturnType<Essey["loans"]["lend"]>>["offer"];
|
|
4
|
+
export type BidRecord = Awaited<ReturnType<Essey["sales"]["bid"]>>["bid"];
|
|
5
|
+
export type { SaleRecord };
|
|
4
6
|
/** A borrower's own loan. `terms` and `borrowerPk` arrive with settle; until then only the locked amount is known. */
|
|
5
7
|
export type LoanRecord = {
|
|
6
8
|
collAmt: bigint;
|
|
@@ -9,13 +11,18 @@ export type LoanRecord = {
|
|
|
9
11
|
};
|
|
10
12
|
/**
|
|
11
13
|
* What a cycle step needs from an earlier one and no chain read gives back. Same files and JSON as
|
|
12
|
-
* `scripts/v3/live/run.mts` (`loan-<id>.json`, `offer-<id>.json`), mode 600,
|
|
14
|
+
* `scripts/v3/live/run.mts` (`loan-<id>.json`, `offer-<id>.json`, `sale-<room>.json`, `bid-<room>.json`), mode 600,
|
|
15
|
+
* beside the state file.
|
|
13
16
|
*/
|
|
14
17
|
export type Records = {
|
|
15
18
|
loan(id: string): LoanRecord;
|
|
16
19
|
saveLoan(id: string, record: LoanRecord): void;
|
|
17
20
|
offer(id: string): OfferRecord;
|
|
18
21
|
saveOffer(id: string, record: OfferRecord): void;
|
|
22
|
+
sale(room: string): SaleRecord;
|
|
23
|
+
saveSale(room: string, record: SaleRecord): void;
|
|
24
|
+
bid(room: string): BidRecord;
|
|
25
|
+
saveBid(room: string, record: BidRecord): void;
|
|
19
26
|
};
|
|
20
27
|
export declare function fileRecords(dir: string): Records;
|
|
21
28
|
//# sourceMappingURL=records.d.ts.map
|
package/dist/records.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../src/records.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../src/records.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIhE,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AACtE,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC/E,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;AAC1E,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,sHAAsH;AACtH,MAAM,MAAM,UAAU,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjF;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC/C,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,CAAC;IAC/B,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IACjD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IACjD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;CAChD,CAAC;AAoBF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAkEhD"}
|
package/dist/records.js
CHANGED
|
@@ -5,10 +5,14 @@ import { ToolRefusal } from "./failure.js";
|
|
|
5
5
|
const LOAN_ID = /^0x[0-9a-f]{64}$/;
|
|
6
6
|
const plain = (v) => JSON.stringify(v, (_k, x) => (typeof x === "bigint" ? x.toString() : x));
|
|
7
7
|
const big = (v) => (v === undefined ? undefined : BigInt(v));
|
|
8
|
+
const MISSING = {
|
|
9
|
+
loan: "this server holds no borrower record for that loan: open it from this server first",
|
|
10
|
+
offer: "this server holds no offer record for that loan: offer on it from this server first",
|
|
11
|
+
sale: "this server holds no seller record for that room: open the sale from this server first",
|
|
12
|
+
bid: "this server holds no bid record for that room: bid on it from this server first",
|
|
13
|
+
};
|
|
8
14
|
function noRecord(kind) {
|
|
9
|
-
throw new ToolRefusal(kind
|
|
10
|
-
? "this server holds no borrower record for that loan: open it from this server first"
|
|
11
|
-
: "this server holds no offer record for that loan: offer on it from this server first");
|
|
15
|
+
throw new ToolRefusal(MISSING[kind]);
|
|
12
16
|
}
|
|
13
17
|
export function fileRecords(dir) {
|
|
14
18
|
const path = (kind, id) => {
|
|
@@ -56,5 +60,27 @@ export function fileRecords(dir) {
|
|
|
56
60
|
};
|
|
57
61
|
},
|
|
58
62
|
saveOffer: (id, record) => write("offer", id, record),
|
|
63
|
+
sale: (room) => {
|
|
64
|
+
const r = read("sale", room) ?? noRecord("sale");
|
|
65
|
+
const seller = r.seller;
|
|
66
|
+
const bounds = r.bounds;
|
|
67
|
+
return {
|
|
68
|
+
room: r.room,
|
|
69
|
+
noteIndex: r.noteIndex,
|
|
70
|
+
seller: { sellerSk: BigInt(seller.sellerSk), sellerSecret: BigInt(seller.sellerSecret) },
|
|
71
|
+
bounds: { lo: BigInt(bounds.lo), hi: BigInt(bounds.hi), salt: BigInt(bounds.salt) },
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
saveSale: (room, record) => write("sale", room, record),
|
|
75
|
+
bid: (room) => {
|
|
76
|
+
const r = read("bid", room) ?? noRecord("bid");
|
|
77
|
+
return {
|
|
78
|
+
room: r.room,
|
|
79
|
+
noteIndex: r.noteIndex,
|
|
80
|
+
v: BigInt(r.v),
|
|
81
|
+
amount: BigInt(r.amount),
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
saveBid: (room, record) => write("bid", room, record),
|
|
59
85
|
};
|
|
60
86
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Tool } from "./tools.ts";
|
|
2
|
+
/** The one sale item the testnet KeyRegistry allows (`scripts/v3/live/io.ts:23`), the type the grant mints. */
|
|
3
|
+
export declare const TESTNET_BADGE_TYPE = "0x48db0307be9b6aadbf9f29c28561e1b450348ab2786ea4853a8d7249c22979a1::demo::Badge";
|
|
4
|
+
export declare const BADGE_TOOLS: Tool[];
|
|
5
|
+
//# sourceMappingURL=tools-badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-badge.d.ts","sourceRoot":"","sources":["../src/tools-badge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAEvC,+GAA+G;AAC/G,eAAO,MAAM,kBAAkB,oFACoD,CAAC;AAEpF,eAAO,MAAM,WAAW,EAAE,IAAI,EAe7B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { objectSchema } from "./args.js";
|
|
2
|
+
/** The one sale item the testnet KeyRegistry allows (`scripts/v3/live/io.ts:23`), the type the grant mints. */
|
|
3
|
+
export const TESTNET_BADGE_TYPE = "0x48db0307be9b6aadbf9f29c28561e1b450348ab2786ea4853a8d7249c22979a1::demo::Badge";
|
|
4
|
+
export const BADGE_TOOLS = [
|
|
5
|
+
{
|
|
6
|
+
name: "essey_badge_grant",
|
|
7
|
+
kind: "call",
|
|
8
|
+
description: "Seller, testnet: ask the service for one demo Badge to sell, minted to essey_agent_address with the gas " +
|
|
9
|
+
"SUI its hand-over needs. Needs a credential; one grant per credential per UTC day. The agent address is " +
|
|
10
|
+
"public on chain and the service sees it beside this credential's day-tag. Returns the digest and the " +
|
|
11
|
+
"itemId and itemType to pass to essey_sale_open.",
|
|
12
|
+
inputSchema: objectSchema({}, []),
|
|
13
|
+
run: async (ctx) => {
|
|
14
|
+
const { digest, badge } = await ctx.client.sales.badgeGrant(ctx.client.sales.agentAddress);
|
|
15
|
+
return { ok: true, digest, itemId: badge, itemType: TESTNET_BADGE_TYPE };
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-more.d.ts","sourceRoot":"","sources":["../src/tools-more.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,YAAY,CAAC;AAkQpD,eAAO,MAAM,IAAI,EAAE,IAAI,EAA6C,CAAC"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { COINS } from "@esseyonsui/sui-sdk-v3";
|
|
2
|
+
import { LOAN_SCHEMA, OPEN_SCHEMA, int, parseAmount, parseCoin, parseLoanId, parsePayee } from "./args.js";
|
|
3
|
+
import { isSdkCode, ToolRefusal } from "./failure.js";
|
|
4
|
+
/** `move/v3/loan/sources/loan.move:40` MAX_OFFERS = 16. */
|
|
5
|
+
const MAX_SEQ = 15;
|
|
6
|
+
const MAX_MS = Number.MAX_SAFE_INTEGER;
|
|
7
|
+
const REQUEST = OPEN_SCHEMA.properties;
|
|
8
|
+
const LOAN = LOAN_SCHEMA.properties.loan;
|
|
9
|
+
const obj = (properties = {}, required = []) => ({
|
|
10
|
+
type: "object",
|
|
11
|
+
properties,
|
|
12
|
+
required,
|
|
13
|
+
additionalProperties: false,
|
|
14
|
+
});
|
|
15
|
+
const KEEPER_SCHEMA = obj({
|
|
16
|
+
loan: LOAN,
|
|
17
|
+
via: {
|
|
18
|
+
type: "string",
|
|
19
|
+
enum: ["pass", "badge"],
|
|
20
|
+
description: "Seal read approved by the keeper credential (pass, default) or by essey_keeper_mint_badge's badge",
|
|
21
|
+
},
|
|
22
|
+
}, ["loan"]);
|
|
23
|
+
function bad(msg) {
|
|
24
|
+
throw new ToolRefusal(msg);
|
|
25
|
+
}
|
|
26
|
+
function landed(row) {
|
|
27
|
+
return { ok: true, digest: row.digest, ticket: row.ticket };
|
|
28
|
+
}
|
|
29
|
+
function keeperArgs(args) {
|
|
30
|
+
const loan = parseLoanId(args);
|
|
31
|
+
if (args.via === undefined)
|
|
32
|
+
return { loan };
|
|
33
|
+
if (args.via !== "pass" && args.via !== "badge")
|
|
34
|
+
bad("via must be pass or badge");
|
|
35
|
+
return { loan, via: args.via };
|
|
36
|
+
}
|
|
37
|
+
function own(ctx, loan) {
|
|
38
|
+
const r = ctx.records.loan(loan);
|
|
39
|
+
if (!r.terms || r.borrowerPk === undefined)
|
|
40
|
+
bad("this loan has not settled from this server: call essey_loan_settle first");
|
|
41
|
+
return { loan, terms: r.terms, borrowerPk: r.borrowerPk, collAmt: r.collAmt };
|
|
42
|
+
}
|
|
43
|
+
function recovered(row) {
|
|
44
|
+
const out = { coin: row.coin, value: row.value, outcome: row.outcome };
|
|
45
|
+
if ("digest" in row)
|
|
46
|
+
out.digest = row.digest;
|
|
47
|
+
if ("atMs" in row && row.atMs !== undefined)
|
|
48
|
+
out.atMs = row.atMs;
|
|
49
|
+
if ("error" in row)
|
|
50
|
+
out.error = isSdkCode(row.error) ? row.error.code : "UNEXPECTED";
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
const REFI = [
|
|
54
|
+
{
|
|
55
|
+
name: "essey_loan_refi_open",
|
|
56
|
+
kind: "call",
|
|
57
|
+
description: "Borrower of an active loan settled from this server: open a refinance round for a new principal that pays the " +
|
|
58
|
+
"current lender what is owed. Lenders offer with essey_loan_request and essey_loan_offer as on a new loan. " +
|
|
59
|
+
"Returns the digest, ticket, round and when offers close.",
|
|
60
|
+
inputSchema: obj({
|
|
61
|
+
loan: LOAN,
|
|
62
|
+
principal: { ...REQUEST.principal, description: "new principal; it must cover what is owed now" },
|
|
63
|
+
maxRateBps: REQUEST.maxRateBps,
|
|
64
|
+
termMs: REQUEST.termMs,
|
|
65
|
+
offerWindowMs: REQUEST.offerWindowMs,
|
|
66
|
+
}, ["loan", "principal", "maxRateBps", "termMs", "offerWindowMs"]),
|
|
67
|
+
run: async (ctx, args) => {
|
|
68
|
+
const { loan, borrowerPk, collAmt } = own(ctx, parseLoanId(args));
|
|
69
|
+
const r = await ctx.client.loans.openRefi({
|
|
70
|
+
loan,
|
|
71
|
+
borrowerPk,
|
|
72
|
+
collAmt,
|
|
73
|
+
principal: parseAmount(args, "principal"),
|
|
74
|
+
maxRateBps: int(args, "maxRateBps", 0, 10_000),
|
|
75
|
+
termMs: int(args, "termMs", 1, MAX_MS),
|
|
76
|
+
offerWindowMs: int(args, "offerWindowMs", 1, MAX_MS),
|
|
77
|
+
});
|
|
78
|
+
return { ...landed(r), round: r.round, closeMs: r.closeMs };
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "essey_loan_refi_settle",
|
|
83
|
+
kind: "call",
|
|
84
|
+
description: "Borrower, after the refinance window: take the lowest eligible offer. The old lender is paid and collects with " +
|
|
85
|
+
"essey_loan_collect; this server keeps the new terms. Returns the digest, ticket, rate, amount owed and maturity.",
|
|
86
|
+
inputSchema: LOAN_SCHEMA,
|
|
87
|
+
run: async (ctx, args) => {
|
|
88
|
+
const settled = own(ctx, parseLoanId(args));
|
|
89
|
+
const r = await ctx.client.loans.settleRefi(settled);
|
|
90
|
+
const { loan, collAmt, borrowerPk } = settled;
|
|
91
|
+
ctx.records.saveLoan(loan, { collAmt, terms: r.terms, borrowerPk });
|
|
92
|
+
return { ...landed(r), rateBps: r.rateBps, owed: r.terms.owed, maturityS: r.terms.maturityS };
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "essey_loan_refi_cancel",
|
|
97
|
+
kind: "call",
|
|
98
|
+
description: "Borrower: close an own open refinance round. The loan stays active on its current terms.",
|
|
99
|
+
inputSchema: LOAN_SCHEMA,
|
|
100
|
+
run: async (ctx, args) => landed(await ctx.client.loans.cancelRefi(parseLoanId(args))),
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
const SEIZE = [
|
|
104
|
+
{
|
|
105
|
+
name: "essey_loan_slash",
|
|
106
|
+
kind: "call",
|
|
107
|
+
description: "Borrower, after the offer window closed: mark offer seq inactive when its sealed offer does not open its " +
|
|
108
|
+
"commit. The chain refuses an honest offer. The slashed lender reclaims its lock once the round resolves.",
|
|
109
|
+
inputSchema: obj({
|
|
110
|
+
loan: LOAN,
|
|
111
|
+
seq: { type: "integer", minimum: 0, maximum: MAX_SEQ, description: "offer slot in the round" },
|
|
112
|
+
}, ["loan", "seq"]),
|
|
113
|
+
run: async (ctx, args) => landed(await ctx.client.loans.slash({ loan: parseLoanId(args), seq: int(args, "seq", 0, MAX_SEQ) })),
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: "essey_loan_liquidate",
|
|
117
|
+
kind: "call",
|
|
118
|
+
description: "Borrower of a loan settled from this server: seize it while it is underwater, from this server's own terms. " +
|
|
119
|
+
"The lender takes its share with essey_loan_collect_seized, the borrower the rest with essey_loan_collect_surplus.",
|
|
120
|
+
inputSchema: LOAN_SCHEMA,
|
|
121
|
+
run: async (ctx, args) => landed(await ctx.client.loans.liquidate(own(ctx, parseLoanId(args)))),
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "essey_loan_seize_default",
|
|
125
|
+
kind: "call",
|
|
126
|
+
description: "Borrower of a loan settled from this server: seize it once it is past maturity plus grace, from this server's " +
|
|
127
|
+
"own terms. Then essey_loan_collect_seized (lender) and essey_loan_collect_surplus (borrower).",
|
|
128
|
+
inputSchema: LOAN_SCHEMA,
|
|
129
|
+
run: async (ctx, args) => landed(await ctx.client.loans.seizeDefault(own(ctx, parseLoanId(args)))),
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: "essey_loan_fault_liquidate",
|
|
133
|
+
kind: "call",
|
|
134
|
+
description: "Lender, from the offer this server made, of a loan a keeper marked FAULT with essey_keeper_fault: seize it. " +
|
|
135
|
+
"Then essey_loan_collect_seized.",
|
|
136
|
+
inputSchema: LOAN_SCHEMA,
|
|
137
|
+
run: async (ctx, args) => {
|
|
138
|
+
const loan = parseLoanId(args);
|
|
139
|
+
return landed(await ctx.client.loans.faultLiquidate({ loan, offer: ctx.records.offer(loan) }));
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
];
|
|
143
|
+
const KEEPER = [
|
|
144
|
+
{
|
|
145
|
+
name: "essey_keeper_mint_badge",
|
|
146
|
+
kind: "call",
|
|
147
|
+
description: "Keeper (essey_credential_obtain with role keeper): mint a keeper badge, sponsored by the relayer, for via " +
|
|
148
|
+
"badge. Returns the digest, badge id, holder address and expiry.",
|
|
149
|
+
inputSchema: obj(),
|
|
150
|
+
run: async (ctx) => {
|
|
151
|
+
const r = await ctx.client.keeper.mintBadge();
|
|
152
|
+
return {
|
|
153
|
+
ok: true,
|
|
154
|
+
digest: r.digest,
|
|
155
|
+
badge: r.badge,
|
|
156
|
+
holder: r.holder,
|
|
157
|
+
expiresMs: r.expiresMs,
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "essey_keeper_badge",
|
|
163
|
+
kind: "read",
|
|
164
|
+
description: "The keeper badge this server holds: badge id, holder address and expiry, or badge null.",
|
|
165
|
+
inputSchema: obj(),
|
|
166
|
+
run: async (ctx) => {
|
|
167
|
+
const held = ctx.client.keeper.badge();
|
|
168
|
+
if (!held)
|
|
169
|
+
return { ok: true, badge: null };
|
|
170
|
+
return { ok: true, badge: held.badge, holder: held.holder, expiresMs: held.expiresMs };
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "essey_keeper_judge",
|
|
175
|
+
kind: "read",
|
|
176
|
+
description: "Keeper: read an active loan's keeper ciphertext through Seal and say what to do, sending nothing. action " +
|
|
177
|
+
"liquidate (essey_keeper_liquidate), fault (essey_keeper_fault), or skip with reason healthy or third-party-ct.",
|
|
178
|
+
inputSchema: KEEPER_SCHEMA,
|
|
179
|
+
run: async (ctx, args) => {
|
|
180
|
+
const v = await ctx.client.keeper.judge(keeperArgs(args));
|
|
181
|
+
if (v.action === "skip")
|
|
182
|
+
return { ok: true, action: v.action, reason: v.reason };
|
|
183
|
+
return { ok: true, action: v.action };
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "essey_keeper_fault",
|
|
188
|
+
kind: "call",
|
|
189
|
+
description: "Keeper: mark an active loan FAULT when its retained borrower keeper ciphertext does not open its lock. The " +
|
|
190
|
+
"chain refuses an honest ciphertext. The lender then calls essey_loan_fault_liquidate.",
|
|
191
|
+
inputSchema: KEEPER_SCHEMA,
|
|
192
|
+
run: async (ctx, args) => landed(await ctx.client.loans.fault(keeperArgs(args))),
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "essey_keeper_liquidate",
|
|
196
|
+
kind: "call",
|
|
197
|
+
description: "Keeper: seize an underwater loan from its Seal read of the keeper ciphertext. The keeper fee arrives as an own " +
|
|
198
|
+
"note; the lender and borrower collect with essey_loan_collect_seized and essey_loan_collect_surplus.",
|
|
199
|
+
inputSchema: KEEPER_SCHEMA,
|
|
200
|
+
run: async (ctx, args) => landed(await ctx.client.loans.keeperLiquidate(keeperArgs(args))),
|
|
201
|
+
},
|
|
202
|
+
];
|
|
203
|
+
const NOTES = [
|
|
204
|
+
{
|
|
205
|
+
name: "essey_notes_exit",
|
|
206
|
+
kind: "call",
|
|
207
|
+
description: "Withdraw every note of a coin, at most two, less fees, to a 0x address of 64 hex digits. Returns the digest " +
|
|
208
|
+
"and ticket.",
|
|
209
|
+
inputSchema: obj({
|
|
210
|
+
coin: { type: "string", enum: [...COINS] },
|
|
211
|
+
to: { type: "string", pattern: "^0x[0-9a-fA-F]{64}$", description: "recipient address" },
|
|
212
|
+
}, ["coin", "to"]),
|
|
213
|
+
run: async (ctx, args) => landed(await ctx.client.notes.exit(parseCoin(args), parsePayee(args))),
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
name: "essey_notes_recover",
|
|
217
|
+
kind: "call",
|
|
218
|
+
description: "Retry every deposit this server started that has not landed. One row per record: coin, value and outcome " +
|
|
219
|
+
"(landed, unconfirmed, already landed, record gone, unfunded, retry_after with atMs, failed with an error code).",
|
|
220
|
+
inputSchema: obj(),
|
|
221
|
+
run: async (ctx) => ({
|
|
222
|
+
ok: true,
|
|
223
|
+
recovered: (await ctx.client.notes.recoverStranded()).map(recovered),
|
|
224
|
+
}),
|
|
225
|
+
},
|
|
226
|
+
];
|
|
227
|
+
export const MORE = [...REFI, ...SEIZE, ...KEEPER, ...NOTES];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-sales.d.ts","sourceRoot":"","sources":["../src/tools-sales.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,IAAI,EAAe,MAAM,YAAY,CAAC;AAoQpD,eAAO,MAAM,UAAU,EAAE,IAAI,EAA2B,CAAC"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { isEsseyError, v3 } from "@esseyonsui/sui-sdk-v3";
|
|
2
|
+
import { ADDRESS, AMOUNT, COIN, MS, address, int, objectSchema, optBool, parseAmount, parseCoin, payee, } from "./args.js";
|
|
3
|
+
import { ToolRefusal } from "./failure.js";
|
|
4
|
+
const SLOTS = v3.sales.SLOTS;
|
|
5
|
+
/** `sale_room.move:30-33`. */
|
|
6
|
+
const ROOM_STATES = ["open", "settled", "expired", "cancelled"];
|
|
7
|
+
/** `v3/sales/seller.ts` STRUCT_TAG: a non-generic struct tag. */
|
|
8
|
+
const STRUCT_TAG = "^0x[0-9a-fA-F]{1,64}::[A-Za-z_][A-Za-z0-9_]*::[A-Za-z_][A-Za-z0-9_]*$";
|
|
9
|
+
/** The SDK's own finish refusal (`essey.ts` finishSale). Only its digits reach the caller. */
|
|
10
|
+
const SLASH_FIRST = /^refused: slash bids ([0-9]+(?:, [0-9]+)*) first$/;
|
|
11
|
+
const ROOM = { ...ADDRESS, description: "sale room id, as essey_sale_open or essey_sale_list returns it" };
|
|
12
|
+
const ROOM_SCHEMA = objectSchema({ room: ROOM }, ["room"]);
|
|
13
|
+
function bad(msg) {
|
|
14
|
+
throw new ToolRefusal(msg);
|
|
15
|
+
}
|
|
16
|
+
function landed(row) {
|
|
17
|
+
return { ok: true, digest: row.digest, ticket: row.ticket };
|
|
18
|
+
}
|
|
19
|
+
const parseRoom = (args) => address(args, "room");
|
|
20
|
+
function summary(row) {
|
|
21
|
+
const state = ROOM_STATES[row.state] ?? "unknown";
|
|
22
|
+
return { id: row.id, coin: row.coin, state, closeMs: row.closeMs, bids: row.bids };
|
|
23
|
+
}
|
|
24
|
+
function parseSaleOpen(args, nowMs) {
|
|
25
|
+
const minPrice = parseAmount(args, "minPrice");
|
|
26
|
+
const maxPrice = parseAmount(args, "maxPrice");
|
|
27
|
+
if (minPrice > maxPrice)
|
|
28
|
+
bad("minPrice must be at most maxPrice");
|
|
29
|
+
const itemType = args.itemType;
|
|
30
|
+
if (typeof itemType !== "string" || !new RegExp(STRUCT_TAG).test(itemType))
|
|
31
|
+
bad("itemType must be a non-generic struct tag, 0x<package>::<module>::<Type>");
|
|
32
|
+
const closeMs = nowMs + int(args, "bidWindowMs", 1, Number.MAX_SAFE_INTEGER);
|
|
33
|
+
if (!Number.isSafeInteger(closeMs))
|
|
34
|
+
bad("bidWindowMs is too long");
|
|
35
|
+
return {
|
|
36
|
+
itemId: address(args, "itemId"),
|
|
37
|
+
itemType,
|
|
38
|
+
coin: parseCoin(args),
|
|
39
|
+
minPrice,
|
|
40
|
+
maxPrice,
|
|
41
|
+
closeMs,
|
|
42
|
+
finishWindowMs: int(args, "finishWindowMs", 1, Number.MAX_SAFE_INTEGER),
|
|
43
|
+
maxBids: int(args, "maxBids", 1, SLOTS),
|
|
44
|
+
sponsored: true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function parseBid(args) {
|
|
48
|
+
const v = parseAmount(args, "price");
|
|
49
|
+
const amount = parseAmount(args, "deposit");
|
|
50
|
+
if (v > amount)
|
|
51
|
+
bad("price must be at most deposit");
|
|
52
|
+
return { room: parseRoom(args), v, amount };
|
|
53
|
+
}
|
|
54
|
+
function parseClaim(ctx, args) {
|
|
55
|
+
if (args.as !== "seller" && args.as !== "bidder")
|
|
56
|
+
bad("as must be seller or bidder");
|
|
57
|
+
const to = args.to === undefined ? ctx.client.sales.agentAddress : payee(args, "to");
|
|
58
|
+
return { room: parseRoom(args), as: args.as, to };
|
|
59
|
+
}
|
|
60
|
+
async function finish(ctx, room) {
|
|
61
|
+
const { seller, bounds } = ctx.records.sale(room);
|
|
62
|
+
const vault = await ctx.client.sales.vaultOf(room);
|
|
63
|
+
try {
|
|
64
|
+
return await ctx.client.sales.finish({ room, vault, seller, bounds });
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
const seqs = isEsseyError(err) ? SLASH_FIRST.exec(err.message)?.[1] : undefined;
|
|
68
|
+
if (seqs)
|
|
69
|
+
bad(`bids ${seqs} do not open to their locks: call essey_sale_slash for each, then finish`);
|
|
70
|
+
throw err;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async function withVault(ctx, args) {
|
|
74
|
+
const room = parseRoom(args);
|
|
75
|
+
return { room, vault: await ctx.client.sales.vaultOf(room) };
|
|
76
|
+
}
|
|
77
|
+
const SELLER = [
|
|
78
|
+
{
|
|
79
|
+
name: "essey_agent_address",
|
|
80
|
+
kind: "read",
|
|
81
|
+
description: "The Sui address of this server's agent key. Send it the item to sell and testnet SUI for gas. The key signs " +
|
|
82
|
+
"one kind of transaction: the item hand-over inside essey_sale_open.",
|
|
83
|
+
inputSchema: objectSchema({}, []),
|
|
84
|
+
run: async (ctx) => ({ ok: true, address: ctx.client.sales.agentAddress }),
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "essey_sale_open",
|
|
88
|
+
kind: "call",
|
|
89
|
+
description: "Seller: open a sealed sale of an item essey_agent_address holds. The agent key hands the item to a fresh " +
|
|
90
|
+
"sender derived from the note key and the relayer pays the open. Bids close bidWindowMs from now; the seller " +
|
|
91
|
+
"finishes within finishWindowMs after that. The seller keys and price bounds stay in a mode-600 file. " +
|
|
92
|
+
"Returns the room id, digest and ticket.",
|
|
93
|
+
inputSchema: objectSchema({
|
|
94
|
+
itemId: { ...ADDRESS, description: "the item's object id, owned by essey_agent_address" },
|
|
95
|
+
itemType: {
|
|
96
|
+
type: "string",
|
|
97
|
+
pattern: STRUCT_TAG,
|
|
98
|
+
maxLength: 200,
|
|
99
|
+
description: "the item's struct tag, 0x<package>::<module>::<Type>",
|
|
100
|
+
},
|
|
101
|
+
coin: { ...COIN, description: "the coin bids are paid in" },
|
|
102
|
+
minPrice: { ...AMOUNT, description: "lowest price accepted; sealed, never shown to bidders" },
|
|
103
|
+
maxPrice: { ...AMOUNT, description: "highest price settled at; sealed, never shown to bidders" },
|
|
104
|
+
bidWindowMs: { ...MS, description: "how long bids are taken from now, milliseconds" },
|
|
105
|
+
finishWindowMs: { ...MS, description: "how long after close the seller may finish, milliseconds" },
|
|
106
|
+
maxBids: { type: "integer", minimum: 1, maximum: SLOTS, description: `1 to ${SLOTS}` },
|
|
107
|
+
}, ["itemId", "itemType", "coin", "minPrice", "maxPrice", "bidWindowMs", "finishWindowMs", "maxBids"]),
|
|
108
|
+
run: async (ctx, args) => {
|
|
109
|
+
const r = await ctx.client.sales.open(parseSaleOpen(args, Date.now()));
|
|
110
|
+
ctx.records.saveSale(r.id, r.sale);
|
|
111
|
+
return { ...landed(r), room: r.id };
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "essey_sale_finish",
|
|
116
|
+
kind: "call",
|
|
117
|
+
description: "Seller, after close and before the finish deadline: open every sealed bid and settle on the highest within " +
|
|
118
|
+
"the bounds; the price arrives as an own note. A bid that does not open is named: slash it first.",
|
|
119
|
+
inputSchema: ROOM_SCHEMA,
|
|
120
|
+
run: async (ctx, args) => landed(await finish(ctx, parseRoom(args))),
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: "essey_sale_slash",
|
|
124
|
+
kind: "call",
|
|
125
|
+
description: "After close and before the finish deadline: mark bid seq inactive when its sealed price does not open its " +
|
|
126
|
+
"commit and lock. essey_sale_finish names the bids to slash.",
|
|
127
|
+
inputSchema: objectSchema({ room: ROOM, seq: { type: "integer", minimum: 0, maximum: SLOTS - 1, description: "bid position" } }, ["room", "seq"]),
|
|
128
|
+
run: async (ctx, args) => landed(await ctx.client.sales.slash({ room: parseRoom(args), seq: int(args, "seq", 0, SLOTS - 1) })),
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "essey_sale_cancel",
|
|
132
|
+
kind: "call",
|
|
133
|
+
description: "Seller, before any bid: cancel the sale. Then essey_sale_claim as seller takes the item back.",
|
|
134
|
+
inputSchema: ROOM_SCHEMA,
|
|
135
|
+
run: async (ctx, args) => landed(await ctx.client.sales.cancel(await withVault(ctx, args))),
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "essey_sale_expire",
|
|
139
|
+
kind: "call",
|
|
140
|
+
description: "Anyone, once the finish deadline passed unsettled: end the room. The seller then claims the item back and " +
|
|
141
|
+
"every bidder reclaims its deposit.",
|
|
142
|
+
inputSchema: ROOM_SCHEMA,
|
|
143
|
+
run: async (ctx, args) => landed(await ctx.client.sales.expire(await withVault(ctx, args))),
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
const BIDDER = [
|
|
147
|
+
{
|
|
148
|
+
name: "essey_sale_list",
|
|
149
|
+
kind: "read",
|
|
150
|
+
description: "Sale rooms on chain: id, coin, state, close time and bid count. Only open rooms unless all is true.",
|
|
151
|
+
inputSchema: objectSchema({ all: { type: "boolean", description: "every room, not only open ones" } }, []),
|
|
152
|
+
run: async (ctx, args) => {
|
|
153
|
+
const all = optBool(args, "all") ?? false;
|
|
154
|
+
const rows = (await ctx.client.sales.list()).filter((row) => all || row.state === 0);
|
|
155
|
+
return { ok: true, rooms: rows.map(summary) };
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "essey_sale_view",
|
|
160
|
+
kind: "read",
|
|
161
|
+
description: "One sale room's public fields: coin, state, close time, finish deadline, bid count and max bids.",
|
|
162
|
+
inputSchema: ROOM_SCHEMA,
|
|
163
|
+
run: async (ctx, args) => {
|
|
164
|
+
const v = await ctx.client.sales.view(parseRoom(args));
|
|
165
|
+
return { ok: true, ...summary(v), finishByMs: v.finishByMs, maxBids: v.maxBids };
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "essey_sale_bid",
|
|
170
|
+
kind: "call",
|
|
171
|
+
description: "Bidder: lock deposit from own notes of the room's coin behind a sealed bid of price. Only the seller opens " +
|
|
172
|
+
"it, after close. The bid record stays in a mode-600 file. Returns the digest and ticket.",
|
|
173
|
+
inputSchema: objectSchema({
|
|
174
|
+
room: ROOM,
|
|
175
|
+
price: { ...AMOUNT, description: "the sealed bid, in the room coin's smallest unit" },
|
|
176
|
+
deposit: {
|
|
177
|
+
...AMOUNT,
|
|
178
|
+
description: "locked from own notes, at least price; the winner's change comes back",
|
|
179
|
+
},
|
|
180
|
+
}, ["room", "price", "deposit"]),
|
|
181
|
+
run: async (ctx, args) => {
|
|
182
|
+
const p = parseBid(args);
|
|
183
|
+
const { bid, ...r } = await ctx.client.sales.bid(p);
|
|
184
|
+
ctx.records.saveBid(p.room, bid);
|
|
185
|
+
return landed(r);
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
name: "essey_sale_reclaim",
|
|
190
|
+
kind: "call",
|
|
191
|
+
description: "Bidder, once the room settled or expired: a losing bid's deposit back to an own note, or with residual true " +
|
|
192
|
+
"the winner's change. Returns the value.",
|
|
193
|
+
inputSchema: objectSchema({
|
|
194
|
+
room: ROOM,
|
|
195
|
+
residual: { type: "boolean", description: "the winner's change instead of the deposit" },
|
|
196
|
+
}, ["room"]),
|
|
197
|
+
run: async (ctx, args) => {
|
|
198
|
+
const room = parseRoom(args);
|
|
199
|
+
const what = optBool(args, "residual") ? "residual" : "lock";
|
|
200
|
+
const r = await ctx.client.sales.reclaim({ room, bid: ctx.records.bid(room), what });
|
|
201
|
+
return { ...landed(r), value: r.value };
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: "essey_sale_claim",
|
|
206
|
+
kind: "call",
|
|
207
|
+
description: "Send the room's item to an address: as bidder when this server's bid won, or as seller after a cancel or " +
|
|
208
|
+
"expiry. to defaults to essey_agent_address.",
|
|
209
|
+
inputSchema: objectSchema({
|
|
210
|
+
room: ROOM,
|
|
211
|
+
as: { type: "string", enum: ["seller", "bidder"], description: "which record of this server claims" },
|
|
212
|
+
to: { type: "string", pattern: "^0x[0-9a-fA-F]{64}$", description: "recipient address" },
|
|
213
|
+
}, ["room", "as"]),
|
|
214
|
+
run: async (ctx, args) => {
|
|
215
|
+
const { room, as, to } = parseClaim(ctx, args);
|
|
216
|
+
const holder = as === "seller" ? { seller: ctx.records.sale(room).seller } : { bid: ctx.records.bid(room) };
|
|
217
|
+
const vault = await ctx.client.sales.vaultOf(room);
|
|
218
|
+
return { ...landed(await ctx.client.sales.claim({ vault, recipient: to, ...holder })), to };
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
];
|
|
222
|
+
export const SALE_TOOLS = [...SELLER, ...BIDDER];
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,EAAE,OAAO,EAAc,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,EAAE,OAAO,EAAc,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAM5C,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,UAAU,CAAC;IACnB,gGAAgG;IAChG,OAAO,EAAE,OAAO,CAAC;IACjB,8FAA8F;IAC9F,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,yFAAyF;IACzF,OAAO,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,CAAC;AAEF,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpC,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAChC,MAAM,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG;IACzC,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACrD,CAAC;AA2ZF,eAAO,MAAM,KAAK,EAAE,IAAI,EASvB,CAAC;AAUF,+GAA+G;AAC/G,wBAAgB,IAAI,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,GAAE,IAAI,EAAU,GAAG,OAAO,EAAE,CAmBvE"}
|