buoy-wallet 0.0.1 → 0.0.2
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 +3 -2
- package/bin/buoy.mjs +74 -10
- package/package.json +5 -2
- package/scripts/install-buoy.mjs +186 -40
- package/skills/buoy-wallet/SKILL.md +139 -10
- package/ts/approve/actions.mjs +83 -1
- package/ts/approve/server.mjs +95 -4
- package/ts/approve/setup.mjs +67 -1
- package/ts/mcp/amount.mjs +54 -0
- package/ts/mcp/chain.mjs +26 -0
- package/ts/mcp/instructions.mjs +15 -7
- package/ts/mcp/manifest.mjs +89 -5
- package/ts/mcp/read.mjs +28 -0
- package/ts/mcp/server.mjs +97 -20
- package/ts/mcp/views.mjs +377 -76
- package/ts/okx/locate.mjs +45 -0
- package/ts/okx/signer.mjs +7 -3
- package/ts/okx/x402.mjs +6 -3
package/ts/okx/x402.mjs
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
// payment pay --payload <b64> --yes sign the selected accepts entry via TEE, return the header.
|
|
13
13
|
|
|
14
14
|
import { spawnSync } from "node:child_process";
|
|
15
|
+
import { locateOnchainos, ONCHAINOS_INSTALL } from "./locate.mjs";
|
|
15
16
|
|
|
16
17
|
export class OkxX402Error extends Error {
|
|
17
18
|
constructor(code, message) {
|
|
@@ -24,13 +25,15 @@ export class OkxX402Error extends Error {
|
|
|
24
25
|
export const XLAYER_CHAIN = "196";
|
|
25
26
|
|
|
26
27
|
/** Default runner. Injectable, so the translation below is testable with no CLI installed. */
|
|
27
|
-
export function cliRunner(bin
|
|
28
|
+
export function cliRunner(bin) {
|
|
29
|
+
// PATH first, then the folder OKX's installer uses. See ts/okx/locate.mjs.
|
|
30
|
+
const exe = bin ?? locateOnchainos().bin ?? "onchainos";
|
|
28
31
|
return (args) => {
|
|
29
|
-
const r = spawnSync(
|
|
32
|
+
const r = spawnSync(exe, args, { encoding: "utf8", shell: false });
|
|
30
33
|
if (r.error && r.error.code === "ENOENT") {
|
|
31
34
|
throw new OkxX402Error(
|
|
32
35
|
"cli-not-installed",
|
|
33
|
-
|
|
36
|
+
`onchainos was not found on PATH or in ~/.local/bin. Install it with: ${ONCHAINOS_INSTALL}`
|
|
34
37
|
);
|
|
35
38
|
}
|
|
36
39
|
return { code: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "" };
|