@0xsequence/signhub
Advanced tools
Comparing version 0.0.0-20241114193556 to 0.0.0-20241216114019
@@ -44,2 +44,17 @@ 'use strict'; | ||
function _extends() { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
let SignerState = /*#__PURE__*/function (SignerState) { | ||
@@ -175,9 +190,20 @@ SignerState[SignerState["INITIAL"] = 0] = "INITIAL"; | ||
state: SignerState.SIGNING, | ||
request: s.sign(message, metadata != null ? metadata : {}).then(signature => { | ||
request: s.sign(message, metadata != null ? metadata : {}).then(async function (signature) { | ||
const suffix = s.suffix(); | ||
status.signers[saddr] = { | ||
let validationSignature; | ||
if (s.buildEIP6492Signature) { | ||
try { | ||
validationSignature = await s.buildEIP6492Signature(signature); | ||
} catch (e) { | ||
// Log and ignore | ||
console.warn(`signer ${saddr} failed to build validation signature: ${e}`); | ||
} | ||
} | ||
status.signers[saddr] = _extends({ | ||
state: SignerState.SIGNED, | ||
signature, | ||
suffix | ||
}; | ||
suffix, | ||
signature | ||
}, validationSignature && { | ||
validationSignature | ||
}); | ||
onStatusUpdate(); | ||
@@ -184,0 +210,0 @@ return signature; |
@@ -44,2 +44,17 @@ 'use strict'; | ||
function _extends() { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
let SignerState = /*#__PURE__*/function (SignerState) { | ||
@@ -175,9 +190,20 @@ SignerState[SignerState["INITIAL"] = 0] = "INITIAL"; | ||
state: SignerState.SIGNING, | ||
request: s.sign(message, metadata != null ? metadata : {}).then(signature => { | ||
request: s.sign(message, metadata != null ? metadata : {}).then(async function (signature) { | ||
const suffix = s.suffix(); | ||
status.signers[saddr] = { | ||
let validationSignature; | ||
if (s.buildEIP6492Signature) { | ||
try { | ||
validationSignature = await s.buildEIP6492Signature(signature); | ||
} catch (e) { | ||
// Log and ignore | ||
console.warn(`signer ${saddr} failed to build validation signature: ${e}`); | ||
} | ||
} | ||
status.signers[saddr] = _extends({ | ||
state: SignerState.SIGNED, | ||
signature, | ||
suffix | ||
}; | ||
suffix, | ||
signature | ||
}, validationSignature && { | ||
validationSignature | ||
}); | ||
onStatusUpdate(); | ||
@@ -184,0 +210,0 @@ return signature; |
@@ -40,2 +40,17 @@ import { ethers } from 'ethers'; | ||
function _extends() { | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
let SignerState = /*#__PURE__*/function (SignerState) { | ||
@@ -171,9 +186,20 @@ SignerState[SignerState["INITIAL"] = 0] = "INITIAL"; | ||
state: SignerState.SIGNING, | ||
request: s.sign(message, metadata != null ? metadata : {}).then(signature => { | ||
request: s.sign(message, metadata != null ? metadata : {}).then(async function (signature) { | ||
const suffix = s.suffix(); | ||
status.signers[saddr] = { | ||
let validationSignature; | ||
if (s.buildEIP6492Signature) { | ||
try { | ||
validationSignature = await s.buildEIP6492Signature(signature); | ||
} catch (e) { | ||
// Log and ignore | ||
console.warn(`signer ${saddr} failed to build validation signature: ${e}`); | ||
} | ||
} | ||
status.signers[saddr] = _extends({ | ||
state: SignerState.SIGNED, | ||
signature, | ||
suffix | ||
}; | ||
suffix, | ||
signature | ||
}, validationSignature && { | ||
validationSignature | ||
}); | ||
onStatusUpdate(); | ||
@@ -180,0 +206,0 @@ return signature; |
@@ -26,2 +26,3 @@ import { ethers } from 'ethers'; | ||
suffix: ethers.BytesLike; | ||
validationSignature?: ethers.BytesLike; | ||
} | { | ||
@@ -28,0 +29,0 @@ state: SignerState.ERROR; |
@@ -20,2 +20,6 @@ import { ethers } from 'ethers'; | ||
/** | ||
* Build a validation signature for an undeployed contract signer. | ||
*/ | ||
buildEIP6492Signature?(signature: ethers.BytesLike): Promise<ethers.BytesLike | undefined>; | ||
/** | ||
* Notify the signer of a status change. | ||
@@ -22,0 +26,0 @@ */ |
{ | ||
"name": "@0xsequence/signhub", | ||
"version": "0.0.0-20241114193556", | ||
"version": "0.0.0-20241216114019", | ||
"description": "orchestrates a series of signers, provides visibility into the signing process, and to the signers themselves", | ||
@@ -15,3 +15,3 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/signhub", | ||
"dependencies": { | ||
"@0xsequence/core": "0.0.0-20241114193556" | ||
"@0xsequence/core": "0.0.0-20241216114019" | ||
}, | ||
@@ -18,0 +18,0 @@ "devDependencies": { |
@@ -22,3 +22,3 @@ import { ethers } from 'ethers' | ||
| { state: SignerState.SIGNING; request: Promise<ethers.BytesLike> } | ||
| { state: SignerState.SIGNED; signature: ethers.BytesLike; suffix: ethers.BytesLike } | ||
| { state: SignerState.SIGNED; signature: ethers.BytesLike; suffix: ethers.BytesLike; validationSignature?: ethers.BytesLike } | ||
| { state: SignerState.ERROR; error: any } | ||
@@ -187,5 +187,19 @@ | ||
.sign(message, metadata ?? {}) | ||
.then(signature => { | ||
.then(async signature => { | ||
const suffix = s.suffix() | ||
status.signers[saddr] = { state: SignerState.SIGNED, signature, suffix } | ||
let validationSignature | ||
if (s.buildEIP6492Signature) { | ||
try { | ||
validationSignature = await s.buildEIP6492Signature(signature) | ||
} catch (e) { | ||
// Log and ignore | ||
console.warn(`signer ${saddr} failed to build validation signature: ${e}`) | ||
} | ||
} | ||
status.signers[saddr] = { | ||
state: SignerState.SIGNED, | ||
suffix, | ||
signature, | ||
...(validationSignature && { validationSignature }) | ||
} | ||
onStatusUpdate() | ||
@@ -192,0 +206,0 @@ return signature |
@@ -29,2 +29,7 @@ import { ethers } from 'ethers' | ||
/** | ||
* Build a validation signature for an undeployed contract signer. | ||
*/ | ||
buildEIP6492Signature?(signature: ethers.BytesLike): Promise<ethers.BytesLike | undefined>; | ||
/** | ||
* Notify the signer of a status change. | ||
@@ -31,0 +36,0 @@ */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53160
1095
+ Added@0xsequence/abi@0.0.0-20241216114019(transitive)
+ Added@0xsequence/core@0.0.0-20241216114019(transitive)
+ Added@0xsequence/utils@0.0.0-20241216114019(transitive)
- Removed@0xsequence/abi@0.0.0-20241114193556(transitive)
- Removed@0xsequence/core@0.0.0-20241114193556(transitive)
- Removed@0xsequence/utils@0.0.0-20241114193556(transitive)