@0xsequence/guard 1.2.9 → 1.4.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.
|
@@ -148,6 +148,15 @@ class GuardSigner {
|
|
|
148
148
|
async getAddress() {
|
|
149
149
|
return this.address;
|
|
150
150
|
}
|
|
151
|
+
async buildDeployTransaction(_metadata) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
async predecorateSignedTransactions(_metadata) {
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
async decorateTransactions(bundle, _metadata) {
|
|
158
|
+
return bundle;
|
|
159
|
+
}
|
|
151
160
|
async requestSignature(id, _message, metadata, callbacks) {
|
|
152
161
|
if (!core.commons.isWalletSignRequestMetadata(metadata)) {
|
|
153
162
|
callbacks.onRejection('Expected Sequence-like metadata');
|
|
@@ -148,6 +148,15 @@ class GuardSigner {
|
|
|
148
148
|
async getAddress() {
|
|
149
149
|
return this.address;
|
|
150
150
|
}
|
|
151
|
+
async buildDeployTransaction(_metadata) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
async predecorateSignedTransactions(_metadata) {
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
async decorateTransactions(bundle, _metadata) {
|
|
158
|
+
return bundle;
|
|
159
|
+
}
|
|
151
160
|
async requestSignature(id, _message, metadata, callbacks) {
|
|
152
161
|
if (!core.commons.isWalletSignRequestMetadata(metadata)) {
|
|
153
162
|
callbacks.onRejection('Expected Sequence-like metadata');
|
|
@@ -144,6 +144,15 @@ class GuardSigner {
|
|
|
144
144
|
async getAddress() {
|
|
145
145
|
return this.address;
|
|
146
146
|
}
|
|
147
|
+
async buildDeployTransaction(_metadata) {
|
|
148
|
+
return undefined;
|
|
149
|
+
}
|
|
150
|
+
async predecorateSignedTransactions(_metadata) {
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
async decorateTransactions(bundle, _metadata) {
|
|
154
|
+
return bundle;
|
|
155
|
+
}
|
|
147
156
|
async requestSignature(id, _message, metadata, callbacks) {
|
|
148
157
|
if (!commons.isWalletSignRequestMetadata(metadata)) {
|
|
149
158
|
callbacks.onRejection('Expected Sequence-like metadata');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { signers, Status } from '@0xsequence/signhub';
|
|
2
2
|
import { BytesLike } from 'ethers';
|
|
3
|
+
import { commons } from '@0xsequence/core';
|
|
3
4
|
export declare class GuardSigner implements signers.SapientSigner {
|
|
4
5
|
readonly address: string;
|
|
5
6
|
readonly url: string;
|
|
@@ -9,12 +10,15 @@ export declare class GuardSigner implements signers.SapientSigner {
|
|
|
9
10
|
private requests;
|
|
10
11
|
constructor(address: string, url: string, appendSuffix?: boolean, onError?: ((err: Error) => void) | undefined);
|
|
11
12
|
getAddress(): Promise<string>;
|
|
12
|
-
|
|
13
|
+
buildDeployTransaction(_metadata: object): Promise<commons.transaction.TransactionBundle | undefined>;
|
|
14
|
+
predecorateSignedTransactions(_metadata: object): Promise<commons.transaction.SignedTransactionBundle[]>;
|
|
15
|
+
decorateTransactions(bundle: commons.transaction.IntendedTransactionBundle, _metadata: object): Promise<commons.transaction.IntendedTransactionBundle>;
|
|
16
|
+
requestSignature(id: string, _message: BytesLike, metadata: object, callbacks: {
|
|
13
17
|
onSignature: (signature: BytesLike) => void;
|
|
14
18
|
onRejection: (error: string) => void;
|
|
15
19
|
onStatus: (situation: string) => void;
|
|
16
20
|
}): Promise<boolean>;
|
|
17
|
-
notifyStatusChange(id: string, status: Status, metadata:
|
|
21
|
+
notifyStatusChange(id: string, status: Status, metadata: object): void;
|
|
18
22
|
private packMsgAndSig;
|
|
19
23
|
private keyOfRequest;
|
|
20
24
|
private evaluateRequest;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/guard",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
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": "1.
|
|
14
|
-
"@0xsequence/signhub": "1.
|
|
13
|
+
"@0xsequence/core": "1.4.0",
|
|
14
|
+
"@0xsequence/signhub": "1.4.0"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"src",
|
package/src/signer.ts
CHANGED
|
@@ -30,10 +30,25 @@ export class GuardSigner implements signers.SapientSigner {
|
|
|
30
30
|
return this.address
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
async buildDeployTransaction(_metadata: object): Promise<commons.transaction.TransactionBundle | undefined> {
|
|
34
|
+
return undefined
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async predecorateSignedTransactions(_metadata: object): Promise<commons.transaction.SignedTransactionBundle[]> {
|
|
38
|
+
return []
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async decorateTransactions(
|
|
42
|
+
bundle: commons.transaction.IntendedTransactionBundle,
|
|
43
|
+
_metadata: object
|
|
44
|
+
): Promise<commons.transaction.IntendedTransactionBundle> {
|
|
45
|
+
return bundle
|
|
46
|
+
}
|
|
47
|
+
|
|
33
48
|
async requestSignature(
|
|
34
49
|
id: string,
|
|
35
50
|
_message: BytesLike,
|
|
36
|
-
metadata:
|
|
51
|
+
metadata: object,
|
|
37
52
|
callbacks: {
|
|
38
53
|
onSignature: (signature: BytesLike) => void
|
|
39
54
|
onRejection: (error: string) => void
|
|
@@ -51,7 +66,7 @@ export class GuardSigner implements signers.SapientSigner {
|
|
|
51
66
|
return true
|
|
52
67
|
}
|
|
53
68
|
|
|
54
|
-
notifyStatusChange(id: string, status: Status, metadata:
|
|
69
|
+
notifyStatusChange(id: string, status: Status, metadata: object): void {
|
|
55
70
|
if (!this.requests.has(id)) return
|
|
56
71
|
|
|
57
72
|
if (!commons.isWalletSignRequestMetadata(metadata)) {
|