@novasamatech/host-api 0.5.4 → 0.5.5
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 +2 -2
- package/dist/hostApi.d.ts +2 -1
- package/dist/hostApi.js +111 -34
- package/dist/index.d.ts +6 -1
- package/dist/index.js +6 -1
- package/dist/protocol/impl.d.ts +60 -60
- package/dist/protocol/impl.js +57 -35
- package/dist/protocol/messageCodec.d.ts +241 -185
- 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/statementStore.d.ts +0 -36
- package/dist/protocol/v1/statementStore.js +1 -3
- package/dist/transport.js +3 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ const hostApi = createHostApi(transport);
|
|
|
90
90
|
|
|
91
91
|
// requesting data
|
|
92
92
|
|
|
93
|
-
const storageValue = hostApi.
|
|
93
|
+
const storageValue = hostApi.localStorageRead(payload);
|
|
94
94
|
|
|
95
95
|
storageValue.match(
|
|
96
96
|
(data) => console.log('success:', data),
|
|
@@ -99,7 +99,7 @@ storageValue.match(
|
|
|
99
99
|
|
|
100
100
|
// subscribing to events
|
|
101
101
|
|
|
102
|
-
const subscription = hostApi.
|
|
102
|
+
const subscription = hostApi.chatActionSubscribe(params, (action) => {
|
|
103
103
|
console.log('action received:', action);
|
|
104
104
|
});
|
|
105
105
|
|
package/dist/hostApi.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Codec, CodecType } from 'scale-ts';
|
|
|
3
3
|
import type { HostApiProtocol, VersionedProtocolRequest, VersionedProtocolSubscription } from './protocol/impl.js';
|
|
4
4
|
import type { Subscription, Transport } from './types.js';
|
|
5
5
|
type SnakeToCamelCase<S extends string> = S extends `${infer T}_${infer U}` ? `${T}${Capitalize<SnakeToCamelCase<U>>}` : S;
|
|
6
|
+
type StripNamespace<S extends string> = S extends `host_${infer Rest}` ? Rest : S extends `remote_${infer Rest}` ? Rest : S;
|
|
6
7
|
type Value<T extends Codec<any> | Codec<never>> = T extends Codec<any> ? CodecType<T> : unknown;
|
|
7
8
|
type UnwrapVersionedResult<T> = T extends {
|
|
8
9
|
tag: infer Tag;
|
|
@@ -26,7 +27,7 @@ type InferRequestMethod<Method extends VersionedProtocolRequest> = (args: Value<
|
|
|
26
27
|
type InferSubscribeMethod<Method extends VersionedProtocolSubscription> = (args: Value<Method['start']>, callback: (payload: Value<Method['receive']>) => void) => Subscription;
|
|
27
28
|
type InferMethod<Method extends VersionedProtocolRequest | VersionedProtocolSubscription> = Method extends VersionedProtocolRequest ? InferRequestMethod<Method> : Method extends VersionedProtocolSubscription ? InferSubscribeMethod<Method> : never;
|
|
28
29
|
export type HostApi = {
|
|
29
|
-
[K in keyof HostApiProtocol as SnakeToCamelCase<K
|
|
30
|
+
[K in keyof HostApiProtocol as SnakeToCamelCase<StripNamespace<K>>]: InferMethod<HostApiProtocol[K]>;
|
|
30
31
|
};
|
|
31
32
|
export declare function createHostApi(transport: Transport): HostApi;
|
|
32
33
|
export {};
|
package/dist/hostApi.js
CHANGED
|
@@ -5,13 +5,15 @@ import { CreateProofErr, RequestCredentialsErr } from './protocol/v1/accounts.js
|
|
|
5
5
|
import { ChatBotRegistrationErr, ChatMessagePostingErr, ChatRoomRegistrationErr } from './protocol/v1/chat.js';
|
|
6
6
|
import { CreateTransactionErr } from './protocol/v1/createTransaction.js';
|
|
7
7
|
import { HandshakeErr } from './protocol/v1/handshake.js';
|
|
8
|
+
import { StorageErr } from './protocol/v1/localStorage.js';
|
|
9
|
+
import { NavigateToErr } from './protocol/v1/navigation.js';
|
|
10
|
+
import { PreimageSubmitErr } from './protocol/v1/preimage.js';
|
|
8
11
|
import { SigningErr } from './protocol/v1/sign.js';
|
|
9
12
|
import { StatementProofErr } from './protocol/v1/statementStore.js';
|
|
10
|
-
import { StorageErr } from './protocol/v1/storage.js';
|
|
11
13
|
export function createHostApi(transport) {
|
|
12
14
|
return {
|
|
13
15
|
handshake(payload) {
|
|
14
|
-
const response = fromPromise(transport.request('
|
|
16
|
+
const response = fromPromise(transport.request('host_handshake', payload), e => ({
|
|
15
17
|
tag: payload.tag,
|
|
16
18
|
value: new HandshakeErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
17
19
|
}));
|
|
@@ -28,8 +30,8 @@ export function createHostApi(transport) {
|
|
|
28
30
|
});
|
|
29
31
|
});
|
|
30
32
|
},
|
|
31
|
-
|
|
32
|
-
const response = fromPromise(transport.request('
|
|
33
|
+
featureSupported(payload) {
|
|
34
|
+
const response = fromPromise(transport.request('host_feature_supported', payload), e => ({
|
|
33
35
|
tag: payload.tag,
|
|
34
36
|
value: new GenericError({ reason: extractErrorMessage(e) }),
|
|
35
37
|
}));
|
|
@@ -46,8 +48,80 @@ export function createHostApi(transport) {
|
|
|
46
48
|
});
|
|
47
49
|
});
|
|
48
50
|
},
|
|
51
|
+
devicePermission(payload) {
|
|
52
|
+
const response = fromPromise(transport.request('host_device_permission', payload), e => ({
|
|
53
|
+
tag: payload.tag,
|
|
54
|
+
value: new GenericError({ reason: extractErrorMessage(e) }),
|
|
55
|
+
}));
|
|
56
|
+
return response.andThen(response => {
|
|
57
|
+
if (response.value.success) {
|
|
58
|
+
return okAsync({
|
|
59
|
+
tag: response.tag,
|
|
60
|
+
value: response.value.value,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return errAsync({
|
|
64
|
+
tag: response.tag,
|
|
65
|
+
value: response.value.value,
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
permission(payload) {
|
|
70
|
+
const response = fromPromise(transport.request('remote_permission', payload), e => ({
|
|
71
|
+
tag: payload.tag,
|
|
72
|
+
value: new GenericError({ reason: extractErrorMessage(e) }),
|
|
73
|
+
}));
|
|
74
|
+
return response.andThen(response => {
|
|
75
|
+
if (response.value.success) {
|
|
76
|
+
return okAsync({
|
|
77
|
+
tag: response.tag,
|
|
78
|
+
value: response.value.value,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return errAsync({
|
|
82
|
+
tag: response.tag,
|
|
83
|
+
value: response.value.value,
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
pushNotification(payload) {
|
|
88
|
+
const response = fromPromise(transport.request('host_push_notification', payload), e => ({
|
|
89
|
+
tag: payload.tag,
|
|
90
|
+
value: new GenericError({ reason: extractErrorMessage(e) }),
|
|
91
|
+
}));
|
|
92
|
+
return response.andThen(response => {
|
|
93
|
+
if (response.value.success) {
|
|
94
|
+
return okAsync({
|
|
95
|
+
tag: response.tag,
|
|
96
|
+
value: response.value.value,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return errAsync({
|
|
100
|
+
tag: response.tag,
|
|
101
|
+
value: response.value.value,
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
navigateTo(payload) {
|
|
106
|
+
const response = fromPromise(transport.request('host_navigate_to', payload), e => ({
|
|
107
|
+
tag: payload.tag,
|
|
108
|
+
value: new NavigateToErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
109
|
+
}));
|
|
110
|
+
return response.andThen(response => {
|
|
111
|
+
if (response.value.success) {
|
|
112
|
+
return okAsync({
|
|
113
|
+
tag: response.tag,
|
|
114
|
+
value: response.value.value,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return errAsync({
|
|
118
|
+
tag: response.tag,
|
|
119
|
+
value: response.value.value,
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
},
|
|
49
123
|
localStorageRead(payload) {
|
|
50
|
-
const response = fromPromise(transport.request('
|
|
124
|
+
const response = fromPromise(transport.request('host_local_storage_read', payload), e => ({
|
|
51
125
|
tag: payload.tag,
|
|
52
126
|
value: new StorageErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
53
127
|
}));
|
|
@@ -65,7 +139,7 @@ export function createHostApi(transport) {
|
|
|
65
139
|
});
|
|
66
140
|
},
|
|
67
141
|
localStorageWrite(payload) {
|
|
68
|
-
const response = fromPromise(transport.request('
|
|
142
|
+
const response = fromPromise(transport.request('host_local_storage_write', payload), e => ({
|
|
69
143
|
tag: payload.tag,
|
|
70
144
|
value: new StorageErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
71
145
|
}));
|
|
@@ -83,7 +157,7 @@ export function createHostApi(transport) {
|
|
|
83
157
|
});
|
|
84
158
|
},
|
|
85
159
|
localStorageClear(payload) {
|
|
86
|
-
const response = fromPromise(transport.request('
|
|
160
|
+
const response = fromPromise(transport.request('host_local_storage_clear', payload), e => ({
|
|
87
161
|
tag: payload.tag,
|
|
88
162
|
value: new StorageErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
89
163
|
}));
|
|
@@ -101,7 +175,7 @@ export function createHostApi(transport) {
|
|
|
101
175
|
});
|
|
102
176
|
},
|
|
103
177
|
accountGet(payload) {
|
|
104
|
-
const response = fromPromise(transport.request('
|
|
178
|
+
const response = fromPromise(transport.request('host_account_get', payload), e => ({
|
|
105
179
|
tag: payload.tag,
|
|
106
180
|
value: new RequestCredentialsErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
107
181
|
}));
|
|
@@ -119,7 +193,7 @@ export function createHostApi(transport) {
|
|
|
119
193
|
});
|
|
120
194
|
},
|
|
121
195
|
accountGetAlias(payload) {
|
|
122
|
-
const response = fromPromise(transport.request('
|
|
196
|
+
const response = fromPromise(transport.request('host_account_get_alias', payload), e => ({
|
|
123
197
|
tag: payload.tag,
|
|
124
198
|
value: new RequestCredentialsErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
125
199
|
}));
|
|
@@ -137,7 +211,7 @@ export function createHostApi(transport) {
|
|
|
137
211
|
});
|
|
138
212
|
},
|
|
139
213
|
accountCreateProof(payload) {
|
|
140
|
-
const response = fromPromise(transport.request('
|
|
214
|
+
const response = fromPromise(transport.request('host_account_create_proof', payload), e => ({
|
|
141
215
|
tag: payload.tag,
|
|
142
216
|
value: new CreateProofErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
143
217
|
}));
|
|
@@ -155,7 +229,7 @@ export function createHostApi(transport) {
|
|
|
155
229
|
});
|
|
156
230
|
},
|
|
157
231
|
getNonProductAccounts(payload) {
|
|
158
|
-
const response = fromPromise(transport.request('
|
|
232
|
+
const response = fromPromise(transport.request('host_get_non_product_accounts', payload), e => ({
|
|
159
233
|
tag: payload.tag,
|
|
160
234
|
value: new RequestCredentialsErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
161
235
|
}));
|
|
@@ -173,7 +247,7 @@ export function createHostApi(transport) {
|
|
|
173
247
|
});
|
|
174
248
|
},
|
|
175
249
|
createTransaction(payload) {
|
|
176
|
-
const response = fromPromise(transport.request('
|
|
250
|
+
const response = fromPromise(transport.request('host_create_transaction', payload), e => ({
|
|
177
251
|
tag: payload.tag,
|
|
178
252
|
value: new CreateTransactionErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
179
253
|
}));
|
|
@@ -191,7 +265,7 @@ export function createHostApi(transport) {
|
|
|
191
265
|
});
|
|
192
266
|
},
|
|
193
267
|
createTransactionWithNonProductAccount(payload) {
|
|
194
|
-
const response = fromPromise(transport.request('
|
|
268
|
+
const response = fromPromise(transport.request('host_create_transaction_with_non_product_account', payload), e => ({
|
|
195
269
|
tag: payload.tag,
|
|
196
270
|
value: new CreateTransactionErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
197
271
|
}));
|
|
@@ -209,7 +283,7 @@ export function createHostApi(transport) {
|
|
|
209
283
|
});
|
|
210
284
|
},
|
|
211
285
|
signRaw(payload) {
|
|
212
|
-
const response = fromPromise(transport.request('
|
|
286
|
+
const response = fromPromise(transport.request('host_sign_raw', payload), e => ({
|
|
213
287
|
tag: payload.tag,
|
|
214
288
|
value: new SigningErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
215
289
|
}));
|
|
@@ -227,7 +301,7 @@ export function createHostApi(transport) {
|
|
|
227
301
|
});
|
|
228
302
|
},
|
|
229
303
|
signPayload(payload) {
|
|
230
|
-
const response = fromPromise(transport.request('
|
|
304
|
+
const response = fromPromise(transport.request('host_sign_payload', payload), e => ({
|
|
231
305
|
tag: payload.tag,
|
|
232
306
|
value: new SigningErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
233
307
|
}));
|
|
@@ -245,10 +319,10 @@ export function createHostApi(transport) {
|
|
|
245
319
|
});
|
|
246
320
|
},
|
|
247
321
|
chatListSubscribe(args, callback) {
|
|
248
|
-
return transport.subscribe('
|
|
322
|
+
return transport.subscribe('host_chat_list_subscribe', args, callback);
|
|
249
323
|
},
|
|
250
324
|
chatCreateRoom(payload) {
|
|
251
|
-
const response = fromPromise(transport.request('
|
|
325
|
+
const response = fromPromise(transport.request('host_chat_create_room', payload), e => ({
|
|
252
326
|
tag: payload.tag,
|
|
253
327
|
value: new ChatRoomRegistrationErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
254
328
|
}));
|
|
@@ -266,7 +340,7 @@ export function createHostApi(transport) {
|
|
|
266
340
|
});
|
|
267
341
|
},
|
|
268
342
|
chatRegisterBot(payload) {
|
|
269
|
-
const response = fromPromise(transport.request('
|
|
343
|
+
const response = fromPromise(transport.request('host_chat_register_bot', payload), e => ({
|
|
270
344
|
tag: payload.tag,
|
|
271
345
|
value: new ChatBotRegistrationErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
272
346
|
}));
|
|
@@ -284,7 +358,7 @@ export function createHostApi(transport) {
|
|
|
284
358
|
});
|
|
285
359
|
},
|
|
286
360
|
chatPostMessage(payload) {
|
|
287
|
-
const response = fromPromise(transport.request('
|
|
361
|
+
const response = fromPromise(transport.request('host_chat_post_message', payload), e => ({
|
|
288
362
|
tag: payload.tag,
|
|
289
363
|
value: new ChatMessagePostingErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
290
364
|
}));
|
|
@@ -302,12 +376,15 @@ export function createHostApi(transport) {
|
|
|
302
376
|
});
|
|
303
377
|
},
|
|
304
378
|
chatActionSubscribe(args, callback) {
|
|
305
|
-
return transport.subscribe('
|
|
379
|
+
return transport.subscribe('host_chat_action_subscribe', args, callback);
|
|
306
380
|
},
|
|
307
|
-
|
|
308
|
-
|
|
381
|
+
statementStoreSubscribe(args, callback) {
|
|
382
|
+
return transport.subscribe('remote_statement_store_subscribe', args, callback);
|
|
383
|
+
},
|
|
384
|
+
statementStoreCreateProof(payload) {
|
|
385
|
+
const response = fromPromise(transport.request('remote_statement_store_create_proof', payload), e => ({
|
|
309
386
|
tag: payload.tag,
|
|
310
|
-
value: new
|
|
387
|
+
value: new StatementProofErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
311
388
|
}));
|
|
312
389
|
return response.andThen(response => {
|
|
313
390
|
if (response.value.success) {
|
|
@@ -322,13 +399,10 @@ export function createHostApi(transport) {
|
|
|
322
399
|
});
|
|
323
400
|
});
|
|
324
401
|
},
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
statementStoreCreateProof(payload) {
|
|
329
|
-
const response = fromPromise(transport.request('statement_store_create_proof', payload), e => ({
|
|
402
|
+
statementStoreSubmit(payload) {
|
|
403
|
+
const response = fromPromise(transport.request('remote_statement_store_submit', payload), e => ({
|
|
330
404
|
tag: payload.tag,
|
|
331
|
-
value: new
|
|
405
|
+
value: new GenericError({ reason: extractErrorMessage(e) }),
|
|
332
406
|
}));
|
|
333
407
|
return response.andThen(response => {
|
|
334
408
|
if (response.value.success) {
|
|
@@ -343,10 +417,13 @@ export function createHostApi(transport) {
|
|
|
343
417
|
});
|
|
344
418
|
});
|
|
345
419
|
},
|
|
346
|
-
|
|
347
|
-
|
|
420
|
+
preimageLookupSubscribe(args, callback) {
|
|
421
|
+
return transport.subscribe('remote_preimage_lookup_subscribe', args, callback);
|
|
422
|
+
},
|
|
423
|
+
preimageSubmit(payload) {
|
|
424
|
+
const response = fromPromise(transport.request('remote_preimage_submit', payload), e => ({
|
|
348
425
|
tag: payload.tag,
|
|
349
|
-
value: new
|
|
426
|
+
value: new PreimageSubmitErr.Unknown({ reason: extractErrorMessage(e) }),
|
|
350
427
|
}));
|
|
351
428
|
return response.andThen(response => {
|
|
352
429
|
if (response.value.success) {
|
|
@@ -362,7 +439,7 @@ export function createHostApi(transport) {
|
|
|
362
439
|
});
|
|
363
440
|
},
|
|
364
441
|
jsonrpcMessageSend(payload) {
|
|
365
|
-
const response = fromPromise(transport.request('
|
|
442
|
+
const response = fromPromise(transport.request('host_jsonrpc_message_send', payload), e => ({
|
|
366
443
|
tag: payload.tag,
|
|
367
444
|
value: new GenericError({ reason: extractErrorMessage(e) }),
|
|
368
445
|
}));
|
|
@@ -380,7 +457,7 @@ export function createHostApi(transport) {
|
|
|
380
457
|
});
|
|
381
458
|
},
|
|
382
459
|
jsonrpcMessageSubscribe(args, callback) {
|
|
383
|
-
return transport.subscribe('
|
|
460
|
+
return transport.subscribe('host_jsonrpc_message_subscribe', args, callback);
|
|
384
461
|
},
|
|
385
462
|
};
|
|
386
463
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -17,4 +17,9 @@ export { ChatActionPayload, ChatBotRegistrationErr, ChatBotRegistrationStatus, C
|
|
|
17
17
|
export { HandshakeErr } from './protocol/v1/handshake.js';
|
|
18
18
|
export { SigningErr } from './protocol/v1/sign.js';
|
|
19
19
|
export { SignedStatement, Statement, StatementProofErr, Topic } from './protocol/v1/statementStore.js';
|
|
20
|
-
export { StorageErr } from './protocol/v1/
|
|
20
|
+
export { StorageErr } from './protocol/v1/localStorage.js';
|
|
21
|
+
export { DevicePermissionRequest } from './protocol/v1/devicePermission.js';
|
|
22
|
+
export { RemotePermissionRequest } from './protocol/v1/remotePermission.js';
|
|
23
|
+
export { PushNotification } from './protocol/v1/notification.js';
|
|
24
|
+
export { NavigateToErr } from './protocol/v1/navigation.js';
|
|
25
|
+
export { PreimageKey, PreimageSubmitErr, PreimageValue } from './protocol/v1/preimage.js';
|
package/dist/index.js
CHANGED
|
@@ -12,4 +12,9 @@ export { ChatActionPayload, ChatBotRegistrationErr, ChatBotRegistrationStatus, C
|
|
|
12
12
|
export { HandshakeErr } from './protocol/v1/handshake.js';
|
|
13
13
|
export { SigningErr } from './protocol/v1/sign.js';
|
|
14
14
|
export { SignedStatement, Statement, StatementProofErr, Topic } from './protocol/v1/statementStore.js';
|
|
15
|
-
export { StorageErr } from './protocol/v1/
|
|
15
|
+
export { StorageErr } from './protocol/v1/localStorage.js';
|
|
16
|
+
export { DevicePermissionRequest } from './protocol/v1/devicePermission.js';
|
|
17
|
+
export { RemotePermissionRequest } from './protocol/v1/remotePermission.js';
|
|
18
|
+
export { PushNotification } from './protocol/v1/notification.js';
|
|
19
|
+
export { NavigateToErr } from './protocol/v1/navigation.js';
|
|
20
|
+
export { PreimageKey, PreimageSubmitErr, PreimageValue } from './protocol/v1/preimage.js';
|
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,51 @@ 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_get: VersionedProtocolRequest<{
|
|
48
77
|
readonly v1: [Codec<[string, number]>, Codec<import("scale-ts").ResultPayload<{
|
|
49
78
|
publicKey: Uint8Array<ArrayBufferLike>;
|
|
50
79
|
name: string | undefined;
|
|
@@ -52,7 +81,7 @@ export declare const hostApiProtocol: {
|
|
|
52
81
|
reason: string;
|
|
53
82
|
}, "RequestCredentialsErr::Unknown">>>];
|
|
54
83
|
}>;
|
|
55
|
-
readonly
|
|
84
|
+
readonly host_account_get_alias: VersionedProtocolRequest<{
|
|
56
85
|
readonly v1: [Codec<[string, number]>, Codec<import("scale-ts").ResultPayload<{
|
|
57
86
|
context: Uint8Array<ArrayBufferLike>;
|
|
58
87
|
alias: Uint8Array<ArrayBufferLike>;
|
|
@@ -60,7 +89,7 @@ export declare const hostApiProtocol: {
|
|
|
60
89
|
reason: string;
|
|
61
90
|
}, "RequestCredentialsErr::Unknown">>>];
|
|
62
91
|
}>;
|
|
63
|
-
readonly
|
|
92
|
+
readonly host_account_create_proof: VersionedProtocolRequest<{
|
|
64
93
|
readonly v1: [Codec<[[string, number], {
|
|
65
94
|
genesisHash: `0x${string}`;
|
|
66
95
|
ringRootHash: `0x${string}`;
|
|
@@ -71,7 +100,7 @@ export declare const hostApiProtocol: {
|
|
|
71
100
|
reason: string;
|
|
72
101
|
}, "CreateProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateProofErr::RingNotFound">>>];
|
|
73
102
|
}>;
|
|
74
|
-
readonly
|
|
103
|
+
readonly host_get_non_product_accounts: VersionedProtocolRequest<{
|
|
75
104
|
readonly v1: [Codec<undefined>, Codec<import("scale-ts").ResultPayload<{
|
|
76
105
|
publicKey: Uint8Array<ArrayBufferLike>;
|
|
77
106
|
name: string | undefined;
|
|
@@ -79,17 +108,17 @@ export declare const hostApiProtocol: {
|
|
|
79
108
|
reason: string;
|
|
80
109
|
}, "RequestCredentialsErr::Unknown">>>];
|
|
81
110
|
}>;
|
|
82
|
-
readonly
|
|
111
|
+
readonly host_create_transaction: VersionedProtocolRequest<{
|
|
83
112
|
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
113
|
reason: string;
|
|
85
114
|
}, "CreateTransactionErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::FailedToDecode"> | import("@novasamatech/scale").CodecError<string, "CreateTransactionErr::NotSupported">>>];
|
|
86
115
|
}>;
|
|
87
|
-
readonly
|
|
116
|
+
readonly host_create_transaction_with_non_product_account: VersionedProtocolRequest<{
|
|
88
117
|
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
118
|
reason: string;
|
|
90
119
|
}, "CreateTransactionErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "CreateTransactionErr::FailedToDecode"> | import("@novasamatech/scale").CodecError<string, "CreateTransactionErr::NotSupported">>>];
|
|
91
120
|
}>;
|
|
92
|
-
readonly
|
|
121
|
+
readonly host_sign_raw: VersionedProtocolRequest<{
|
|
93
122
|
readonly v1: [Codec<{
|
|
94
123
|
address: string;
|
|
95
124
|
data: {
|
|
@@ -106,7 +135,7 @@ export declare const hostApiProtocol: {
|
|
|
106
135
|
reason: string;
|
|
107
136
|
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
108
137
|
}>;
|
|
109
|
-
readonly
|
|
138
|
+
readonly host_sign_payload: VersionedProtocolRequest<{
|
|
110
139
|
readonly v1: [Codec<{
|
|
111
140
|
address: string;
|
|
112
141
|
blockHash: `0x${string}`;
|
|
@@ -131,7 +160,7 @@ export declare const hostApiProtocol: {
|
|
|
131
160
|
reason: string;
|
|
132
161
|
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
133
162
|
}>;
|
|
134
|
-
readonly
|
|
163
|
+
readonly host_chat_create_room: VersionedProtocolRequest<{
|
|
135
164
|
readonly v1: [Codec<{
|
|
136
165
|
roomId: string;
|
|
137
166
|
name: string;
|
|
@@ -142,7 +171,7 @@ export declare const hostApiProtocol: {
|
|
|
142
171
|
reason: string;
|
|
143
172
|
}, "ChatRoomRegistrationErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "ChatRoomRegistrationErr::PermissionDenied">>>];
|
|
144
173
|
}>;
|
|
145
|
-
readonly
|
|
174
|
+
readonly host_chat_register_bot: VersionedProtocolRequest<{
|
|
146
175
|
readonly v1: [Codec<{
|
|
147
176
|
botId: string;
|
|
148
177
|
name: string;
|
|
@@ -153,13 +182,13 @@ export declare const hostApiProtocol: {
|
|
|
153
182
|
reason: string;
|
|
154
183
|
}, "ChatBotRegistrationErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "ChatBotRegistrationErr::PermissionDenied">>>];
|
|
155
184
|
}>;
|
|
156
|
-
readonly
|
|
185
|
+
readonly host_chat_list_subscribe: VersionedProtocolSubscription<{
|
|
157
186
|
readonly v1: [Codec<undefined>, Codec<{
|
|
158
187
|
roomId: string;
|
|
159
188
|
participatingAs: "RoomHost" | "Bot";
|
|
160
189
|
}[]>];
|
|
161
190
|
}>;
|
|
162
|
-
readonly
|
|
191
|
+
readonly host_chat_post_message: VersionedProtocolRequest<{
|
|
163
192
|
readonly v1: [Codec<{
|
|
164
193
|
roomId: string;
|
|
165
194
|
payload: {
|
|
@@ -211,7 +240,7 @@ export declare const hostApiProtocol: {
|
|
|
211
240
|
reason: string;
|
|
212
241
|
}, "ChatMessagePostingErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "ChatMessagePostingErr::MessageTooLarge">>>];
|
|
213
242
|
}>;
|
|
214
|
-
readonly
|
|
243
|
+
readonly host_chat_action_subscribe: VersionedProtocolSubscription<{
|
|
215
244
|
readonly v1: [Codec<undefined>, Codec<{
|
|
216
245
|
roomId: string;
|
|
217
246
|
peer: string;
|
|
@@ -276,44 +305,7 @@ export declare const hostApiProtocol: {
|
|
|
276
305
|
};
|
|
277
306
|
}>];
|
|
278
307
|
}>;
|
|
279
|
-
readonly
|
|
280
|
-
readonly v1: [Codec<Uint8Array<ArrayBufferLike>[]>, Codec<import("scale-ts").ResultPayload<{
|
|
281
|
-
proof: {
|
|
282
|
-
tag: "Sr25519";
|
|
283
|
-
value: {
|
|
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">>>];
|
|
315
|
-
}>;
|
|
316
|
-
readonly statement_store_subscribe: VersionedProtocolSubscription<{
|
|
308
|
+
readonly remote_statement_store_subscribe: VersionedProtocolSubscription<{
|
|
317
309
|
readonly v1: [Codec<Uint8Array<ArrayBufferLike>[]>, Codec<{
|
|
318
310
|
proof: {
|
|
319
311
|
tag: "Sr25519";
|
|
@@ -348,7 +340,7 @@ export declare const hostApiProtocol: {
|
|
|
348
340
|
data: Uint8Array<ArrayBufferLike> | undefined;
|
|
349
341
|
}[]>];
|
|
350
342
|
}>;
|
|
351
|
-
readonly
|
|
343
|
+
readonly remote_statement_store_create_proof: VersionedProtocolRequest<{
|
|
352
344
|
readonly v1: [Codec<[[string, number], {
|
|
353
345
|
proof: {
|
|
354
346
|
tag: "Sr25519";
|
|
@@ -410,7 +402,7 @@ export declare const hostApiProtocol: {
|
|
|
410
402
|
reason: string;
|
|
411
403
|
}, "StatementProofErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnableToSign"> | import("@novasamatech/scale").CodecError<undefined, "StatementProofErr::UnknownAccount">>>];
|
|
412
404
|
}>;
|
|
413
|
-
readonly
|
|
405
|
+
readonly remote_statement_store_submit: VersionedProtocolRequest<{
|
|
414
406
|
readonly v1: [Codec<{
|
|
415
407
|
proof: {
|
|
416
408
|
tag: "Sr25519";
|
|
@@ -447,12 +439,20 @@ export declare const hostApiProtocol: {
|
|
|
447
439
|
reason: string;
|
|
448
440
|
}, "GenericError">>>];
|
|
449
441
|
}>;
|
|
450
|
-
readonly
|
|
442
|
+
readonly remote_preimage_lookup_subscribe: VersionedProtocolSubscription<{
|
|
443
|
+
readonly v1: [Codec<`0x${string}`>, Codec<Uint8Array<ArrayBufferLike> | null>];
|
|
444
|
+
}>;
|
|
445
|
+
readonly remote_preimage_submit: VersionedProtocolRequest<{
|
|
446
|
+
readonly v1: [Codec<Uint8Array<ArrayBufferLike>>, Codec<import("scale-ts").ResultPayload<`0x${string}`, import("@novasamatech/scale").CodecError<{
|
|
447
|
+
reason: string;
|
|
448
|
+
}, "PreimageSubmitErr::Unknown">>>];
|
|
449
|
+
}>;
|
|
450
|
+
readonly host_jsonrpc_message_send: VersionedProtocolRequest<{
|
|
451
451
|
readonly v1: [Codec<[`0x${string}`, string]>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
452
452
|
reason: string;
|
|
453
453
|
}, "GenericError">>>];
|
|
454
454
|
}>;
|
|
455
|
-
readonly
|
|
455
|
+
readonly host_jsonrpc_message_subscribe: VersionedProtocolSubscription<{
|
|
456
456
|
readonly v1: [Codec<`0x${string}`>, Codec<string>];
|
|
457
457
|
}>;
|
|
458
458
|
};
|