@novasamatech/host-api 0.5.4 → 0.6.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.
- package/README.md +27 -2
- package/dist/hostApi.d.ts +2 -1
- package/dist/hostApi.js +117 -34
- package/dist/index.d.ts +8 -2
- package/dist/index.js +8 -2
- package/dist/protocol/impl.d.ts +80 -59
- package/dist/protocol/impl.js +64 -36
- package/dist/protocol/messageCodec.d.ts +307 -177
- package/dist/protocol/v1/accounts.d.ts +3 -0
- package/dist/protocol/v1/accounts.js +5 -1
- package/dist/protocol/v1/chat.d.ts +72 -31
- package/dist/protocol/v1/chat.js +9 -0
- package/dist/protocol/v1/customRenderer.d.ts +143 -0
- package/dist/protocol/v1/customRenderer.js +82 -0
- package/dist/protocol/v1/devicePermission.d.ts +5 -0
- package/dist/protocol/v1/devicePermission.js +6 -0
- package/dist/protocol/v1/localStorage.d.ts +31 -0
- package/dist/protocol/v1/localStorage.js +17 -0
- package/dist/protocol/v1/navigation.d.ts +21 -0
- package/dist/protocol/v1/navigation.js +9 -0
- package/dist/protocol/v1/notification.d.ts +11 -0
- package/dist/protocol/v1/notification.js +8 -0
- package/dist/protocol/v1/preimage.d.ts +24 -0
- package/dist/protocol/v1/preimage.js +12 -0
- package/dist/protocol/v1/remotePermission.d.ts +17 -0
- package/dist/protocol/v1/remotePermission.js +9 -0
- package/dist/protocol/v1/sign.js +5 -4
- package/dist/protocol/v1/statementStore.d.ts +0 -36
- package/dist/protocol/v1/statementStore.js +1 -3
- package/dist/transport.js +12 -4
- package/package.json +3 -3
package/dist/protocol/impl.d.ts
CHANGED
|
@@ -16,12 +16,12 @@ export type VersionedProtocolSubscription<T extends VersionedArguments = Version
|
|
|
16
16
|
};
|
|
17
17
|
export type HostApiProtocol = typeof hostApiProtocol;
|
|
18
18
|
export declare const hostApiProtocol: {
|
|
19
|
-
readonly
|
|
19
|
+
readonly host_handshake: VersionedProtocolRequest<{
|
|
20
20
|
readonly v1: [Codec<number>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
21
21
|
reason: string;
|
|
22
22
|
}, "HandshakeErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::Timeout"> | import("@novasamatech/scale").CodecError<undefined, "HandshakeErr::UnsupportedProtocolVersion">>>];
|
|
23
23
|
}>;
|
|
24
|
-
readonly
|
|
24
|
+
readonly host_feature_supported: VersionedProtocolRequest<{
|
|
25
25
|
readonly v1: [Codec<{
|
|
26
26
|
tag: "Chain";
|
|
27
27
|
value: `0x${string}`;
|
|
@@ -29,22 +29,54 @@ export declare const hostApiProtocol: {
|
|
|
29
29
|
reason: string;
|
|
30
30
|
}, "GenericError">>>];
|
|
31
31
|
}>;
|
|
32
|
-
readonly
|
|
32
|
+
readonly host_push_notification: VersionedProtocolRequest<{
|
|
33
|
+
readonly v1: [Codec<{
|
|
34
|
+
text: string;
|
|
35
|
+
deeplink: string | undefined;
|
|
36
|
+
}>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
37
|
+
reason: string;
|
|
38
|
+
}, "GenericError">>>];
|
|
39
|
+
}>;
|
|
40
|
+
readonly host_navigate_to: VersionedProtocolRequest<{
|
|
41
|
+
readonly v1: [Codec<string>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
42
|
+
reason: string;
|
|
43
|
+
}, "NavigateToErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "NavigateToErr::PermissionDenied">>>];
|
|
44
|
+
}>;
|
|
45
|
+
readonly host_device_permission: VersionedProtocolRequest<{
|
|
46
|
+
readonly v1: [Codec<"Camera" | "Microphone" | "Bluetooth" | "Location">, Codec<import("scale-ts").ResultPayload<boolean, import("@novasamatech/scale").CodecError<{
|
|
47
|
+
reason: string;
|
|
48
|
+
}, "GenericError">>>];
|
|
49
|
+
}>;
|
|
50
|
+
readonly remote_permission: VersionedProtocolRequest<{
|
|
51
|
+
readonly v1: [Codec<{
|
|
52
|
+
tag: "ExternalRequest";
|
|
53
|
+
value: string;
|
|
54
|
+
} | {
|
|
55
|
+
tag: "TransactionSubmit";
|
|
56
|
+
value: undefined;
|
|
57
|
+
}>, Codec<import("scale-ts").ResultPayload<boolean, import("@novasamatech/scale").CodecError<{
|
|
58
|
+
reason: string;
|
|
59
|
+
}, "GenericError">>>];
|
|
60
|
+
}>;
|
|
61
|
+
readonly host_local_storage_read: VersionedProtocolRequest<{
|
|
33
62
|
readonly v1: [Codec<string>, Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike> | undefined, import("@novasamatech/scale").CodecError<{
|
|
34
63
|
reason: string;
|
|
35
64
|
}, "StorageErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StorageErr::Full">>>];
|
|
36
65
|
}>;
|
|
37
|
-
readonly
|
|
66
|
+
readonly host_local_storage_write: VersionedProtocolRequest<{
|
|
38
67
|
readonly v1: [Codec<[string, Uint8Array<ArrayBufferLike>]>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
39
68
|
reason: string;
|
|
40
69
|
}, "StorageErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StorageErr::Full">>>];
|
|
41
70
|
}>;
|
|
42
|
-
readonly
|
|
71
|
+
readonly host_local_storage_clear: VersionedProtocolRequest<{
|
|
43
72
|
readonly v1: [Codec<string>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
44
73
|
reason: string;
|
|
45
74
|
}, "StorageErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StorageErr::Full">>>];
|
|
46
75
|
}>;
|
|
47
|
-
readonly
|
|
76
|
+
readonly host_account_connection_status_subscribe: VersionedProtocolSubscription<{
|
|
77
|
+
readonly v1: [Codec<undefined>, Codec<"disconnected" | "connected">];
|
|
78
|
+
}>;
|
|
79
|
+
readonly host_account_get: VersionedProtocolRequest<{
|
|
48
80
|
readonly v1: [Codec<[string, number]>, Codec<import("scale-ts").ResultPayload<{
|
|
49
81
|
publicKey: Uint8Array<ArrayBufferLike>;
|
|
50
82
|
name: string | undefined;
|
|
@@ -52,7 +84,7 @@ export declare const hostApiProtocol: {
|
|
|
52
84
|
reason: string;
|
|
53
85
|
}, "RequestCredentialsErr::Unknown">>>];
|
|
54
86
|
}>;
|
|
55
|
-
readonly
|
|
87
|
+
readonly host_account_get_alias: VersionedProtocolRequest<{
|
|
56
88
|
readonly v1: [Codec<[string, number]>, Codec<import("scale-ts").ResultPayload<{
|
|
57
89
|
context: Uint8Array<ArrayBufferLike>;
|
|
58
90
|
alias: Uint8Array<ArrayBufferLike>;
|
|
@@ -60,7 +92,7 @@ export declare const hostApiProtocol: {
|
|
|
60
92
|
reason: string;
|
|
61
93
|
}, "RequestCredentialsErr::Unknown">>>];
|
|
62
94
|
}>;
|
|
63
|
-
readonly
|
|
95
|
+
readonly host_account_create_proof: VersionedProtocolRequest<{
|
|
64
96
|
readonly v1: [Codec<[[string, number], {
|
|
65
97
|
genesisHash: `0x${string}`;
|
|
66
98
|
ringRootHash: `0x${string}`;
|
|
@@ -71,7 +103,7 @@ export declare const hostApiProtocol: {
|
|
|
71
103
|
reason: string;
|
|
72
104
|
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound">>>];
|
|
73
105
|
}>;
|
|
74
|
-
readonly
|
|
106
|
+
readonly host_get_non_product_accounts: VersionedProtocolRequest<{
|
|
75
107
|
readonly v1: [Codec<undefined>, Codec<import("scale-ts").ResultPayload<{
|
|
76
108
|
publicKey: Uint8Array<ArrayBufferLike>;
|
|
77
109
|
name: string | undefined;
|
|
@@ -79,17 +111,17 @@ export declare const hostApiProtocol: {
|
|
|
79
111
|
reason: string;
|
|
80
112
|
}, "RequestCredentialsErr::Unknown">>>];
|
|
81
113
|
}>;
|
|
82
|
-
readonly
|
|
114
|
+
readonly host_create_transaction: VersionedProtocolRequest<{
|
|
83
115
|
readonly v1: [Codec<[[string, number], import("./v1/createTransaction.js").TxPayloadV1Public]>, Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
84
116
|
reason: string;
|
|
85
117
|
}, "CreateTransactionErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::FailedToDecode"> | import("@novasamatech/scale").CodecError<string, "CreateTransactionErr::NotSupported">>>];
|
|
86
118
|
}>;
|
|
87
|
-
readonly
|
|
119
|
+
readonly host_create_transaction_with_non_product_account: VersionedProtocolRequest<{
|
|
88
120
|
readonly v1: [Codec<import("./v1/createTransaction.js").TxPayloadV1Public>, Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
89
121
|
reason: string;
|
|
90
122
|
}, "CreateTransactionErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::FailedToDecode"> | import("@novasamatech/scale").CodecError<string, "CreateTransactionErr::NotSupported">>>];
|
|
91
123
|
}>;
|
|
92
|
-
readonly
|
|
124
|
+
readonly host_sign_raw: VersionedProtocolRequest<{
|
|
93
125
|
readonly v1: [Codec<{
|
|
94
126
|
address: string;
|
|
95
127
|
data: {
|
|
@@ -106,7 +138,7 @@ export declare const hostApiProtocol: {
|
|
|
106
138
|
reason: string;
|
|
107
139
|
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
108
140
|
}>;
|
|
109
|
-
readonly
|
|
141
|
+
readonly host_sign_payload: VersionedProtocolRequest<{
|
|
110
142
|
readonly v1: [Codec<{
|
|
111
143
|
address: string;
|
|
112
144
|
blockHash: `0x${string}`;
|
|
@@ -131,7 +163,7 @@ export declare const hostApiProtocol: {
|
|
|
131
163
|
reason: string;
|
|
132
164
|
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
133
165
|
}>;
|
|
134
|
-
readonly
|
|
166
|
+
readonly host_chat_create_room: VersionedProtocolRequest<{
|
|
135
167
|
readonly v1: [Codec<{
|
|
136
168
|
roomId: string;
|
|
137
169
|
name: string;
|
|
@@ -142,7 +174,7 @@ export declare const hostApiProtocol: {
|
|
|
142
174
|
reason: string;
|
|
143
175
|
}, "ChatRoomRegistrationErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "ChatRoomRegistrationErr::PermissionDenied">>>];
|
|
144
176
|
}>;
|
|
145
|
-
readonly
|
|
177
|
+
readonly host_chat_register_bot: VersionedProtocolRequest<{
|
|
146
178
|
readonly v1: [Codec<{
|
|
147
179
|
botId: string;
|
|
148
180
|
name: string;
|
|
@@ -153,13 +185,13 @@ export declare const hostApiProtocol: {
|
|
|
153
185
|
reason: string;
|
|
154
186
|
}, "ChatBotRegistrationErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "ChatBotRegistrationErr::PermissionDenied">>>];
|
|
155
187
|
}>;
|
|
156
|
-
readonly
|
|
188
|
+
readonly host_chat_list_subscribe: VersionedProtocolSubscription<{
|
|
157
189
|
readonly v1: [Codec<undefined>, Codec<{
|
|
158
190
|
roomId: string;
|
|
159
191
|
participatingAs: "RoomHost" | "Bot";
|
|
160
192
|
}[]>];
|
|
161
193
|
}>;
|
|
162
|
-
readonly
|
|
194
|
+
readonly host_chat_post_message: VersionedProtocolRequest<{
|
|
163
195
|
readonly v1: [Codec<{
|
|
164
196
|
roomId: string;
|
|
165
197
|
payload: {
|
|
@@ -204,6 +236,12 @@ export declare const hostApiProtocol: {
|
|
|
204
236
|
messageId: string;
|
|
205
237
|
emoji: string;
|
|
206
238
|
};
|
|
239
|
+
} | {
|
|
240
|
+
tag: "Custom";
|
|
241
|
+
value: {
|
|
242
|
+
messageType: string;
|
|
243
|
+
payload: Uint8Array<ArrayBufferLike>;
|
|
244
|
+
};
|
|
207
245
|
};
|
|
208
246
|
}>, Codec<import("scale-ts").ResultPayload<{
|
|
209
247
|
messageId: string;
|
|
@@ -211,7 +249,7 @@ export declare const hostApiProtocol: {
|
|
|
211
249
|
reason: string;
|
|
212
250
|
}, "ChatMessagePostingErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "ChatMessagePostingErr::MessageTooLarge">>>];
|
|
213
251
|
}>;
|
|
214
|
-
readonly
|
|
252
|
+
readonly host_chat_action_subscribe: VersionedProtocolSubscription<{
|
|
215
253
|
readonly v1: [Codec<undefined>, Codec<{
|
|
216
254
|
roomId: string;
|
|
217
255
|
peer: string;
|
|
@@ -259,6 +297,12 @@ export declare const hostApiProtocol: {
|
|
|
259
297
|
messageId: string;
|
|
260
298
|
emoji: string;
|
|
261
299
|
};
|
|
300
|
+
} | {
|
|
301
|
+
tag: "Custom";
|
|
302
|
+
value: {
|
|
303
|
+
messageType: string;
|
|
304
|
+
payload: Uint8Array<ArrayBufferLike>;
|
|
305
|
+
};
|
|
262
306
|
};
|
|
263
307
|
} | {
|
|
264
308
|
tag: "ActionTriggered";
|
|
@@ -276,44 +320,13 @@ export declare const hostApiProtocol: {
|
|
|
276
320
|
};
|
|
277
321
|
}>];
|
|
278
322
|
}>;
|
|
279
|
-
readonly
|
|
280
|
-
readonly v1: [Codec<
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
signature: Uint8Array<ArrayBufferLike>;
|
|
285
|
-
signer: Uint8Array<ArrayBufferLike>;
|
|
286
|
-
};
|
|
287
|
-
} | {
|
|
288
|
-
tag: "Ed25519";
|
|
289
|
-
value: {
|
|
290
|
-
signature: Uint8Array<ArrayBufferLike>;
|
|
291
|
-
signer: Uint8Array<ArrayBufferLike>;
|
|
292
|
-
};
|
|
293
|
-
} | {
|
|
294
|
-
tag: "Ecdsa";
|
|
295
|
-
value: {
|
|
296
|
-
signature: Uint8Array<ArrayBufferLike>;
|
|
297
|
-
signer: Uint8Array<ArrayBufferLike>;
|
|
298
|
-
};
|
|
299
|
-
} | {
|
|
300
|
-
tag: "OnChain";
|
|
301
|
-
value: {
|
|
302
|
-
who: Uint8Array<ArrayBufferLike>;
|
|
303
|
-
blockHash: Uint8Array<ArrayBufferLike>;
|
|
304
|
-
event: bigint;
|
|
305
|
-
};
|
|
306
|
-
};
|
|
307
|
-
decryptionKey: Uint8Array<ArrayBufferLike> | undefined;
|
|
308
|
-
priority: number | undefined;
|
|
309
|
-
channel: Uint8Array<ArrayBufferLike> | undefined;
|
|
310
|
-
topics: Uint8Array<ArrayBufferLike>[];
|
|
311
|
-
data: Uint8Array<ArrayBufferLike> | undefined;
|
|
312
|
-
}[], import("@novasamatech/scale").CodecError<{
|
|
313
|
-
reason: string;
|
|
314
|
-
}, "GenericError">>>];
|
|
323
|
+
readonly product_chat_custom_message_render_subscribe: VersionedProtocolSubscription<{
|
|
324
|
+
readonly v1: [Codec<{
|
|
325
|
+
messageType: string;
|
|
326
|
+
payload: Uint8Array<ArrayBufferLike>;
|
|
327
|
+
}>, Codec<import("./v1/customRenderer.js").CustomRendererNodeType>];
|
|
315
328
|
}>;
|
|
316
|
-
readonly
|
|
329
|
+
readonly remote_statement_store_subscribe: VersionedProtocolSubscription<{
|
|
317
330
|
readonly v1: [Codec<Uint8Array<ArrayBufferLike>[]>, Codec<{
|
|
318
331
|
proof: {
|
|
319
332
|
tag: "Sr25519";
|
|
@@ -348,7 +361,7 @@ export declare const hostApiProtocol: {
|
|
|
348
361
|
data: Uint8Array<ArrayBufferLike> | undefined;
|
|
349
362
|
}[]>];
|
|
350
363
|
}>;
|
|
351
|
-
readonly
|
|
364
|
+
readonly remote_statement_store_create_proof: VersionedProtocolRequest<{
|
|
352
365
|
readonly v1: [Codec<[[string, number], {
|
|
353
366
|
proof: {
|
|
354
367
|
tag: "Sr25519";
|
|
@@ -410,7 +423,7 @@ export declare const hostApiProtocol: {
|
|
|
410
423
|
reason: string;
|
|
411
424
|
}, "StatementProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnableToSign"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnknownAccount">>>];
|
|
412
425
|
}>;
|
|
413
|
-
readonly
|
|
426
|
+
readonly remote_statement_store_submit: VersionedProtocolRequest<{
|
|
414
427
|
readonly v1: [Codec<{
|
|
415
428
|
proof: {
|
|
416
429
|
tag: "Sr25519";
|
|
@@ -447,12 +460,20 @@ export declare const hostApiProtocol: {
|
|
|
447
460
|
reason: string;
|
|
448
461
|
}, "GenericError">>>];
|
|
449
462
|
}>;
|
|
450
|
-
readonly
|
|
463
|
+
readonly remote_preimage_lookup_subscribe: VersionedProtocolSubscription<{
|
|
464
|
+
readonly v1: [Codec<`0x${string}`>, Codec<Uint8Array<ArrayBufferLike> | null>];
|
|
465
|
+
}>;
|
|
466
|
+
readonly remote_preimage_submit: VersionedProtocolRequest<{
|
|
467
|
+
readonly v1: [Codec<Uint8Array<ArrayBufferLike>>, Codec<import("scale-ts").ResultPayload<`0x${string}`, import("@novasamatech/scale").CodecError<{
|
|
468
|
+
reason: string;
|
|
469
|
+
}, "PreimageSubmitErr::Unknown">>>];
|
|
470
|
+
}>;
|
|
471
|
+
readonly host_jsonrpc_message_send: VersionedProtocolRequest<{
|
|
451
472
|
readonly v1: [Codec<[`0x${string}`, string]>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
452
473
|
reason: string;
|
|
453
474
|
}, "GenericError">>>];
|
|
454
475
|
}>;
|
|
455
|
-
readonly
|
|
476
|
+
readonly host_jsonrpc_message_subscribe: VersionedProtocolSubscription<{
|
|
456
477
|
readonly v1: [Codec<`0x${string}`>, Codec<string>];
|
|
457
478
|
}>;
|
|
458
479
|
};
|
package/dist/protocol/impl.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { Enum } from '@novasamatech/scale';
|
|
2
|
-
import { AccountCreateProofV1_request, AccountCreateProofV1_response, AccountGetAliasV1_request, AccountGetAliasV1_response, AccountGetV1_request, AccountGetV1_response, GetNonProductAccountsV1_request, GetNonProductAccountsV1_response, } from './v1/accounts.js';
|
|
3
|
-
import { ChatActionSubscribeV1_receive, ChatActionSubscribeV1_start, ChatCreateRoomV1_request, ChatCreateRoomV1_response, ChatListSubscribeV1_receive, ChatListSubscribeV1_start, ChatPostMessageV1_request, ChatPostMessageV1_response, ChatRegisterBotV1_request, ChatRegisterBotV1_response, } from './v1/chat.js';
|
|
2
|
+
import { AccountConnectionStatusV1_receive, AccountConnectionStatusV1_start, AccountCreateProofV1_request, AccountCreateProofV1_response, AccountGetAliasV1_request, AccountGetAliasV1_response, AccountGetV1_request, AccountGetV1_response, GetNonProductAccountsV1_request, GetNonProductAccountsV1_response, } from './v1/accounts.js';
|
|
3
|
+
import { ChatActionSubscribeV1_receive, ChatActionSubscribeV1_start, ChatCreateRoomV1_request, ChatCreateRoomV1_response, ChatCustomMessageRenderingV1_receive, ChatCustomMessageRenderingV1_start, ChatListSubscribeV1_receive, ChatListSubscribeV1_start, ChatPostMessageV1_request, ChatPostMessageV1_response, ChatRegisterBotV1_request, ChatRegisterBotV1_response, } from './v1/chat.js';
|
|
4
4
|
import { CreateTransactionV1_request, CreateTransactionV1_response, CreateTransactionWithNonProductAccountV1_request, CreateTransactionWithNonProductAccountV1_response, } from './v1/createTransaction.js';
|
|
5
|
+
import { DevicePermissionV1_request, DevicePermissionV1_response } from './v1/devicePermission.js';
|
|
5
6
|
import { FeatureV1_request, FeatureV1_response } from './v1/feature.js';
|
|
6
7
|
import { HandshakeV1_request, HandshakeV1_response } from './v1/handshake.js';
|
|
7
8
|
import { JsonRpcMessageSendV1_request, JsonRpcMessageSendV1_response, JsonRpcMessageSubscribeV1_receive, JsonRpcMessageSubscribeV1_start, } from './v1/jsonRpc.js';
|
|
9
|
+
import { StorageClearV1_request, StorageClearV1_response, StorageReadV1_request, StorageReadV1_response, StorageWriteV1_request, StorageWriteV1_response, } from './v1/localStorage.js';
|
|
10
|
+
import { NavigateToV1_request, NavigateToV1_response } from './v1/navigation.js';
|
|
11
|
+
import { PushNotificationV1_request, PushNotificationV1_response } from './v1/notification.js';
|
|
12
|
+
import { PreimageLookupSubscribeV1_receive, PreimageLookupSubscribeV1_start, PreimageSubmitV1_request, PreimageSubmitV1_response, } from './v1/preimage.js';
|
|
13
|
+
import { RemotePermissionV1_request, RemotePermissionV1_response } from './v1/remotePermission.js';
|
|
8
14
|
import { SignPayloadV1_request, SignPayloadV1_response, SignRawV1_request, SignRawV1_response } from './v1/sign.js';
|
|
9
|
-
import { StatementStoreCreateProofV1_request, StatementStoreCreateProofV1_response,
|
|
10
|
-
import { StorageClearV1_request, StorageClearV1_response, StorageReadV1_request, StorageReadV1_response, StorageWriteV1_request, StorageWriteV1_response, } from './v1/storage.js';
|
|
15
|
+
import { StatementStoreCreateProofV1_request, StatementStoreCreateProofV1_response, StatementStoreSubmitV1_request, StatementStoreSubmitV1_response, StatementStoreSubscribeV1_receive, StatementStoreSubscribeV1_start, } from './v1/statementStore.js';
|
|
11
16
|
const enumFromArg = (enumValues, n) => {
|
|
12
17
|
return Enum(Object.fromEntries(Object.entries(enumValues).map(([key, value]) => [key, value[n]])));
|
|
13
18
|
};
|
|
@@ -26,83 +31,106 @@ const versionedSubscription = (values) => {
|
|
|
26
31
|
};
|
|
27
32
|
};
|
|
28
33
|
export const hostApiProtocol = {
|
|
29
|
-
//
|
|
30
|
-
|
|
34
|
+
// Host calls
|
|
35
|
+
host_handshake: versionedRequest({
|
|
31
36
|
v1: [HandshakeV1_request, HandshakeV1_response],
|
|
32
37
|
}),
|
|
33
|
-
|
|
38
|
+
host_feature_supported: versionedRequest({
|
|
34
39
|
v1: [FeatureV1_request, FeatureV1_response],
|
|
35
40
|
}),
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
host_push_notification: versionedRequest({
|
|
42
|
+
v1: [PushNotificationV1_request, PushNotificationV1_response],
|
|
43
|
+
}),
|
|
44
|
+
host_navigate_to: versionedRequest({
|
|
45
|
+
v1: [NavigateToV1_request, NavigateToV1_response],
|
|
46
|
+
}),
|
|
47
|
+
// Permissions
|
|
48
|
+
host_device_permission: versionedRequest({
|
|
49
|
+
v1: [DevicePermissionV1_request, DevicePermissionV1_response],
|
|
50
|
+
}),
|
|
51
|
+
remote_permission: versionedRequest({
|
|
52
|
+
v1: [RemotePermissionV1_request, RemotePermissionV1_response],
|
|
53
|
+
}),
|
|
54
|
+
// Local storage
|
|
55
|
+
host_local_storage_read: versionedRequest({
|
|
38
56
|
v1: [StorageReadV1_request, StorageReadV1_response],
|
|
39
57
|
}),
|
|
40
|
-
|
|
58
|
+
host_local_storage_write: versionedRequest({
|
|
41
59
|
v1: [StorageWriteV1_request, StorageWriteV1_response],
|
|
42
60
|
}),
|
|
43
|
-
|
|
61
|
+
host_local_storage_clear: versionedRequest({
|
|
44
62
|
v1: [StorageClearV1_request, StorageClearV1_response],
|
|
45
63
|
}),
|
|
46
|
-
//
|
|
47
|
-
|
|
64
|
+
// Account management
|
|
65
|
+
host_account_connection_status_subscribe: versionedSubscription({
|
|
66
|
+
v1: [AccountConnectionStatusV1_start, AccountConnectionStatusV1_receive],
|
|
67
|
+
}),
|
|
68
|
+
host_account_get: versionedRequest({
|
|
48
69
|
v1: [AccountGetV1_request, AccountGetV1_response],
|
|
49
70
|
}),
|
|
50
|
-
|
|
71
|
+
host_account_get_alias: versionedRequest({
|
|
51
72
|
v1: [AccountGetAliasV1_request, AccountGetAliasV1_response],
|
|
52
73
|
}),
|
|
53
|
-
|
|
74
|
+
host_account_create_proof: versionedRequest({
|
|
54
75
|
v1: [AccountCreateProofV1_request, AccountCreateProofV1_response],
|
|
55
76
|
}),
|
|
56
|
-
|
|
77
|
+
host_get_non_product_accounts: versionedRequest({
|
|
57
78
|
v1: [GetNonProductAccountsV1_request, GetNonProductAccountsV1_response],
|
|
58
79
|
}),
|
|
59
|
-
//
|
|
60
|
-
|
|
80
|
+
// Signing
|
|
81
|
+
host_create_transaction: versionedRequest({
|
|
61
82
|
v1: [CreateTransactionV1_request, CreateTransactionV1_response],
|
|
62
83
|
}),
|
|
63
|
-
|
|
84
|
+
host_create_transaction_with_non_product_account: versionedRequest({
|
|
64
85
|
v1: [CreateTransactionWithNonProductAccountV1_request, CreateTransactionWithNonProductAccountV1_response],
|
|
65
86
|
}),
|
|
66
|
-
|
|
87
|
+
host_sign_raw: versionedRequest({
|
|
67
88
|
v1: [SignRawV1_request, SignRawV1_response],
|
|
68
89
|
}),
|
|
69
|
-
|
|
90
|
+
host_sign_payload: versionedRequest({
|
|
70
91
|
v1: [SignPayloadV1_request, SignPayloadV1_response],
|
|
71
92
|
}),
|
|
72
|
-
//
|
|
73
|
-
|
|
93
|
+
// Chat
|
|
94
|
+
host_chat_create_room: versionedRequest({
|
|
74
95
|
v1: [ChatCreateRoomV1_request, ChatCreateRoomV1_response],
|
|
75
96
|
}),
|
|
76
|
-
|
|
97
|
+
host_chat_register_bot: versionedRequest({
|
|
77
98
|
v1: [ChatRegisterBotV1_request, ChatRegisterBotV1_response],
|
|
78
99
|
}),
|
|
79
|
-
|
|
100
|
+
host_chat_list_subscribe: versionedSubscription({
|
|
80
101
|
v1: [ChatListSubscribeV1_start, ChatListSubscribeV1_receive],
|
|
81
102
|
}),
|
|
82
|
-
|
|
103
|
+
host_chat_post_message: versionedRequest({
|
|
83
104
|
v1: [ChatPostMessageV1_request, ChatPostMessageV1_response],
|
|
84
105
|
}),
|
|
85
|
-
|
|
106
|
+
host_chat_action_subscribe: versionedSubscription({
|
|
86
107
|
v1: [ChatActionSubscribeV1_start, ChatActionSubscribeV1_receive],
|
|
87
108
|
}),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
v1: [StatementStoreQueryV1_request, StatementStoreQueryV1_response],
|
|
109
|
+
product_chat_custom_message_render_subscribe: versionedSubscription({
|
|
110
|
+
v1: [ChatCustomMessageRenderingV1_start, ChatCustomMessageRenderingV1_receive],
|
|
91
111
|
}),
|
|
92
|
-
|
|
112
|
+
// Statement store (remote namespace)
|
|
113
|
+
remote_statement_store_subscribe: versionedSubscription({
|
|
93
114
|
v1: [StatementStoreSubscribeV1_start, StatementStoreSubscribeV1_receive],
|
|
94
115
|
}),
|
|
95
|
-
|
|
116
|
+
remote_statement_store_create_proof: versionedRequest({
|
|
96
117
|
v1: [StatementStoreCreateProofV1_request, StatementStoreCreateProofV1_response],
|
|
97
118
|
}),
|
|
98
|
-
|
|
119
|
+
remote_statement_store_submit: versionedRequest({
|
|
99
120
|
v1: [StatementStoreSubmitV1_request, StatementStoreSubmitV1_response],
|
|
100
121
|
}),
|
|
101
|
-
//
|
|
102
|
-
|
|
122
|
+
// Preimage lookup
|
|
123
|
+
remote_preimage_lookup_subscribe: versionedSubscription({
|
|
124
|
+
v1: [PreimageLookupSubscribeV1_start, PreimageLookupSubscribeV1_receive],
|
|
125
|
+
}),
|
|
126
|
+
remote_preimage_submit: versionedRequest({
|
|
127
|
+
v1: [PreimageSubmitV1_request, PreimageSubmitV1_response],
|
|
128
|
+
}),
|
|
129
|
+
// json rpc (temporary, kept until chain methods are added)
|
|
130
|
+
host_jsonrpc_message_send: versionedRequest({
|
|
103
131
|
v1: [JsonRpcMessageSendV1_request, JsonRpcMessageSendV1_response],
|
|
104
132
|
}),
|
|
105
|
-
|
|
133
|
+
host_jsonrpc_message_subscribe: versionedSubscription({
|
|
106
134
|
v1: [JsonRpcMessageSubscribeV1_start, JsonRpcMessageSubscribeV1_receive],
|
|
107
135
|
}),
|
|
108
136
|
};
|