@agentlayer.tech/wallet 0.1.14 → 0.1.16
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/.openclaw/extensions/agent-wallet/README.md +20 -0
- package/.openclaw/extensions/agent-wallet/dist/index.js +2079 -0
- package/.openclaw/extensions/agent-wallet/index.ts +125 -2
- package/.openclaw/extensions/agent-wallet/openclaw.plugin.json +4 -0
- package/.openclaw/extensions/agent-wallet/package.json +44 -5
- package/.openclaw/extensions/pay-bridge/README.md +6 -0
- package/.openclaw/extensions/pay-bridge/dist/core.mjs +287 -0
- package/.openclaw/extensions/pay-bridge/dist/index.js +196 -0
- package/.openclaw/extensions/pay-bridge/package.json +43 -5
- package/CHANGELOG.md +33 -0
- package/README.md +32 -0
- package/RELEASING.md +167 -0
- package/agent-wallet/.env.example +5 -0
- package/agent-wallet/README.md +38 -0
- package/agent-wallet/agent_wallet/config.py +4 -0
- package/agent-wallet/agent_wallet/openclaw_adapter.py +504 -0
- package/agent-wallet/agent_wallet/providers/flash.py +186 -0
- package/agent-wallet/agent_wallet/providers/flash_sdk_bridge.py +251 -0
- package/agent-wallet/agent_wallet/transaction_policy.py +79 -0
- package/agent-wallet/agent_wallet/wallet_layer/base.py +78 -0
- package/agent-wallet/agent_wallet/wallet_layer/solana.py +623 -1
- package/agent-wallet/pyproject.toml +1 -1
- package/agent-wallet/scripts/flash-sdk-bridge/README.md +33 -0
- package/agent-wallet/scripts/flash-sdk-bridge/bridge.mjs +1179 -0
- package/agent-wallet/scripts/flash-sdk-bridge/package-lock.json +2377 -0
- package/agent-wallet/scripts/flash-sdk-bridge/package.json +12 -0
- package/agent-wallet/scripts/install_agent_wallet.py +46 -11
- package/agent-wallet/scripts/install_openclaw_local_config.py +4 -0
- package/package.json +4 -1
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import {
|
|
2
|
+
executePayApiRequest,
|
|
3
|
+
getPayServiceEndpoints,
|
|
4
|
+
getPayStatus,
|
|
5
|
+
getPayWalletInfo,
|
|
6
|
+
searchPayServices,
|
|
7
|
+
} from "./core.mjs";
|
|
8
|
+
|
|
9
|
+
const PLUGIN_ID = "pay-bridge";
|
|
10
|
+
|
|
11
|
+
function asContent(data) {
|
|
12
|
+
return {
|
|
13
|
+
content: [
|
|
14
|
+
{
|
|
15
|
+
type: "text",
|
|
16
|
+
text: JSON.stringify(data, null, 2),
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function resolvePluginConfig(api) {
|
|
23
|
+
const globalConfig = api?.config ?? {};
|
|
24
|
+
const pluginEntry = globalConfig?.plugins?.entries?.[PLUGIN_ID];
|
|
25
|
+
return pluginEntry?.config ?? globalConfig?.config ?? {};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function registerTool(api, definition) {
|
|
29
|
+
api.registerTool({
|
|
30
|
+
name: definition.name,
|
|
31
|
+
description: definition.description,
|
|
32
|
+
parameters: definition.parameters,
|
|
33
|
+
returns: {
|
|
34
|
+
type: "object",
|
|
35
|
+
additionalProperties: true,
|
|
36
|
+
},
|
|
37
|
+
async execute(_id, params = {}) {
|
|
38
|
+
const config = resolvePluginConfig(api);
|
|
39
|
+
let result;
|
|
40
|
+
if (definition.name === "pay_status") {
|
|
41
|
+
result = await getPayStatus(config, { cwd: process.cwd() });
|
|
42
|
+
} else if (definition.name === "pay_wallet_info") {
|
|
43
|
+
result = await getPayWalletInfo(config, { cwd: process.cwd() });
|
|
44
|
+
} else if (definition.name === "pay_search_services") {
|
|
45
|
+
result = await searchPayServices(config, params, { cwd: process.cwd() });
|
|
46
|
+
} else if (definition.name === "pay_get_service_endpoints") {
|
|
47
|
+
result = await getPayServiceEndpoints(config, params, { cwd: process.cwd() });
|
|
48
|
+
} else if (definition.name === "pay_api_request") {
|
|
49
|
+
result = await executePayApiRequest(config, params, { cwd: process.cwd() });
|
|
50
|
+
} else {
|
|
51
|
+
throw new Error(`Unsupported pay-bridge tool: ${definition.name}`);
|
|
52
|
+
}
|
|
53
|
+
return asContent(result);
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const toolDefinitions = [
|
|
59
|
+
{
|
|
60
|
+
name: "pay_status",
|
|
61
|
+
description:
|
|
62
|
+
"Check whether the local pay.sh CLI is installed and whether a pay wallet/account is configured. Use this before any paid API workflow.",
|
|
63
|
+
parameters: {
|
|
64
|
+
type: "object",
|
|
65
|
+
properties: {},
|
|
66
|
+
additionalProperties: false,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "pay_wallet_info",
|
|
71
|
+
description:
|
|
72
|
+
"Show pay wallet/account status. This wallet is separate from the AgentLayer execution wallet and is only for pay.sh API payments.",
|
|
73
|
+
parameters: {
|
|
74
|
+
type: "object",
|
|
75
|
+
properties: {},
|
|
76
|
+
additionalProperties: false,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "pay_search_services",
|
|
81
|
+
description:
|
|
82
|
+
"Search the pay.sh skills catalog for paid APIs. Prefer this instead of guessing URLs manually.",
|
|
83
|
+
parameters: {
|
|
84
|
+
type: "object",
|
|
85
|
+
properties: {
|
|
86
|
+
query: {
|
|
87
|
+
type: "string",
|
|
88
|
+
description: "Search text for service names, descriptions, or endpoint paths.",
|
|
89
|
+
},
|
|
90
|
+
category: {
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "Optional category filter such as ai_ml, maps, data, compute, search, crypto_finance.",
|
|
93
|
+
},
|
|
94
|
+
account: {
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "Optional pay account override.",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
additionalProperties: false,
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "pay_get_service_endpoints",
|
|
104
|
+
description:
|
|
105
|
+
"List the discoverable endpoints for a pay.sh service/resource pair and return their gateway URLs. Use the returned URL with pay_api_request.",
|
|
106
|
+
parameters: {
|
|
107
|
+
type: "object",
|
|
108
|
+
properties: {
|
|
109
|
+
service_fqn: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "Fully qualified pay service name, for example solana-foundation/google/language.",
|
|
112
|
+
},
|
|
113
|
+
resource: {
|
|
114
|
+
type: "string",
|
|
115
|
+
description: "Resource name inside the service, for example entities or jobs.",
|
|
116
|
+
},
|
|
117
|
+
account: {
|
|
118
|
+
type: "string",
|
|
119
|
+
description: "Optional pay account override.",
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
required: ["service_fqn", "resource"],
|
|
123
|
+
additionalProperties: false,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "pay_api_request",
|
|
128
|
+
description:
|
|
129
|
+
"Call a paid API through the local pay.sh CLI using a URL returned by pay_get_service_endpoints. Requires explicit user_confirmed=true and keeps the pay wallet separate from AgentLayer execution wallets.",
|
|
130
|
+
optional: true,
|
|
131
|
+
parameters: {
|
|
132
|
+
type: "object",
|
|
133
|
+
properties: {
|
|
134
|
+
service_fqn: {
|
|
135
|
+
type: "string",
|
|
136
|
+
description: "Fully qualified pay service name used to validate the request URL.",
|
|
137
|
+
},
|
|
138
|
+
resource: {
|
|
139
|
+
type: "string",
|
|
140
|
+
description: "Resource name used to validate the request URL.",
|
|
141
|
+
},
|
|
142
|
+
url: {
|
|
143
|
+
type: "string",
|
|
144
|
+
description: "Exact HTTPS gateway URL returned by pay_get_service_endpoints.",
|
|
145
|
+
},
|
|
146
|
+
method: {
|
|
147
|
+
type: "string",
|
|
148
|
+
description: "HTTP method such as GET or POST.",
|
|
149
|
+
},
|
|
150
|
+
headers: {
|
|
151
|
+
type: "object",
|
|
152
|
+
additionalProperties: { type: "string" },
|
|
153
|
+
description: "Optional HTTP headers.",
|
|
154
|
+
},
|
|
155
|
+
query: {
|
|
156
|
+
type: "object",
|
|
157
|
+
additionalProperties: true,
|
|
158
|
+
description: "Optional query parameters to append to the URL.",
|
|
159
|
+
},
|
|
160
|
+
json_body: {
|
|
161
|
+
description: "Optional JSON request body.",
|
|
162
|
+
},
|
|
163
|
+
text_body: {
|
|
164
|
+
type: "string",
|
|
165
|
+
description: "Optional raw text request body. Do not provide with json_body.",
|
|
166
|
+
},
|
|
167
|
+
account: {
|
|
168
|
+
type: "string",
|
|
169
|
+
description: "Optional pay account override.",
|
|
170
|
+
},
|
|
171
|
+
parse_json_response: {
|
|
172
|
+
type: "boolean",
|
|
173
|
+
description: "If true, attempt to parse the response body as JSON.",
|
|
174
|
+
},
|
|
175
|
+
purpose: {
|
|
176
|
+
type: "string",
|
|
177
|
+
description: "Short user-facing reason for this paid API call.",
|
|
178
|
+
},
|
|
179
|
+
user_confirmed: {
|
|
180
|
+
type: "boolean",
|
|
181
|
+
description: "Must be true for paid API requests.",
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
required: ["service_fqn", "resource", "url", "method", "purpose", "user_confirmed"],
|
|
185
|
+
additionalProperties: false,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
];
|
|
189
|
+
|
|
190
|
+
export default function registerPayBridgePlugin(api) {
|
|
191
|
+
api?.logger?.info?.("[pay-bridge] registering pay.sh OpenClaw plugin");
|
|
192
|
+
for (const definition of toolDefinitions) {
|
|
193
|
+
registerTool(api, definition);
|
|
194
|
+
}
|
|
195
|
+
api?.logger?.info?.(`[pay-bridge] registered ${toolDefinitions.length} pay tools`);
|
|
196
|
+
}
|
|
@@ -1,11 +1,49 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "pay-bridge",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"
|
|
2
|
+
"name": "@agentlayertech/pay-bridge-plugin",
|
|
3
|
+
"version": "0.1.16",
|
|
4
|
+
"description": "OpenClaw plugin bridge for the local pay.sh CLI.",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"license": "SEE LICENSE IN ../../../LICENSE",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/lopushok9/Agent-Layer.git",
|
|
10
|
+
"directory": ".openclaw/extensions/pay-bridge"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/lopushok9/Agent-Layer/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/lopushok9/Agent-Layer/tree/main/.openclaw/extensions/pay-bridge#readme",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.ts",
|
|
21
|
+
"core.mjs",
|
|
22
|
+
"dist/",
|
|
23
|
+
"openclaw.plugin.json",
|
|
24
|
+
"README.md",
|
|
25
|
+
"skills/"
|
|
26
|
+
],
|
|
6
27
|
"openclaw": {
|
|
7
28
|
"extensions": [
|
|
8
29
|
"./index.ts"
|
|
9
|
-
]
|
|
10
|
-
|
|
30
|
+
],
|
|
31
|
+
"runtimeExtensions": [
|
|
32
|
+
"./dist/index.js"
|
|
33
|
+
],
|
|
34
|
+
"compat": {
|
|
35
|
+
"pluginApi": ">=2026.3.24-beta.2",
|
|
36
|
+
"minGatewayVersion": "2026.3.24-beta.2"
|
|
37
|
+
},
|
|
38
|
+
"build": {
|
|
39
|
+
"openclawVersion": "2026.3.24-beta.2",
|
|
40
|
+
"pluginSdkVersion": "2026.3.24-beta.2"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"openclaw",
|
|
45
|
+
"plugin",
|
|
46
|
+
"pay",
|
|
47
|
+
"payments"
|
|
48
|
+
]
|
|
11
49
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## v0.1.16 - 2026-05-16
|
|
6
|
+
|
|
7
|
+
- Added Flash Trade perpetuals support to the Solana wallet flow, including
|
|
8
|
+
market discovery, position lookup, preview, prepare, open, and close tools.
|
|
9
|
+
- Kept Flash perps wallet-native inside the existing Solana backend instead of
|
|
10
|
+
introducing a separate custodial trading account flow.
|
|
11
|
+
- Added a repo-owned Flash SDK bridge for real quote, prepare, and execution
|
|
12
|
+
planning against Flash Trade from the local runtime.
|
|
13
|
+
- Fixed OpenClaw runtime packaging and plugin contract sync so Flash Trade
|
|
14
|
+
tools are exposed correctly from the installed runtime.
|
|
15
|
+
- Bound Flash execute approvals to the exact approved preview payload, so
|
|
16
|
+
host-issued approvals remain valid across small quote drift between preview
|
|
17
|
+
and execution.
|
|
18
|
+
|
|
19
|
+
- Added ClawHub-publishable OpenClaw plugin package metadata for
|
|
20
|
+
`.openclaw/extensions/agent-wallet` and `.openclaw/extensions/pay-bridge`,
|
|
21
|
+
including required `openclaw.compat`, `openclaw.build`, and
|
|
22
|
+
`runtimeExtensions` fields for native `openclaw plugins install clawhub:...`
|
|
23
|
+
installs.
|
|
24
|
+
- Added a reproducible OpenClaw plugin package build/check script at
|
|
25
|
+
`scripts/manage_openclaw_plugin_packages.mjs` to generate published runtime
|
|
26
|
+
JS artifacts under `.openclaw/extensions/*/dist/`.
|
|
27
|
+
- Updated the `agent-wallet` OpenClaw bridge to auto-check the packaged runtime
|
|
28
|
+
path at `~/.openclaw/agent-wallet-runtime/current/agent-wallet` before local
|
|
29
|
+
workspace fallbacks, so a ClawHub-installed plugin can ride on top of the
|
|
30
|
+
existing npm runtime installer.
|
|
31
|
+
- Documented the dual-install model: keep `npx @agentlayer.tech/wallet install`
|
|
32
|
+
for runtime/bootstrap, and use `openclaw plugins install clawhub:...` for the
|
|
33
|
+
native OpenClaw plugin packages.
|
|
34
|
+
- Added a GitHub Actions workflow at `.github/workflows/clawhub-plugins.yml`
|
|
35
|
+
that can dry-run ClawHub publishes on pull requests and publish both OpenClaw
|
|
36
|
+
plugin packages on `v*` tags or manual dispatch.
|
|
37
|
+
|
|
5
38
|
## v0.1.14 - 2026-05-13
|
|
6
39
|
|
|
7
40
|
- Added a separate `.openclaw/extensions/pay-bridge/` plugin that keeps
|
package/README.md
CHANGED
|
@@ -51,6 +51,15 @@ Install through npm:
|
|
|
51
51
|
npx @agentlayer.tech/wallet install --yes
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
Install the native OpenClaw plugins from ClawHub:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
openclaw plugins install clawhub:@agentlayertech/agent-wallet-plugin
|
|
58
|
+
openclaw plugins install clawhub:@agentlayertech/pay-bridge-plugin
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Those ClawHub packages do not replace the npm installer. Keep `npx @agentlayer.tech/wallet install --yes` for laying down the local wallet runtime, Python backend, and helper services. The ClawHub packages only install the OpenClaw plugin surfaces that point at that runtime.
|
|
62
|
+
|
|
54
63
|
Or install the CLI globally first:
|
|
55
64
|
|
|
56
65
|
```bash
|
|
@@ -77,6 +86,29 @@ wallet update --yes
|
|
|
77
86
|
wallet rollback
|
|
78
87
|
```
|
|
79
88
|
|
|
89
|
+
## Native OpenClaw plugin installs
|
|
90
|
+
|
|
91
|
+
Use ClawHub when you want the plugin itself to be installed through OpenClaw:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
openclaw plugins install clawhub:@agentlayertech/agent-wallet-plugin
|
|
95
|
+
openclaw plugins install clawhub:@agentlayertech/pay-bridge-plugin
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Recommended order:
|
|
99
|
+
|
|
100
|
+
1. Install or update the local runtime with `npx @agentlayer.tech/wallet install --yes`.
|
|
101
|
+
2. Install the plugin package from ClawHub with `openclaw plugins install clawhub:...`.
|
|
102
|
+
3. Restart the OpenClaw gateway and enable/configure the plugin entry in `openclaw.json`.
|
|
103
|
+
|
|
104
|
+
The `agent-wallet` ClawHub plugin auto-checks the standard runtime path at:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
~/.openclaw/agent-wallet-runtime/current/agent-wallet
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
If your runtime lives elsewhere, set `plugins.entries.agent-wallet.config.packageRoot` explicitly.
|
|
111
|
+
|
|
80
112
|
Install from a local clone:
|
|
81
113
|
|
|
82
114
|
```bash
|
package/RELEASING.md
CHANGED
|
@@ -12,6 +12,13 @@ The public install command is:
|
|
|
12
12
|
npx @agentlayer.tech/wallet install --yes
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
The repo also ships two native OpenClaw plugin packages for ClawHub:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
@agentlayertech/agent-wallet-plugin
|
|
19
|
+
@agentlayertech/pay-bridge-plugin
|
|
20
|
+
```
|
|
21
|
+
|
|
15
22
|
## When npm Publishes
|
|
16
23
|
|
|
17
24
|
Normal commits and pushes do not publish new npm versions. They only run the
|
|
@@ -31,6 +38,9 @@ agent-wallet/pyproject.toml
|
|
|
31
38
|
```
|
|
32
39
|
|
|
33
40
|
If those versions do not match the tag, the workflow fails before publishing.
|
|
41
|
+
The same `v*` tag can also trigger the ClawHub plugin publish workflow, so keep
|
|
42
|
+
the root installer versions aligned with the ClawHub plugin package versions
|
|
43
|
+
when you want one GitHub release to ship both surfaces together.
|
|
34
44
|
|
|
35
45
|
## Stable Release
|
|
36
46
|
|
|
@@ -174,6 +184,66 @@ OpenClaw secrets
|
|
|
174
184
|
|
|
175
185
|
The package allowlist lives in `package.json` under `files`.
|
|
176
186
|
|
|
187
|
+
## ClawHub Plugin Packages
|
|
188
|
+
|
|
189
|
+
The OpenClaw plugin packages are published separately from the npm installer.
|
|
190
|
+
They are additive and do not replace `@agentlayer.tech/wallet`.
|
|
191
|
+
|
|
192
|
+
Before publishing either package, build and validate the runtime artifacts:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npm run build:openclaw-plugins
|
|
196
|
+
npm run check:openclaw-plugins
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Dry-run the package contents from each plugin directory:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
(cd .openclaw/extensions/agent-wallet && npm pack --dry-run)
|
|
203
|
+
(cd .openclaw/extensions/pay-bridge && npm pack --dry-run)
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Publish to ClawHub with the package-specific command documented by OpenClaw:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
clawhub package publish .openclaw/extensions/agent-wallet --dry-run
|
|
210
|
+
clawhub package publish .openclaw/extensions/agent-wallet
|
|
211
|
+
|
|
212
|
+
clawhub package publish .openclaw/extensions/pay-bridge --dry-run
|
|
213
|
+
clawhub package publish .openclaw/extensions/pay-bridge
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Users then install them natively through OpenClaw:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
openclaw plugins install clawhub:@agentlayertech/agent-wallet-plugin
|
|
220
|
+
openclaw plugins install clawhub:@agentlayertech/pay-bridge-plugin
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
GitHub Actions can publish the same packages automatically from tags and manual
|
|
224
|
+
dispatch through `.github/workflows/clawhub-plugins.yml`.
|
|
225
|
+
|
|
226
|
+
Required repository secret:
|
|
227
|
+
|
|
228
|
+
```text
|
|
229
|
+
CLAWHUB_TOKEN
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Workflow behavior:
|
|
233
|
+
|
|
234
|
+
- `pull_request`: packs both plugins and runs ClawHub `--dry-run`
|
|
235
|
+
- `workflow_dispatch`: publishes or dry-runs based on the `dry_run` input
|
|
236
|
+
- `push` on `v*` tags: publishes both plugins automatically
|
|
237
|
+
|
|
238
|
+
The workflow currently publishes:
|
|
239
|
+
|
|
240
|
+
- `.openclaw/extensions/agent-wallet` as `bundle-plugin`
|
|
241
|
+
- `.openclaw/extensions/pay-bridge` as `code-plugin`
|
|
242
|
+
|
|
243
|
+
`agent-wallet` stays on `bundle-plugin` because that package name was first
|
|
244
|
+
published to ClawHub with that family, and ClawHub does not allow family
|
|
245
|
+
changes for an existing package record.
|
|
246
|
+
|
|
177
247
|
## Runtime Layout
|
|
178
248
|
|
|
179
249
|
Installer releases are copied into the user's OpenClaw home:
|
|
@@ -214,3 +284,100 @@ https://github.com/lopushok9/Agent-Layer.git
|
|
|
214
284
|
|
|
215
285
|
Do not use `NPM_TOKEN` unless Trusted Publishing is unavailable. Token-based
|
|
216
286
|
publishes can fail with `EOTP` when npm requires two-factor authentication.
|
|
287
|
+
|
|
288
|
+
## ClawHub Release Workflow
|
|
289
|
+
|
|
290
|
+
This repo also includes a separate GitHub Actions workflow for the OpenClaw
|
|
291
|
+
plugin packages:
|
|
292
|
+
|
|
293
|
+
```text
|
|
294
|
+
.github/workflows/clawhub-plugins.yml
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
It publishes these ClawHub packages:
|
|
298
|
+
|
|
299
|
+
```text
|
|
300
|
+
@agentlayertech/agent-wallet-plugin
|
|
301
|
+
@agentlayertech/pay-bridge-plugin
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Triggers
|
|
305
|
+
|
|
306
|
+
- `pull_request`
|
|
307
|
+
- runs ClawHub publish in `--dry-run` mode for both plugin packages
|
|
308
|
+
- `workflow_dispatch`
|
|
309
|
+
- supports manual runs with a `dry_run` boolean input
|
|
310
|
+
- `push` on git tags matching `v*`
|
|
311
|
+
- publishes both plugin packages to ClawHub
|
|
312
|
+
|
|
313
|
+
### Required secret
|
|
314
|
+
|
|
315
|
+
The workflow requires this repository Actions secret:
|
|
316
|
+
|
|
317
|
+
```text
|
|
318
|
+
CLAWHUB_TOKEN
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
That token is created in the ClawHub web UI and must belong to an account with
|
|
322
|
+
publisher access to:
|
|
323
|
+
|
|
324
|
+
```text
|
|
325
|
+
@agentlayertech
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Family mapping
|
|
329
|
+
|
|
330
|
+
The workflow currently publishes:
|
|
331
|
+
|
|
332
|
+
- `.openclaw/extensions/agent-wallet` as `bundle-plugin`
|
|
333
|
+
- `.openclaw/extensions/pay-bridge` as `code-plugin`
|
|
334
|
+
|
|
335
|
+
`agent-wallet` remains on `bundle-plugin` because the package
|
|
336
|
+
`@agentlayertech/agent-wallet-plugin` was first created in ClawHub with that
|
|
337
|
+
family, and ClawHub does not allow family changes for an existing package name.
|
|
338
|
+
|
|
339
|
+
### Release flow with tags
|
|
340
|
+
|
|
341
|
+
If you want one git tag to publish both npm and ClawHub surfaces together:
|
|
342
|
+
|
|
343
|
+
1. Keep these versions aligned:
|
|
344
|
+
|
|
345
|
+
```text
|
|
346
|
+
package.json
|
|
347
|
+
agent-wallet/pyproject.toml
|
|
348
|
+
.openclaw/extensions/agent-wallet/package.json
|
|
349
|
+
.openclaw/extensions/pay-bridge/package.json
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
2. Commit the release version bump.
|
|
353
|
+
|
|
354
|
+
3. Push `main`.
|
|
355
|
+
|
|
356
|
+
4. Create and push the tag:
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
git tag -a v0.1.16 -m "v0.1.16"
|
|
360
|
+
git push origin v0.1.16
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
That tag will trigger:
|
|
364
|
+
|
|
365
|
+
- `.github/workflows/npm-installer.yml`
|
|
366
|
+
- `.github/workflows/clawhub-plugins.yml`
|
|
367
|
+
|
|
368
|
+
### Manual verification without publishing
|
|
369
|
+
|
|
370
|
+
To verify the ClawHub workflow and token without creating a new release:
|
|
371
|
+
|
|
372
|
+
1. Open GitHub Actions
|
|
373
|
+
2. Select `ClawHub plugins`
|
|
374
|
+
3. Click `Run workflow`
|
|
375
|
+
4. Choose branch `main`
|
|
376
|
+
5. Set `dry_run=true`
|
|
377
|
+
6. Run it
|
|
378
|
+
|
|
379
|
+
Expected result:
|
|
380
|
+
|
|
381
|
+
- both matrix jobs succeed
|
|
382
|
+
- ClawHub login succeeds
|
|
383
|
+
- both package publishes resolve in dry-run mode without uploading
|
|
@@ -65,6 +65,11 @@ HOUDINI_USER_IP=
|
|
|
65
65
|
HOUDINI_USER_AGENT=AgentLayer/0.1.12
|
|
66
66
|
HOUDINI_USER_TIMEZONE=UTC
|
|
67
67
|
|
|
68
|
+
# Flash Trade perps
|
|
69
|
+
FLASH_API_BASE_URL=
|
|
70
|
+
FLASH_SDK_BRIDGE_COMMAND=
|
|
71
|
+
FLASH_SDK_BRIDGE_MODE=real
|
|
72
|
+
|
|
68
73
|
# Kamino REST lending
|
|
69
74
|
KAMINO_API_BASE_URL=https://api.kamino.finance
|
|
70
75
|
KAMINO_PROGRAM_ID=KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD
|
package/agent-wallet/README.md
CHANGED
|
@@ -524,6 +524,30 @@ Operational notes:
|
|
|
524
524
|
- Jupiter `Portfolio` implementation remains in the backend, but the agent-facing tools are temporarily disabled.
|
|
525
525
|
- The Jupiter config fields and provider code are intentionally kept so these surfaces can be restored later without rebuilding the integration from scratch.
|
|
526
526
|
|
|
527
|
+
## Flash Trade coverage
|
|
528
|
+
|
|
529
|
+
Current Flash Trade integration is intentionally phase-scoped:
|
|
530
|
+
|
|
531
|
+
- read-only `markets` and `positions` hooks are now wired through the Solana backend and OpenClaw adapter
|
|
532
|
+
- the transport is provider-driven, so Flash can be added through `provider-gateway` without introducing a new wallet runtime
|
|
533
|
+
|
|
534
|
+
Operational notes:
|
|
535
|
+
|
|
536
|
+
- current agent-facing tools are `get_flash_trade_markets` and `get_flash_trade_positions`
|
|
537
|
+
- these reads are mainnet-only
|
|
538
|
+
- Flash perpetual opens/closes now follow the existing `preview -> prepare -> execute` approval model instead of a separate trading wallet flow
|
|
539
|
+
- Flash reads expect either hosted/self-hosted gateway routes on `PROVIDER_GATEWAY_URL` or a direct `FLASH_API_BASE_URL`
|
|
540
|
+
- if those HTTP routes are unavailable, the Solana backend now falls back to the local `flash-sdk-bridge` for market discovery and user-position discovery
|
|
541
|
+
- Phase 2 now also adds `flash_trade_open_position` and `flash_trade_close_position` in `preview` / `prepare` / `execute`
|
|
542
|
+
- those preview/prepare/execute flows are produced by a local bridge command configured via `FLASH_SDK_BRIDGE_COMMAND`
|
|
543
|
+
- the bridge is expected to return machine JSON on stdout; `agent-wallet/tests/smoke_flash_sdk_bridge.py` documents the minimal contract shape
|
|
544
|
+
- a repo-owned Node bridge now lives at `agent-wallet/scripts/flash-sdk-bridge/bridge.mjs`
|
|
545
|
+
- install its pinned SDK dependencies with `cd agent-wallet/scripts/flash-sdk-bridge && npm install`
|
|
546
|
+
- `FLASH_SDK_BRIDGE_MODE=mock` provides deterministic smoke behavior without SDK dependencies
|
|
547
|
+
- `FLASH_SDK_BRIDGE_MODE=real` now produces real Flash SDK quotes for preview and real versioned transaction builds for prepare/execute
|
|
548
|
+
- the backend locally verifies the provider-built Flash transaction, applies only the wallet signature, and requires a host-issued approval token before broadcast; tool-level `prepare` still strips signed transaction bytes before returning to the agent
|
|
549
|
+
- current real-mode constraints are intentionally narrow: mainnet only, same-collateral `market_symbol == collateral_symbol`, and whole-number leverage strings for opens
|
|
550
|
+
|
|
527
551
|
## Native staking coverage
|
|
528
552
|
|
|
529
553
|
Current native Solana staking integration now includes:
|
|
@@ -558,6 +582,20 @@ It forwards tool execution to the Python bridge CLI:
|
|
|
558
582
|
|
|
559
583
|
This keeps the official OpenClaw-facing layer in TypeScript while the actual wallet/security logic remains in the Python backend.
|
|
560
584
|
|
|
585
|
+
If you want OpenClaw to install the plugin through ClawHub instead of a repo-local path, use:
|
|
586
|
+
|
|
587
|
+
```bash
|
|
588
|
+
openclaw plugins install clawhub:@agentlayertech/agent-wallet-plugin
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
That native plugin package is additive. Keep the existing runtime installer for the actual wallet backend:
|
|
592
|
+
|
|
593
|
+
```bash
|
|
594
|
+
npx @agentlayer.tech/wallet install --yes
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
The ClawHub plugin package auto-checks `~/.openclaw/agent-wallet-runtime/current/agent-wallet` before it falls back to a local workspace checkout.
|
|
598
|
+
|
|
561
599
|
Public-safe helper scripts are available in `agent-wallet/scripts/`:
|
|
562
600
|
|
|
563
601
|
- `install_openclaw_local_config.py`
|
|
@@ -60,6 +60,10 @@ class Settings(BaseSettings):
|
|
|
60
60
|
houdini_user_ip: str = ""
|
|
61
61
|
houdini_user_agent: str = "AgentLayer/0.1.12"
|
|
62
62
|
houdini_user_timezone: str = "UTC"
|
|
63
|
+
flash_api_base_url: str = ""
|
|
64
|
+
flash_sdk_bridge_command: str = ""
|
|
65
|
+
flash_sdk_bridge_mode: str = "mock"
|
|
66
|
+
flash_sdk_bridge_timeout_seconds: float = 20.0
|
|
63
67
|
kamino_api_base_url: str = "https://api.kamino.finance"
|
|
64
68
|
kamino_program_id: str = "KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"
|
|
65
69
|
alchemy_api_key: str = ""
|