@novasamatech/host-papp 0.5.0-10 → 0.5.0-11
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.
|
@@ -9,7 +9,7 @@ import type { SignPayloadRequest } from './scale/signPayloadRequest.js';
|
|
|
9
9
|
import type { SignPayloadResponse } from './scale/signPayloadResponse.js';
|
|
10
10
|
export type UserSession = StoredUserSession & {
|
|
11
11
|
sendDisconnectMessage(): ResultAsync<void, Error>;
|
|
12
|
-
signPayload(payload: SignPayloadRequest): ResultAsync<SignPayloadResponse, Error>;
|
|
12
|
+
signPayload(payload: SignPayloadRequest): ResultAsync<SignPayloadResponse['payload'], Error>;
|
|
13
13
|
subscribe(callback: Callback<CodecType<typeof RemoteMessageCodec>, ResultAsync<boolean, Error>>): VoidFunction;
|
|
14
14
|
dispose(): void;
|
|
15
15
|
};
|
|
@@ -39,15 +39,20 @@ export function createUserSession({ userSession, statementStore, encryption, sto
|
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
41
|
});
|
|
42
|
+
const responseFilter = (message) => {
|
|
43
|
+
return (message.data.tag === 'v1' &&
|
|
44
|
+
message.data.value.tag === 'SignResponse' &&
|
|
45
|
+
message.data.value.value.respondingTo === messageId);
|
|
46
|
+
};
|
|
42
47
|
return request
|
|
43
|
-
.andThen(() => session.waitForRequestMessage(RemoteMessageCodec,
|
|
48
|
+
.andThen(() => session.waitForRequestMessage(RemoteMessageCodec, responseFilter))
|
|
44
49
|
.andThen(message => {
|
|
45
50
|
const { data } = message.payload;
|
|
46
51
|
switch (data.tag) {
|
|
47
52
|
case 'v1': {
|
|
48
53
|
switch (data.value.tag) {
|
|
49
54
|
case 'SignResponse':
|
|
50
|
-
return ok(data.value.value);
|
|
55
|
+
return ok(data.value.value.payload);
|
|
51
56
|
default:
|
|
52
57
|
return err(new Error(`Incorrect sign response: ${data.value.tag}`));
|
|
53
58
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novasamatech/host-papp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.0-
|
|
4
|
+
"version": "0.5.0-11",
|
|
5
5
|
"description": "Polkadot app integration",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"@noble/ciphers": "2.1.1",
|
|
29
29
|
"@noble/curves": "2.0.1",
|
|
30
30
|
"@noble/hashes": "2.0.1",
|
|
31
|
-
"@novasamatech/host-api": "0.5.0-
|
|
32
|
-
"@novasamatech/statement-store": "0.5.0-
|
|
33
|
-
"@novasamatech/storage-adapter": "0.5.0-
|
|
31
|
+
"@novasamatech/host-api": "0.5.0-11",
|
|
32
|
+
"@novasamatech/statement-store": "0.5.0-11",
|
|
33
|
+
"@novasamatech/storage-adapter": "0.5.0-11",
|
|
34
34
|
"@polkadot-api/substrate-bindings": "^0.16.5",
|
|
35
35
|
"@polkadot-labs/hdkd-helpers": "^0.0.27",
|
|
36
36
|
"@scure/sr25519": "1.0.0",
|