@haven_ai/signer 0.1.37-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/dist/index.cjs CHANGED
@@ -503,10 +503,12 @@ async function loadSignerCredentials(path = process.env.HAVEN_CREDENTIALS) {
503
503
  if (path) return loadFromFile(path);
504
504
  const envKey = stringField(process.env.HAVEN_DELEGATE_KEY);
505
505
  if (envKey) {
506
+ const accountAddress = readAccountAddressEnv(process.env);
506
507
  return {
507
508
  delegateKey: envKey,
508
509
  agentId: stringField(process.env.HAVEN_AGENT_ID),
509
- safeAddress: stringField(process.env.HAVEN_SAFE_ADDRESS),
510
+ accountAddress,
511
+ safeAddress: accountAddress,
510
512
  chainId: chainIdField(process.env.HAVEN_CHAIN_ID, "HAVEN_CHAIN_ID"),
511
513
  network: stringField(process.env.HAVEN_NETWORK),
512
514
  x402BindingSigner: stringField(process.env.HAVEN_X402_BINDING_SIGNER)
@@ -536,10 +538,12 @@ async function loadFromFile(path) {
536
538
  if (!delegateKey) {
537
539
  throw new Error("Haven credentials are missing delegate_key \u2014 the edge signer needs it to sign.");
538
540
  }
541
+ const accountAddress = readAccountAddressField(raw);
539
542
  return {
540
543
  delegateKey,
541
544
  agentId: stringField(raw.agent_id ?? raw.agentId),
542
- safeAddress: stringField(raw.safe_address ?? raw.safeAddress),
545
+ accountAddress,
546
+ safeAddress: accountAddress,
543
547
  chainId: chainIdField(raw.chain_id ?? raw.chainId, "chain_id"),
544
548
  network: stringField(raw.network),
545
549
  x402BindingSigner: stringField(
@@ -548,6 +552,12 @@ async function loadFromFile(path) {
548
552
  sourcePath: path
549
553
  };
550
554
  }
555
+ function readAccountAddressField(raw) {
556
+ return stringField(raw.account_address ?? raw.safe_address ?? raw.safeAddress);
557
+ }
558
+ function readAccountAddressEnv(env) {
559
+ return stringField(env.HAVEN_ACCOUNT_ADDRESS ?? env.HAVEN_WALLET_ADDRESS ?? env.HAVEN_SAFE_ADDRESS);
560
+ }
551
561
  function stringField(value) {
552
562
  return typeof value === "string" && value.trim() ? value.trim() : void 0;
553
563
  }
@@ -1233,7 +1243,7 @@ async function writeAckFile(path$1, hash) {
1233
1243
  );
1234
1244
  }
1235
1245
  var SIGNER_NAME = "@haven_ai/signer";
1236
- var SIGNER_VERSION = "0.1.37-alpha.0";
1246
+ var SIGNER_VERSION = "0.2.0-alpha.0";
1237
1247
  async function resolveEdgeSigner(options = {}) {
1238
1248
  const { signer } = await resolveSignerRuntime(options);
1239
1249
  return signer;
@@ -1272,7 +1282,7 @@ function buildSignerMcpServer(signer, options = {}) {
1272
1282
  audit: {
1273
1283
  auditPath: options.auditPath ?? defaultSigningAuditPath(credentialsPath),
1274
1284
  delegateAddress: signer.delegateAddress,
1275
- safeAddress: options.credentials?.safeAddress,
1285
+ safeAddress: options.credentials?.accountAddress ?? options.credentials?.safeAddress,
1276
1286
  chainId: options.credentials?.chainId
1277
1287
  },
1278
1288
  // #1263: the payment_id signing path — the ONLY network call this server
@@ -1322,7 +1332,7 @@ async function runSignerConsentGate(signer, credentials, options) {
1322
1332
  return ensureSignerConsent(
1323
1333
  {
1324
1334
  delegateAddress: signer.delegateAddress,
1325
- safeAddress: credentials?.safeAddress,
1335
+ safeAddress: credentials?.accountAddress ?? credentials?.safeAddress,
1326
1336
  agentId: credentials?.agentId,
1327
1337
  chainId: credentials?.chainId,
1328
1338
  network: credentials?.network,
@@ -1362,6 +1372,8 @@ exports.defaultSigningAuditPath = defaultSigningAuditPath;
1362
1372
  exports.ensureSignerConsent = ensureSignerConsent;
1363
1373
  exports.hashPayloadForAudit = hashPayloadForAudit;
1364
1374
  exports.loadSignerCredentials = loadSignerCredentials;
1375
+ exports.readAccountAddressEnv = readAccountAddressEnv;
1376
+ exports.readAccountAddressField = readAccountAddressField;
1365
1377
  exports.renderSignerConsentBlock = renderSignerConsentBlock;
1366
1378
  exports.resolveEdgeSigner = resolveEdgeSigner;
1367
1379
  exports.resolveSignerRuntime = resolveSignerRuntime;