@haven_ai/signer 0.1.36-alpha.0 → 0.2.0-alpha.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/README.md +5 -2
- package/dist/cli.cjs +15 -5
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +15 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +17 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -3
- package/dist/index.d.ts +57 -3
- package/dist/index.js +16 -6
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -1149,10 +1149,12 @@ async function loadSignerCredentials(path = process.env.HAVEN_CREDENTIALS) {
|
|
|
1149
1149
|
if (path) return loadFromFile(path);
|
|
1150
1150
|
const envKey = stringField(process.env.HAVEN_DELEGATE_KEY);
|
|
1151
1151
|
if (envKey) {
|
|
1152
|
+
const accountAddress = readAccountAddressEnv(process.env);
|
|
1152
1153
|
return {
|
|
1153
1154
|
delegateKey: envKey,
|
|
1154
1155
|
agentId: stringField(process.env.HAVEN_AGENT_ID),
|
|
1155
|
-
|
|
1156
|
+
accountAddress,
|
|
1157
|
+
safeAddress: accountAddress,
|
|
1156
1158
|
chainId: chainIdField(process.env.HAVEN_CHAIN_ID, "HAVEN_CHAIN_ID"),
|
|
1157
1159
|
network: stringField(process.env.HAVEN_NETWORK),
|
|
1158
1160
|
x402BindingSigner: stringField(process.env.HAVEN_X402_BINDING_SIGNER)
|
|
@@ -1182,10 +1184,12 @@ async function loadFromFile(path) {
|
|
|
1182
1184
|
if (!delegateKey) {
|
|
1183
1185
|
throw new Error("Haven credentials are missing delegate_key \u2014 the edge signer needs it to sign.");
|
|
1184
1186
|
}
|
|
1187
|
+
const accountAddress = readAccountAddressField(raw);
|
|
1185
1188
|
return {
|
|
1186
1189
|
delegateKey,
|
|
1187
1190
|
agentId: stringField(raw.agent_id ?? raw.agentId),
|
|
1188
|
-
|
|
1191
|
+
accountAddress,
|
|
1192
|
+
safeAddress: accountAddress,
|
|
1189
1193
|
chainId: chainIdField(raw.chain_id ?? raw.chainId, "chain_id"),
|
|
1190
1194
|
network: stringField(raw.network),
|
|
1191
1195
|
x402BindingSigner: stringField(
|
|
@@ -1194,6 +1198,12 @@ async function loadFromFile(path) {
|
|
|
1194
1198
|
sourcePath: path
|
|
1195
1199
|
};
|
|
1196
1200
|
}
|
|
1201
|
+
function readAccountAddressField(raw) {
|
|
1202
|
+
return stringField(raw.account_address ?? raw.safe_address ?? raw.safeAddress);
|
|
1203
|
+
}
|
|
1204
|
+
function readAccountAddressEnv(env) {
|
|
1205
|
+
return stringField(env.HAVEN_ACCOUNT_ADDRESS ?? env.HAVEN_WALLET_ADDRESS ?? env.HAVEN_SAFE_ADDRESS);
|
|
1206
|
+
}
|
|
1197
1207
|
function stringField(value) {
|
|
1198
1208
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
1199
1209
|
}
|
|
@@ -1235,7 +1245,7 @@ async function warnIfCredentialFilePermissive(path, log = (message) => process.s
|
|
|
1235
1245
|
|
|
1236
1246
|
// src/server.ts
|
|
1237
1247
|
var SIGNER_NAME = "@haven_ai/signer";
|
|
1238
|
-
var SIGNER_VERSION = "0.
|
|
1248
|
+
var SIGNER_VERSION = "0.2.0-alpha.0";
|
|
1239
1249
|
async function resolveSignerRuntime(options = {}) {
|
|
1240
1250
|
assertSupportedNodeVersion(options.nodeVersion);
|
|
1241
1251
|
if (options.delegateKey) {
|
|
@@ -1270,7 +1280,7 @@ function buildSignerMcpServer(signer, options = {}) {
|
|
|
1270
1280
|
audit: {
|
|
1271
1281
|
auditPath: options.auditPath ?? defaultSigningAuditPath(credentialsPath),
|
|
1272
1282
|
delegateAddress: signer.delegateAddress,
|
|
1273
|
-
safeAddress: options.credentials?.safeAddress,
|
|
1283
|
+
safeAddress: options.credentials?.accountAddress ?? options.credentials?.safeAddress,
|
|
1274
1284
|
chainId: options.credentials?.chainId
|
|
1275
1285
|
},
|
|
1276
1286
|
// #1263: the payment_id signing path — the ONLY network call this server
|
|
@@ -1320,7 +1330,7 @@ async function runSignerConsentGate(signer, credentials, options) {
|
|
|
1320
1330
|
return ensureSignerConsent(
|
|
1321
1331
|
{
|
|
1322
1332
|
delegateAddress: signer.delegateAddress,
|
|
1323
|
-
safeAddress: credentials?.safeAddress,
|
|
1333
|
+
safeAddress: credentials?.accountAddress ?? credentials?.safeAddress,
|
|
1324
1334
|
agentId: credentials?.agentId,
|
|
1325
1335
|
chainId: credentials?.chainId,
|
|
1326
1336
|
network: credentials?.network,
|