@0xsequence/guard 1.4.1 → 1.4.3
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/0xsequence-guard.cjs.dev.js +5 -2
- package/dist/0xsequence-guard.cjs.prod.js +5 -2
- package/dist/0xsequence-guard.esm.js +5 -2
- package/dist/declarations/src/guard.gen.d.ts +2 -1
- package/dist/declarations/src/signer.d.ts +4 -1
- package/package.json +5 -5
- package/src/guard.gen.ts +5 -3
- package/src/signer.ts +2 -2
|
@@ -89,7 +89,8 @@ class Guard {
|
|
|
89
89
|
return this.fetch(this.url('AuthMethods'), createHTTPRequest(args, headers)).then(res => {
|
|
90
90
|
return buildResponse(res).then(_data => {
|
|
91
91
|
return {
|
|
92
|
-
methods: _data.methods
|
|
92
|
+
methods: _data.methods,
|
|
93
|
+
active: _data.active
|
|
93
94
|
};
|
|
94
95
|
});
|
|
95
96
|
});
|
|
@@ -276,7 +277,9 @@ class GuardSigner {
|
|
|
276
277
|
}
|
|
277
278
|
});
|
|
278
279
|
}
|
|
279
|
-
return response
|
|
280
|
+
return _extends({}, response, {
|
|
281
|
+
methods: response.methods.map(parseAuthMethod)
|
|
282
|
+
});
|
|
280
283
|
}
|
|
281
284
|
async setPin(pin, proof) {
|
|
282
285
|
const signedProof = await signAuthUpdateProof(proof);
|
|
@@ -89,7 +89,8 @@ class Guard {
|
|
|
89
89
|
return this.fetch(this.url('AuthMethods'), createHTTPRequest(args, headers)).then(res => {
|
|
90
90
|
return buildResponse(res).then(_data => {
|
|
91
91
|
return {
|
|
92
|
-
methods: _data.methods
|
|
92
|
+
methods: _data.methods,
|
|
93
|
+
active: _data.active
|
|
93
94
|
};
|
|
94
95
|
});
|
|
95
96
|
});
|
|
@@ -276,7 +277,9 @@ class GuardSigner {
|
|
|
276
277
|
}
|
|
277
278
|
});
|
|
278
279
|
}
|
|
279
|
-
return response
|
|
280
|
+
return _extends({}, response, {
|
|
281
|
+
methods: response.methods.map(parseAuthMethod)
|
|
282
|
+
});
|
|
280
283
|
}
|
|
281
284
|
async setPin(pin, proof) {
|
|
282
285
|
const signedProof = await signAuthUpdateProof(proof);
|
|
@@ -85,7 +85,8 @@ class Guard {
|
|
|
85
85
|
return this.fetch(this.url('AuthMethods'), createHTTPRequest(args, headers)).then(res => {
|
|
86
86
|
return buildResponse(res).then(_data => {
|
|
87
87
|
return {
|
|
88
|
-
methods: _data.methods
|
|
88
|
+
methods: _data.methods,
|
|
89
|
+
active: _data.active
|
|
89
90
|
};
|
|
90
91
|
});
|
|
91
92
|
});
|
|
@@ -272,7 +273,9 @@ class GuardSigner {
|
|
|
272
273
|
}
|
|
273
274
|
});
|
|
274
275
|
}
|
|
275
|
-
return response
|
|
276
|
+
return _extends({}, response, {
|
|
277
|
+
methods: response.methods.map(parseAuthMethod)
|
|
278
|
+
});
|
|
276
279
|
}
|
|
277
280
|
async setPin(pin, proof) {
|
|
278
281
|
const signedProof = await signAuthUpdateProof(proof);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const WebRPCVersion = "v1";
|
|
2
2
|
export declare const WebRPCSchemaVersion = "v0.4.0";
|
|
3
|
-
export declare const WebRPCSchemaHash = "
|
|
3
|
+
export declare const WebRPCSchemaHash = "2e5d6a4c9b797598078365d7439f330bc7bbf29c";
|
|
4
4
|
export interface Version {
|
|
5
5
|
webrpcVersion: string;
|
|
6
6
|
schemaVersion: string;
|
|
@@ -100,6 +100,7 @@ export interface AuthMethodsArgs {
|
|
|
100
100
|
}
|
|
101
101
|
export interface AuthMethodsReturn {
|
|
102
102
|
methods: Array<string>;
|
|
103
|
+
active: boolean;
|
|
103
104
|
}
|
|
104
105
|
export interface SetPINArgs {
|
|
105
106
|
pin: string;
|
|
@@ -20,7 +20,10 @@ export declare class GuardSigner implements signers.SapientSigner {
|
|
|
20
20
|
onStatus: (situation: string) => void;
|
|
21
21
|
}): Promise<boolean>;
|
|
22
22
|
notifyStatusChange(_id: string, _status: Status, _metadata: object): void;
|
|
23
|
-
getAuthMethods(proof: OwnershipProof): Promise<
|
|
23
|
+
getAuthMethods(proof: OwnershipProof): Promise<{
|
|
24
|
+
methods: AuthMethod[];
|
|
25
|
+
active: boolean;
|
|
26
|
+
}>;
|
|
24
27
|
setPin(pin: string | undefined, proof: AuthUpdateProof): Promise<void>;
|
|
25
28
|
resetPin(proof: AuthUpdateProof): Promise<void>;
|
|
26
29
|
createTotp(proof: AuthUpdateProof): Promise<URL>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/guard",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
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,10 +10,10 @@
|
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"ethers": "^5.7.2",
|
|
13
|
-
"@0xsequence/account": "1.4.
|
|
14
|
-
"@0xsequence/core": "1.4.
|
|
15
|
-
"@0xsequence/signhub": "1.4.
|
|
16
|
-
"@0xsequence/utils": "1.4.
|
|
13
|
+
"@0xsequence/account": "1.4.3",
|
|
14
|
+
"@0xsequence/core": "1.4.3",
|
|
15
|
+
"@0xsequence/signhub": "1.4.3",
|
|
16
|
+
"@0xsequence/utils": "1.4.3"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"src",
|
package/src/guard.gen.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
// sequence-guard v0.4.0
|
|
2
|
+
// sequence-guard v0.4.0 2e5d6a4c9b797598078365d7439f330bc7bbf29c
|
|
3
3
|
// --
|
|
4
4
|
// Code generated by webrpc-gen@v0.12.x-dev with typescript@v0.10.0 generator. DO NOT EDIT.
|
|
5
5
|
//
|
|
@@ -12,7 +12,7 @@ export const WebRPCVersion = 'v1'
|
|
|
12
12
|
export const WebRPCSchemaVersion = 'v0.4.0'
|
|
13
13
|
|
|
14
14
|
// Schema hash generated from your RIDL schema
|
|
15
|
-
export const WebRPCSchemaHash = '
|
|
15
|
+
export const WebRPCSchemaHash = '2e5d6a4c9b797598078365d7439f330bc7bbf29c'
|
|
16
16
|
|
|
17
17
|
//
|
|
18
18
|
// Types
|
|
@@ -130,6 +130,7 @@ export interface AuthMethodsArgs {
|
|
|
130
130
|
|
|
131
131
|
export interface AuthMethodsReturn {
|
|
132
132
|
methods: Array<string>
|
|
133
|
+
active: boolean
|
|
133
134
|
}
|
|
134
135
|
export interface SetPINArgs {
|
|
135
136
|
pin: string
|
|
@@ -269,7 +270,8 @@ export class Guard implements Guard {
|
|
|
269
270
|
return this.fetch(this.url('AuthMethods'), createHTTPRequest(args, headers)).then(res => {
|
|
270
271
|
return buildResponse(res).then(_data => {
|
|
271
272
|
return {
|
|
272
|
-
methods: <Array<string>>_data.methods
|
|
273
|
+
methods: <Array<string>>_data.methods,
|
|
274
|
+
active: <boolean>_data.active
|
|
273
275
|
}
|
|
274
276
|
})
|
|
275
277
|
})
|
package/src/signer.ts
CHANGED
|
@@ -86,7 +86,7 @@ export class GuardSigner implements signers.SapientSigner {
|
|
|
86
86
|
|
|
87
87
|
notifyStatusChange(_id: string, _status: Status, _metadata: object): void {}
|
|
88
88
|
|
|
89
|
-
async getAuthMethods(proof: OwnershipProof): Promise<AuthMethod[]> {
|
|
89
|
+
async getAuthMethods(proof: OwnershipProof): Promise<{ methods: AuthMethod[]; active: boolean }> {
|
|
90
90
|
let response: AuthMethodsReturn
|
|
91
91
|
|
|
92
92
|
if ('jwt' in proof) {
|
|
@@ -104,7 +104,7 @@ export class GuardSigner implements signers.SapientSigner {
|
|
|
104
104
|
})
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
-
return response.methods.map(parseAuthMethod)
|
|
107
|
+
return { ...response, methods: response.methods.map(parseAuthMethod) }
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
async setPin(pin: string | undefined, proof: AuthUpdateProof): Promise<void> {
|