@mysten-incubation/suipay-mcp 0.3.0-dev.22 → 0.3.0-dev.23
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
CHANGED
|
@@ -5,7 +5,7 @@ buyer-funded spend account. The buyer owns the account. The agent holds the
|
|
|
5
5
|
delegate key and can spend only under the on-chain grant (recipient bind,
|
|
6
6
|
per-payment cap, budget).
|
|
7
7
|
|
|
8
|
-
Pin `@mysten-incubation/suipay-mcp@0.3.0-dev.
|
|
8
|
+
Pin `@mysten-incubation/suipay-mcp@0.3.0-dev.23` in MCP config for the `latest` dist-tag.
|
|
9
9
|
`npx -y @mysten-incubation/suipay-mcp@dev` tracks the `dev` prerelease line.
|
|
10
10
|
`1.0.1` remains on the registry as a historical release; do not install it
|
|
11
11
|
for new agents.
|
|
@@ -13,7 +13,7 @@ for new agents.
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
claude mcp add --scope user suipay -- npx -y @mysten-incubation/suipay-mcp@0.3.0-dev.
|
|
16
|
+
claude mcp add --scope user suipay -- npx -y @mysten-incubation/suipay-mcp@0.3.0-dev.23
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
`@dev` installs the Railway-dev gateway/console defaults. A workspace
|
|
@@ -161,10 +161,10 @@ Default is Railway **suipay-dev**. `--local` / `target: "local"` is laptop-only.
|
|
|
161
161
|
|
|
162
162
|
```bash
|
|
163
163
|
# Railway suipay-dev (default)
|
|
164
|
-
npx @mysten-incubation/suipay-mcp@0.3.0-dev.
|
|
164
|
+
npx @mysten-incubation/suipay-mcp@0.3.0-dev.23
|
|
165
165
|
|
|
166
166
|
# Laptop stack
|
|
167
|
-
npx @mysten-incubation/suipay-mcp@0.3.0-dev.
|
|
167
|
+
npx @mysten-incubation/suipay-mcp@0.3.0-dev.23 --local
|
|
168
168
|
```
|
|
169
169
|
|
|
170
170
|
`SUIPAY_MCP_TARGET=local|dev` selects the same preset. Explicit
|
package/dist/bin/suipay.js
CHANGED
|
@@ -1484,13 +1484,18 @@ var GUARDED_DELEGATE_ARG_LAYOUT = {
|
|
|
1484
1484
|
recipient: null,
|
|
1485
1485
|
amount: 6,
|
|
1486
1486
|
paymentIdHash: 7,
|
|
1487
|
-
expiresAtMs: 9
|
|
1487
|
+
expiresAtMs: 9,
|
|
1488
|
+
// After clock (10): chain id, refund config, decide window, refund window.
|
|
1489
|
+
decideWindowMs: 13,
|
|
1490
|
+
refundWindowMs: 14
|
|
1488
1491
|
},
|
|
1489
1492
|
settle_any_recipient_to_refund_vault: {
|
|
1490
1493
|
recipient: 4,
|
|
1491
1494
|
amount: 5,
|
|
1492
1495
|
paymentIdHash: 6,
|
|
1493
|
-
expiresAtMs: 9
|
|
1496
|
+
expiresAtMs: 9,
|
|
1497
|
+
decideWindowMs: 13,
|
|
1498
|
+
refundWindowMs: 14
|
|
1494
1499
|
}
|
|
1495
1500
|
};
|
|
1496
1501
|
function pureBytesOf(data, arg) {
|
|
@@ -1570,11 +1575,48 @@ function recoverGuardedDelegateCalls(finalized) {
|
|
|
1570
1575
|
paymentIdHash: readPureVectorU8Hex(data, args[layout.paymentIdHash]),
|
|
1571
1576
|
amount: readPureU64(data, args[layout.amount]),
|
|
1572
1577
|
recipient: layout.recipient === null ? null : readPureAddress(data, args[layout.recipient]),
|
|
1573
|
-
expiresAtMs: readPureU64(data, args[layout.expiresAtMs])
|
|
1578
|
+
expiresAtMs: readPureU64(data, args[layout.expiresAtMs]),
|
|
1579
|
+
..."decideWindowMs" in layout ? {
|
|
1580
|
+
decideWindowMs: readPureU64(data, args[layout.decideWindowMs]),
|
|
1581
|
+
refundWindowMs: readPureU64(data, args[layout.refundWindowMs])
|
|
1582
|
+
} : {}
|
|
1574
1583
|
});
|
|
1575
1584
|
}
|
|
1576
1585
|
return calls;
|
|
1577
1586
|
}
|
|
1587
|
+
var VAULT_SETTLEMENT_TS_TIMEOUT_MS = 1e4;
|
|
1588
|
+
function withTimeout(work, ms, label) {
|
|
1589
|
+
return new Promise((resolve2, reject2) => {
|
|
1590
|
+
const timer = setTimeout(() => reject2(new Error(`${label} timed out after ${ms}ms`)), ms);
|
|
1591
|
+
Promise.resolve(work).then((value) => {
|
|
1592
|
+
clearTimeout(timer);
|
|
1593
|
+
resolve2(value);
|
|
1594
|
+
}, (err) => {
|
|
1595
|
+
clearTimeout(timer);
|
|
1596
|
+
reject2(err);
|
|
1597
|
+
});
|
|
1598
|
+
});
|
|
1599
|
+
}
|
|
1600
|
+
async function readVaultSettlementMs(client, digest) {
|
|
1601
|
+
const ledger = client.ledgerService;
|
|
1602
|
+
if (!ledger?.getTransaction)
|
|
1603
|
+
return void 0;
|
|
1604
|
+
try {
|
|
1605
|
+
const call = await withTimeout(ledger.getTransaction({
|
|
1606
|
+
digest,
|
|
1607
|
+
readMask: { paths: ["timestamp"] }
|
|
1608
|
+
}), VAULT_SETTLEMENT_TS_TIMEOUT_MS, "vault settlement timestamp read");
|
|
1609
|
+
const ts = call.response.transaction?.timestamp;
|
|
1610
|
+
if (!ts || ts.seconds === void 0)
|
|
1611
|
+
return void 0;
|
|
1612
|
+
const seconds = Number(ts.seconds);
|
|
1613
|
+
if (!Number.isFinite(seconds))
|
|
1614
|
+
return void 0;
|
|
1615
|
+
return seconds * 1e3 + Math.floor((ts.nanos ?? 0) / 1e6);
|
|
1616
|
+
} catch {
|
|
1617
|
+
return void 0;
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1578
1620
|
function createSpendAccountSettledTxReader(options) {
|
|
1579
1621
|
const network = toGrpcNetwork(options.network);
|
|
1580
1622
|
const client = options.client ?? createFailoverGrpcClient({
|
|
@@ -1629,6 +1671,7 @@ function createSpendAccountSettledTxReader(options) {
|
|
|
1629
1671
|
kind: e.eventType.split("::").pop() ?? e.eventType
|
|
1630
1672
|
}));
|
|
1631
1673
|
const guardedDelegateCalls = recoverGuardedDelegateCalls(finalized);
|
|
1674
|
+
const timestampMs = events.some((event) => event.kind === "VaultOpened") ? await readVaultSettlementMs(client, digest) : void 0;
|
|
1632
1675
|
return {
|
|
1633
1676
|
status: "success",
|
|
1634
1677
|
txDigest: digest,
|
|
@@ -1636,7 +1679,8 @@ function createSpendAccountSettledTxReader(options) {
|
|
|
1636
1679
|
moveCalls,
|
|
1637
1680
|
objectIds,
|
|
1638
1681
|
events,
|
|
1639
|
-
guardedDelegateCalls
|
|
1682
|
+
guardedDelegateCalls,
|
|
1683
|
+
...timestampMs !== void 0 ? { timestampMs } : {}
|
|
1640
1684
|
};
|
|
1641
1685
|
}
|
|
1642
1686
|
};
|
package/dist/http.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadBootProfile,
|
|
3
3
|
main
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Y4VKD3RV.js";
|
|
5
5
|
import {
|
|
6
6
|
MCP_TARGET_PRESETS,
|
|
7
7
|
PACKAGE_NAME,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
settlePreparedMcpPayment,
|
|
27
27
|
traceMcpHttpRequest,
|
|
28
28
|
verifySpendAccountPayReconstructs
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-H7ET3HU2.js";
|
|
30
30
|
export {
|
|
31
31
|
MCP_TARGET_PRESETS,
|
|
32
32
|
PACKAGE_NAME,
|
package/package.json
CHANGED