@0xsequence/guard 0.0.0-20230825151821 → 0.0.0-20230901183931
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/package.json +3 -3
- package/src/signer.ts +4 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/guard",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-20230901183931",
|
|
4
4
|
"description": "guard sub-package for Sequence",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/guard",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"ethers": "^5.7.2",
|
|
13
|
-
"@0xsequence/core": "0.0.0-
|
|
14
|
-
"@0xsequence/signhub": "0.0.0-
|
|
13
|
+
"@0xsequence/core": "0.0.0-20230901183931",
|
|
14
|
+
"@0xsequence/signhub": "0.0.0-20230901183931"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"src",
|
package/src/signer.ts
CHANGED
|
@@ -20,7 +20,8 @@ export class GuardSigner implements signers.SapientSigner {
|
|
|
20
20
|
constructor(
|
|
21
21
|
public readonly address: string,
|
|
22
22
|
public readonly url: string,
|
|
23
|
-
public readonly appendSuffix: boolean = false
|
|
23
|
+
public readonly appendSuffix: boolean = false,
|
|
24
|
+
private readonly onError?: (err: Error) => void
|
|
24
25
|
) {
|
|
25
26
|
this.guard = new Guard(url, fetch)
|
|
26
27
|
}
|
|
@@ -105,8 +106,8 @@ export class GuardSigner implements signers.SapientSigner {
|
|
|
105
106
|
} catch (e) {
|
|
106
107
|
// The guard signer may reject the request for a number of reasons
|
|
107
108
|
// like for example, if it's being the first signer (it waits for other signers to sign first)
|
|
108
|
-
//
|
|
109
|
-
|
|
109
|
+
// We always forward the error here and filter on client side.
|
|
110
|
+
this.onError?.(e)
|
|
110
111
|
}
|
|
111
112
|
}
|
|
112
113
|
|