@novasamatech/host-api 0.7.1-1 → 0.7.2-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/dist/hostApi.d.ts +1 -1
- package/dist/hostApi.js +2 -11
- package/dist/protocol/impl.d.ts +155 -128
- package/dist/protocol/impl.js +50 -63
- package/dist/protocol/messageCodec.d.ts +446 -402
- package/dist/protocol/messageCodec.js +1 -1
- package/dist/protocol/v1/accounts.d.ts +1 -0
- package/dist/protocol/v1/accounts.js +1 -0
- package/dist/protocol/v1/chainInteraction.d.ts +1 -0
- package/dist/protocol/v1/chainInteraction.js +1 -0
- package/dist/protocol/v1/chat.d.ts +3 -0
- package/dist/protocol/v1/chat.js +3 -0
- package/dist/protocol/v1/jsonRpc.d.ts +1 -0
- package/dist/protocol/v1/jsonRpc.js +1 -0
- package/dist/protocol/v1/payments.d.ts +36 -2
- package/dist/protocol/v1/payments.js +4 -2
- package/dist/protocol/v1/preimage.d.ts +1 -0
- package/dist/protocol/v1/preimage.js +2 -1
- package/dist/protocol/v1/remotePermission.d.ts +2 -2
- package/dist/protocol/v1/remotePermission.js +1 -1
- package/dist/protocol/v1/statementStore.d.ts +1 -0
- package/dist/protocol/v1/statementStore.js +1 -0
- package/dist/protocol/v1/theme.d.ts +1 -0
- package/dist/protocol/v1/theme.js +1 -0
- package/dist/transport.js +4 -4
- package/dist/types.d.ts +5 -4
- package/package.json +2 -2
package/dist/hostApi.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ type ErrorResponse<T> = T extends {
|
|
|
24
24
|
value: infer U;
|
|
25
25
|
} ? U : never;
|
|
26
26
|
type InferRequestMethod<Method extends VersionedProtocolRequest> = (args: Value<Method['request']>) => UnwrapVersionedResult<Value<Method['response']>>;
|
|
27
|
-
type InferSubscribeMethod<Method extends VersionedProtocolSubscription> = (args: Value<Method['start']>, callback: (payload: Value<Method['receive']>) => void) => Subscription
|
|
27
|
+
type InferSubscribeMethod<Method extends VersionedProtocolSubscription> = (args: Value<Method['start']>, callback: (payload: Value<Method['receive']>) => void) => Subscription<Value<Method['interrupt']>>;
|
|
28
28
|
type InferMethod<Method extends VersionedProtocolRequest | VersionedProtocolSubscription> = Method extends VersionedProtocolRequest ? InferRequestMethod<Method> : Method extends VersionedProtocolSubscription ? InferSubscribeMethod<Method> : never;
|
|
29
29
|
export type HostApi = {
|
|
30
30
|
[K in keyof HostApiProtocol as SnakeToCamelCase<StripNamespace<K>>]: InferMethod<HostApiProtocol[K]>;
|
package/dist/hostApi.js
CHANGED
|
@@ -221,18 +221,9 @@ export function createHostApi(transport) {
|
|
|
221
221
|
paymentStatusSubscribe(args, callback) {
|
|
222
222
|
return transport.subscribe('host_payment_status_subscribe', args, callback);
|
|
223
223
|
},
|
|
224
|
-
jsonrpcMessageSend(payload) {
|
|
225
|
-
return makeRequest(transport.request('host_jsonrpc_message_send', payload), reason => ({
|
|
226
|
-
tag: payload.tag,
|
|
227
|
-
value: new GenericError({ reason }),
|
|
228
|
-
}));
|
|
229
|
-
},
|
|
230
|
-
jsonrpcMessageSubscribe(args, callback) {
|
|
231
|
-
return transport.subscribe('host_jsonrpc_message_subscribe', args, callback);
|
|
232
|
-
},
|
|
233
224
|
// chain interaction
|
|
234
|
-
|
|
235
|
-
return transport.subscribe('
|
|
225
|
+
chainHeadFollowSubscribe(args, callback) {
|
|
226
|
+
return transport.subscribe('remote_chain_head_follow_subscribe', args, callback);
|
|
236
227
|
},
|
|
237
228
|
chainHeadHeader(payload) {
|
|
238
229
|
return makeRequest(transport.request('remote_chain_head_header', payload), reason => ({
|
package/dist/protocol/impl.d.ts
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import type { EnumCodec } from '@novasamatech/scale';
|
|
2
2
|
import type { Codec } from 'scale-ts';
|
|
3
|
-
export type
|
|
4
|
-
type
|
|
3
|
+
export type VersionedRequestArguments = Record<string, [Codec<any>, Codec<any>]>;
|
|
4
|
+
export type VersionedSubscriptionArguments = Record<string, [Codec<any>, Codec<any>, Codec<any>]>;
|
|
5
|
+
export type VersionedArguments = VersionedRequestArguments;
|
|
6
|
+
type InferVersionedArgument<EnumValues extends Record<string, Codec<any>[]>, N extends number> = {
|
|
5
7
|
[V in keyof EnumValues]: EnumValues[V][N];
|
|
6
8
|
};
|
|
7
|
-
export type VersionedProtocolRequest<T extends
|
|
9
|
+
export type VersionedProtocolRequest<T extends VersionedRequestArguments = VersionedRequestArguments> = {
|
|
8
10
|
method: 'request';
|
|
9
11
|
request: EnumCodec<InferVersionedArgument<T, 0>>;
|
|
10
12
|
response: EnumCodec<InferVersionedArgument<T, 1>>;
|
|
11
13
|
};
|
|
12
|
-
export type VersionedProtocolSubscription<T extends
|
|
14
|
+
export type VersionedProtocolSubscription<T extends VersionedSubscriptionArguments = VersionedSubscriptionArguments> = {
|
|
13
15
|
method: 'subscribe';
|
|
14
16
|
start: EnumCodec<InferVersionedArgument<T, 0>>;
|
|
15
17
|
receive: EnumCodec<InferVersionedArgument<T, 1>>;
|
|
18
|
+
interrupt: EnumCodec<InferVersionedArgument<T, 2>>;
|
|
16
19
|
};
|
|
17
20
|
export type HostApiProtocol = typeof hostApiProtocol;
|
|
18
21
|
export declare const hostApiProtocol: {
|
|
@@ -37,26 +40,18 @@ export declare const hostApiProtocol: {
|
|
|
37
40
|
reason: string;
|
|
38
41
|
}, "GenericError">>>];
|
|
39
42
|
}>;
|
|
40
|
-
readonly host_theme_subscribe: VersionedProtocolSubscription<{
|
|
41
|
-
readonly v1: [Codec<undefined>, Codec<"light" | "dark">];
|
|
42
|
-
}>;
|
|
43
43
|
readonly host_navigate_to: VersionedProtocolRequest<{
|
|
44
44
|
readonly v1: [Codec<string>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
45
45
|
reason: string;
|
|
46
46
|
}, "NavigateToErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "NavigateToErr::PermissionDenied">>>];
|
|
47
47
|
}>;
|
|
48
|
-
readonly host_derive_entropy: VersionedProtocolRequest<{
|
|
49
|
-
readonly v1: [Codec<Uint8Array<ArrayBufferLike>>, Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<{
|
|
50
|
-
reason: string;
|
|
51
|
-
}, "DeriveEntropyErr::Unknown">>>];
|
|
52
|
-
}>;
|
|
53
48
|
readonly host_device_permission: VersionedProtocolRequest<{
|
|
54
49
|
readonly v1: [Codec<"Notifications" | "Camera" | "Microphone" | "Bluetooth" | "NFC" | "Location" | "Clipboard" | "OpenUrl" | "Biometrics">, Codec<import("scale-ts").ResultPayload<boolean, import("@novasamatech/scale").CodecError<{
|
|
55
50
|
reason: string;
|
|
56
51
|
}, "GenericError">>>];
|
|
57
52
|
}>;
|
|
58
53
|
readonly remote_permission: VersionedProtocolRequest<{
|
|
59
|
-
readonly v1: [Codec<
|
|
54
|
+
readonly v1: [Codec<{
|
|
60
55
|
tag: "Remote";
|
|
61
56
|
value: string[];
|
|
62
57
|
} | {
|
|
@@ -71,7 +66,7 @@ export declare const hostApiProtocol: {
|
|
|
71
66
|
} | {
|
|
72
67
|
tag: "StatementSubmit";
|
|
73
68
|
value: undefined;
|
|
74
|
-
}
|
|
69
|
+
}>, Codec<import("scale-ts").ResultPayload<boolean, import("@novasamatech/scale").CodecError<{
|
|
75
70
|
reason: string;
|
|
76
71
|
}, "GenericError">>>];
|
|
77
72
|
}>;
|
|
@@ -90,21 +85,8 @@ export declare const hostApiProtocol: {
|
|
|
90
85
|
reason: string;
|
|
91
86
|
}, "StorageErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StorageErr::Full">>>];
|
|
92
87
|
}>;
|
|
93
|
-
readonly host_account_get_root: VersionedProtocolRequest<{
|
|
94
|
-
readonly v1: [Codec<undefined>, Codec<import("scale-ts").ResultPayload<{
|
|
95
|
-
publicKey: Uint8Array<ArrayBufferLike>;
|
|
96
|
-
name: string | undefined;
|
|
97
|
-
}, import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::Rejected"> | import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::DomainNotValid"> | import("@novasamatech/scale").CodecError<{
|
|
98
|
-
reason: string;
|
|
99
|
-
}, "RequestCredentialsErr::Unknown">>>];
|
|
100
|
-
}>;
|
|
101
|
-
readonly host_request_login: VersionedProtocolRequest<{
|
|
102
|
-
readonly v1: [Codec<string | undefined>, Codec<import("scale-ts").ResultPayload<"success" | "alreadyConnected" | "rejected", import("@novasamatech/scale").CodecError<{
|
|
103
|
-
reason: string;
|
|
104
|
-
}, "LoginErr::Unknown">>>];
|
|
105
|
-
}>;
|
|
106
88
|
readonly host_account_connection_status_subscribe: VersionedProtocolSubscription<{
|
|
107
|
-
readonly v1: [Codec<undefined>, Codec<"disconnected" | "connected">];
|
|
89
|
+
readonly v1: [Codec<undefined>, Codec<"disconnected" | "connected">, Codec<undefined>];
|
|
108
90
|
}>;
|
|
109
91
|
readonly host_account_get: VersionedProtocolRequest<{
|
|
110
92
|
readonly v1: [Codec<[string, number]>, Codec<import("scale-ts").ResultPayload<{
|
|
@@ -168,23 +150,6 @@ export declare const hostApiProtocol: {
|
|
|
168
150
|
reason: string;
|
|
169
151
|
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
170
152
|
}>;
|
|
171
|
-
readonly host_sign_raw_with_legacy_account: VersionedProtocolRequest<{
|
|
172
|
-
readonly v1: [Codec<{
|
|
173
|
-
signer: string;
|
|
174
|
-
payload: {
|
|
175
|
-
tag: "Bytes";
|
|
176
|
-
value: Uint8Array<ArrayBufferLike>;
|
|
177
|
-
} | {
|
|
178
|
-
tag: "Payload";
|
|
179
|
-
value: string;
|
|
180
|
-
};
|
|
181
|
-
}>, Codec<import("scale-ts").ResultPayload<{
|
|
182
|
-
signature: `0x${string}`;
|
|
183
|
-
signedTransaction: `0x${string}` | undefined;
|
|
184
|
-
}, import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
185
|
-
reason: string;
|
|
186
|
-
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
187
|
-
}>;
|
|
188
153
|
readonly host_sign_payload: VersionedProtocolRequest<{
|
|
189
154
|
readonly v1: [Codec<{
|
|
190
155
|
account: [string, number];
|
|
@@ -212,33 +177,6 @@ export declare const hostApiProtocol: {
|
|
|
212
177
|
reason: string;
|
|
213
178
|
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
214
179
|
}>;
|
|
215
|
-
readonly host_sign_payload_with_legacy_account: VersionedProtocolRequest<{
|
|
216
|
-
readonly v1: [Codec<{
|
|
217
|
-
signer: string;
|
|
218
|
-
payload: {
|
|
219
|
-
blockHash: `0x${string}`;
|
|
220
|
-
blockNumber: `0x${string}`;
|
|
221
|
-
era: `0x${string}`;
|
|
222
|
-
genesisHash: `0x${string}`;
|
|
223
|
-
method: `0x${string}`;
|
|
224
|
-
nonce: `0x${string}`;
|
|
225
|
-
specVersion: `0x${string}`;
|
|
226
|
-
tip: `0x${string}`;
|
|
227
|
-
transactionVersion: `0x${string}`;
|
|
228
|
-
signedExtensions: string[];
|
|
229
|
-
version: number;
|
|
230
|
-
assetId: `0x${string}` | undefined;
|
|
231
|
-
metadataHash: `0x${string}` | undefined;
|
|
232
|
-
mode: number | undefined;
|
|
233
|
-
withSignedTransaction: boolean | undefined;
|
|
234
|
-
};
|
|
235
|
-
}>, Codec<import("scale-ts").ResultPayload<{
|
|
236
|
-
signature: `0x${string}`;
|
|
237
|
-
signedTransaction: `0x${string}` | undefined;
|
|
238
|
-
}, import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
239
|
-
reason: string;
|
|
240
|
-
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
241
|
-
}>;
|
|
242
180
|
readonly host_chat_create_room: VersionedProtocolRequest<{
|
|
243
181
|
readonly v1: [Codec<{
|
|
244
182
|
roomId: string;
|
|
@@ -265,7 +203,7 @@ export declare const hostApiProtocol: {
|
|
|
265
203
|
readonly v1: [Codec<undefined>, Codec<{
|
|
266
204
|
roomId: string;
|
|
267
205
|
participatingAs: "RoomHost" | "Bot";
|
|
268
|
-
}[]>];
|
|
206
|
+
}[]>, Codec<undefined>];
|
|
269
207
|
}>;
|
|
270
208
|
readonly host_chat_post_message: VersionedProtocolRequest<{
|
|
271
209
|
readonly v1: [Codec<{
|
|
@@ -394,14 +332,14 @@ export declare const hostApiProtocol: {
|
|
|
394
332
|
payload: string;
|
|
395
333
|
};
|
|
396
334
|
};
|
|
397
|
-
}>];
|
|
335
|
+
}>, Codec<undefined>];
|
|
398
336
|
}>;
|
|
399
337
|
readonly product_chat_custom_message_render_subscribe: VersionedProtocolSubscription<{
|
|
400
338
|
readonly v1: [Codec<{
|
|
401
339
|
messageId: string;
|
|
402
340
|
messageType: string;
|
|
403
341
|
payload: Uint8Array<ArrayBufferLike>;
|
|
404
|
-
}>, Codec<import("./v1/customRenderer.js").CustomRendererNodeType>];
|
|
342
|
+
}>, Codec<import("./v1/customRenderer.js").CustomRendererNodeType>, Codec<undefined>];
|
|
405
343
|
}>;
|
|
406
344
|
readonly remote_statement_store_subscribe: VersionedProtocolSubscription<{
|
|
407
345
|
readonly v1: [Codec<{
|
|
@@ -445,7 +383,7 @@ export declare const hostApiProtocol: {
|
|
|
445
383
|
data: Uint8Array<ArrayBufferLike> | undefined;
|
|
446
384
|
}[];
|
|
447
385
|
isComplete: boolean;
|
|
448
|
-
}>];
|
|
386
|
+
}>, Codec<undefined>];
|
|
449
387
|
}>;
|
|
450
388
|
readonly remote_statement_store_create_proof: VersionedProtocolRequest<{
|
|
451
389
|
readonly v1: [Codec<[[string, number], {
|
|
@@ -547,63 +485,14 @@ export declare const hostApiProtocol: {
|
|
|
547
485
|
}, "GenericError">>>];
|
|
548
486
|
}>;
|
|
549
487
|
readonly remote_preimage_lookup_subscribe: VersionedProtocolSubscription<{
|
|
550
|
-
readonly v1: [Codec<`0x${string}`>, Codec<Uint8Array<ArrayBufferLike> | null>];
|
|
488
|
+
readonly v1: [Codec<`0x${string}`>, Codec<Uint8Array<ArrayBufferLike> | null>, Codec<undefined>];
|
|
551
489
|
}>;
|
|
552
490
|
readonly remote_preimage_submit: VersionedProtocolRequest<{
|
|
553
491
|
readonly v1: [Codec<Uint8Array<ArrayBufferLike>>, Codec<import("scale-ts").ResultPayload<`0x${string}`, import("@novasamatech/scale").CodecError<{
|
|
554
492
|
reason: string;
|
|
555
493
|
}, "PreimageSubmitErr::Unknown">>>];
|
|
556
494
|
}>;
|
|
557
|
-
readonly
|
|
558
|
-
readonly v1: [Codec<undefined>, Codec<{
|
|
559
|
-
available: bigint;
|
|
560
|
-
}>];
|
|
561
|
-
}>;
|
|
562
|
-
readonly host_payment_top_up: VersionedProtocolRequest<{
|
|
563
|
-
readonly v1: [Codec<{
|
|
564
|
-
amount: bigint;
|
|
565
|
-
source: {
|
|
566
|
-
tag: "ProductAccount";
|
|
567
|
-
value: [string, number];
|
|
568
|
-
} | {
|
|
569
|
-
tag: "PrivateKey";
|
|
570
|
-
value: Uint8Array<ArrayBufferLike>;
|
|
571
|
-
};
|
|
572
|
-
}>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
573
|
-
reason: string;
|
|
574
|
-
}, "PaymentTopUpErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentTopUpErr::InsufficientFunds"> | import("@novasamatech/scale").CodecError<undefined, "PaymentTopUpErr::InvalidSource">>>];
|
|
575
|
-
}>;
|
|
576
|
-
readonly host_payment_request: VersionedProtocolRequest<{
|
|
577
|
-
readonly v1: [Codec<{
|
|
578
|
-
amount: bigint;
|
|
579
|
-
destination: Uint8Array<ArrayBufferLike>;
|
|
580
|
-
}>, Codec<import("scale-ts").ResultPayload<{
|
|
581
|
-
id: string;
|
|
582
|
-
}, import("@novasamatech/scale").CodecError<undefined, "PaymentRequestErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
583
|
-
reason: string;
|
|
584
|
-
}, "PaymentRequestErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentRequestErr::InsufficientBalance">>>];
|
|
585
|
-
}>;
|
|
586
|
-
readonly host_payment_status_subscribe: VersionedProtocolSubscription<{
|
|
587
|
-
readonly v1: [Codec<string>, Codec<{
|
|
588
|
-
tag: "Processing";
|
|
589
|
-
value: undefined;
|
|
590
|
-
} | {
|
|
591
|
-
tag: "Completed";
|
|
592
|
-
value: undefined;
|
|
593
|
-
} | {
|
|
594
|
-
tag: "Failed";
|
|
595
|
-
value: string;
|
|
596
|
-
}>];
|
|
597
|
-
}>;
|
|
598
|
-
readonly host_jsonrpc_message_send: VersionedProtocolRequest<{
|
|
599
|
-
readonly v1: [Codec<[`0x${string}`, string]>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
600
|
-
reason: string;
|
|
601
|
-
}, "GenericError">>>];
|
|
602
|
-
}>;
|
|
603
|
-
readonly host_jsonrpc_message_subscribe: VersionedProtocolSubscription<{
|
|
604
|
-
readonly v1: [Codec<`0x${string}`>, Codec<string>];
|
|
605
|
-
}>;
|
|
606
|
-
readonly remote_chain_head_follow: VersionedProtocolSubscription<{
|
|
495
|
+
readonly remote_chain_head_follow_subscribe: VersionedProtocolSubscription<{
|
|
607
496
|
readonly v1: [Codec<{
|
|
608
497
|
genesisHash: `0x${string}`;
|
|
609
498
|
withRuntime: boolean;
|
|
@@ -708,7 +597,7 @@ export declare const hostApiProtocol: {
|
|
|
708
597
|
} | {
|
|
709
598
|
tag: "Stop";
|
|
710
599
|
value: undefined;
|
|
711
|
-
}>];
|
|
600
|
+
}>, Codec<undefined>];
|
|
712
601
|
}>;
|
|
713
602
|
readonly remote_chain_head_header: VersionedProtocolRequest<{
|
|
714
603
|
readonly v1: [Codec<{
|
|
@@ -835,5 +724,143 @@ export declare const hostApiProtocol: {
|
|
|
835
724
|
reason: string;
|
|
836
725
|
}, "GenericError">>>];
|
|
837
726
|
}>;
|
|
727
|
+
readonly host_theme_subscribe: VersionedProtocolSubscription<{
|
|
728
|
+
readonly v1: [Codec<undefined>, Codec<"light" | "dark">, Codec<undefined>];
|
|
729
|
+
}>;
|
|
730
|
+
readonly host_derive_entropy: VersionedProtocolRequest<{
|
|
731
|
+
readonly v1: [Codec<Uint8Array<ArrayBufferLike>>, Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<{
|
|
732
|
+
reason: string;
|
|
733
|
+
}, "DeriveEntropyErr::Unknown">>>];
|
|
734
|
+
}>;
|
|
735
|
+
readonly host_account_get_root: VersionedProtocolRequest<{
|
|
736
|
+
readonly v1: [Codec<undefined>, Codec<import("scale-ts").ResultPayload<{
|
|
737
|
+
publicKey: Uint8Array<ArrayBufferLike>;
|
|
738
|
+
name: string | undefined;
|
|
739
|
+
}, import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::NotConnected"> | import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::Rejected"> | import("@novasamatech/scale").CodecError<undefined, "RequestCredentialsErr::DomainNotValid"> | import("@novasamatech/scale").CodecError<{
|
|
740
|
+
reason: string;
|
|
741
|
+
}, "RequestCredentialsErr::Unknown">>>];
|
|
742
|
+
}>;
|
|
743
|
+
readonly host_request_login: VersionedProtocolRequest<{
|
|
744
|
+
readonly v1: [Codec<string | undefined>, Codec<import("scale-ts").ResultPayload<"success" | "alreadyConnected" | "rejected", import("@novasamatech/scale").CodecError<{
|
|
745
|
+
reason: string;
|
|
746
|
+
}, "LoginErr::Unknown">>>];
|
|
747
|
+
}>;
|
|
748
|
+
readonly host_sign_raw_with_legacy_account: VersionedProtocolRequest<{
|
|
749
|
+
readonly v1: [Codec<{
|
|
750
|
+
signer: string;
|
|
751
|
+
payload: {
|
|
752
|
+
tag: "Bytes";
|
|
753
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
754
|
+
} | {
|
|
755
|
+
tag: "Payload";
|
|
756
|
+
value: string;
|
|
757
|
+
};
|
|
758
|
+
}>, Codec<import("scale-ts").ResultPayload<{
|
|
759
|
+
signature: `0x${string}`;
|
|
760
|
+
signedTransaction: `0x${string}` | undefined;
|
|
761
|
+
}, import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
762
|
+
reason: string;
|
|
763
|
+
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
764
|
+
}>;
|
|
765
|
+
readonly host_sign_payload_with_legacy_account: VersionedProtocolRequest<{
|
|
766
|
+
readonly v1: [Codec<{
|
|
767
|
+
signer: string;
|
|
768
|
+
payload: {
|
|
769
|
+
blockHash: `0x${string}`;
|
|
770
|
+
blockNumber: `0x${string}`;
|
|
771
|
+
era: `0x${string}`;
|
|
772
|
+
genesisHash: `0x${string}`;
|
|
773
|
+
method: `0x${string}`;
|
|
774
|
+
nonce: `0x${string}`;
|
|
775
|
+
specVersion: `0x${string}`;
|
|
776
|
+
tip: `0x${string}`;
|
|
777
|
+
transactionVersion: `0x${string}`;
|
|
778
|
+
signedExtensions: string[];
|
|
779
|
+
version: number;
|
|
780
|
+
assetId: `0x${string}` | undefined;
|
|
781
|
+
metadataHash: `0x${string}` | undefined;
|
|
782
|
+
mode: number | undefined;
|
|
783
|
+
withSignedTransaction: boolean | undefined;
|
|
784
|
+
};
|
|
785
|
+
}>, Codec<import("scale-ts").ResultPayload<{
|
|
786
|
+
signature: `0x${string}`;
|
|
787
|
+
signedTransaction: `0x${string}` | undefined;
|
|
788
|
+
}, import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
789
|
+
reason: string;
|
|
790
|
+
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
791
|
+
}>;
|
|
792
|
+
readonly host_payment_balance_subscribe: VersionedProtocolSubscription<{
|
|
793
|
+
readonly v1: [Codec<undefined>, Codec<{
|
|
794
|
+
available: bigint;
|
|
795
|
+
}>, [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
796
|
+
reason: string;
|
|
797
|
+
}, "PaymentBalanceErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentBalanceErr::PermissionDenied">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
798
|
+
reason: string;
|
|
799
|
+
}, "PaymentBalanceErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentBalanceErr::PermissionDenied">>] & {
|
|
800
|
+
enc: import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
801
|
+
reason: string;
|
|
802
|
+
}, "PaymentBalanceErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentBalanceErr::PermissionDenied">>;
|
|
803
|
+
dec: import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
804
|
+
reason: string;
|
|
805
|
+
}, "PaymentBalanceErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentBalanceErr::PermissionDenied">>;
|
|
806
|
+
} & {
|
|
807
|
+
readonly PermissionDenied: import("@novasamatech/scale").ErrCodec<undefined, "PaymentBalanceErr::PermissionDenied">;
|
|
808
|
+
readonly Unknown: import("@novasamatech/scale").ErrCodec<{
|
|
809
|
+
reason: string;
|
|
810
|
+
}, "PaymentBalanceErr::Unknown">;
|
|
811
|
+
}];
|
|
812
|
+
}>;
|
|
813
|
+
readonly host_payment_top_up: VersionedProtocolRequest<{
|
|
814
|
+
readonly v1: [Codec<{
|
|
815
|
+
amount: bigint;
|
|
816
|
+
source: {
|
|
817
|
+
tag: "ProductAccount";
|
|
818
|
+
value: number;
|
|
819
|
+
} | {
|
|
820
|
+
tag: "PrivateKey";
|
|
821
|
+
value: Uint8Array<ArrayBufferLike>;
|
|
822
|
+
};
|
|
823
|
+
}>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
824
|
+
reason: string;
|
|
825
|
+
}, "PaymentTopUpErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentTopUpErr::InsufficientFunds"> | import("@novasamatech/scale").CodecError<undefined, "PaymentTopUpErr::InvalidSource">>>];
|
|
826
|
+
}>;
|
|
827
|
+
readonly host_payment_request: VersionedProtocolRequest<{
|
|
828
|
+
readonly v1: [Codec<{
|
|
829
|
+
amount: bigint;
|
|
830
|
+
destination: Uint8Array<ArrayBufferLike>;
|
|
831
|
+
}>, Codec<import("scale-ts").ResultPayload<{
|
|
832
|
+
id: string;
|
|
833
|
+
}, import("@novasamatech/scale").CodecError<undefined, "PaymentRequestErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
834
|
+
reason: string;
|
|
835
|
+
}, "PaymentRequestErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentRequestErr::InsufficientBalance">>>];
|
|
836
|
+
}>;
|
|
837
|
+
readonly host_payment_status_subscribe: VersionedProtocolSubscription<{
|
|
838
|
+
readonly v1: [Codec<string>, Codec<{
|
|
839
|
+
tag: "Processing";
|
|
840
|
+
value: undefined;
|
|
841
|
+
} | {
|
|
842
|
+
tag: "Completed";
|
|
843
|
+
value: undefined;
|
|
844
|
+
} | {
|
|
845
|
+
tag: "Failed";
|
|
846
|
+
value: string;
|
|
847
|
+
}>, [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
848
|
+
reason: string;
|
|
849
|
+
}, "PaymentStatusErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentStatusErr::PaymentNotFound">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
850
|
+
reason: string;
|
|
851
|
+
}, "PaymentStatusErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentStatusErr::PaymentNotFound">>] & {
|
|
852
|
+
enc: import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
853
|
+
reason: string;
|
|
854
|
+
}, "PaymentStatusErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentStatusErr::PaymentNotFound">>;
|
|
855
|
+
dec: import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
856
|
+
reason: string;
|
|
857
|
+
}, "PaymentStatusErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentStatusErr::PaymentNotFound">>;
|
|
858
|
+
} & {
|
|
859
|
+
readonly PaymentNotFound: import("@novasamatech/scale").ErrCodec<undefined, "PaymentStatusErr::PaymentNotFound">;
|
|
860
|
+
readonly Unknown: import("@novasamatech/scale").ErrCodec<{
|
|
861
|
+
reason: string;
|
|
862
|
+
}, "PaymentStatusErr::Unknown">;
|
|
863
|
+
}];
|
|
864
|
+
}>;
|
|
838
865
|
};
|
|
839
866
|
export {};
|
package/dist/protocol/impl.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { Enum } from '@novasamatech/scale';
|
|
2
|
-
import { AccountConnectionStatusV1_receive, AccountConnectionStatusV1_start, AccountCreateProofV1_request, AccountCreateProofV1_response, AccountGetAliasV1_request, AccountGetAliasV1_response, AccountGetRootV1_request, AccountGetRootV1_response, AccountGetV1_request, AccountGetV1_response, GetLegacyAccountsV1_request, GetLegacyAccountsV1_response, RequestLoginV1_request, RequestLoginV1_response, } from './v1/accounts.js';
|
|
3
|
-
import { ChainHeadBodyV1_request, ChainHeadBodyV1_response, ChainHeadCallV1_request, ChainHeadCallV1_response, ChainHeadContinueV1_request, ChainHeadContinueV1_response, ChainHeadFollowV1_receive, ChainHeadFollowV1_start, ChainHeadHeaderV1_request, ChainHeadHeaderV1_response, ChainHeadStopOperationV1_request, ChainHeadStopOperationV1_response, ChainHeadStorageV1_request, ChainHeadStorageV1_response, ChainHeadUnpinV1_request, ChainHeadUnpinV1_response, ChainSpecChainNameV1_request, ChainSpecChainNameV1_response, ChainSpecGenesisHashV1_request, ChainSpecGenesisHashV1_response, ChainSpecPropertiesV1_request, ChainSpecPropertiesV1_response, TransactionBroadcastV1_request, TransactionBroadcastV1_response, TransactionStopV1_request, TransactionStopV1_response, } from './v1/chainInteraction.js';
|
|
4
|
-
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';
|
|
2
|
+
import { AccountConnectionStatusV1_interrupt, AccountConnectionStatusV1_receive, AccountConnectionStatusV1_start, AccountCreateProofV1_request, AccountCreateProofV1_response, AccountGetAliasV1_request, AccountGetAliasV1_response, AccountGetRootV1_request, AccountGetRootV1_response, AccountGetV1_request, AccountGetV1_response, GetLegacyAccountsV1_request, GetLegacyAccountsV1_response, RequestLoginV1_request, RequestLoginV1_response, } from './v1/accounts.js';
|
|
3
|
+
import { ChainHeadBodyV1_request, ChainHeadBodyV1_response, ChainHeadCallV1_request, ChainHeadCallV1_response, ChainHeadContinueV1_request, ChainHeadContinueV1_response, ChainHeadFollowV1_interrupt, ChainHeadFollowV1_receive, ChainHeadFollowV1_start, ChainHeadHeaderV1_request, ChainHeadHeaderV1_response, ChainHeadStopOperationV1_request, ChainHeadStopOperationV1_response, ChainHeadStorageV1_request, ChainHeadStorageV1_response, ChainHeadUnpinV1_request, ChainHeadUnpinV1_response, ChainSpecChainNameV1_request, ChainSpecChainNameV1_response, ChainSpecGenesisHashV1_request, ChainSpecGenesisHashV1_response, ChainSpecPropertiesV1_request, ChainSpecPropertiesV1_response, TransactionBroadcastV1_request, TransactionBroadcastV1_response, TransactionStopV1_request, TransactionStopV1_response, } from './v1/chainInteraction.js';
|
|
4
|
+
import { ChatActionSubscribeV1_interrupt, ChatActionSubscribeV1_receive, ChatActionSubscribeV1_start, ChatCreateRoomV1_request, ChatCreateRoomV1_response, ChatCustomMessageRenderingV1_interrupt, ChatCustomMessageRenderingV1_receive, ChatCustomMessageRenderingV1_start, ChatListSubscribeV1_interrupt, ChatListSubscribeV1_receive, ChatListSubscribeV1_start, ChatPostMessageV1_request, ChatPostMessageV1_response, ChatRegisterBotV1_request, ChatRegisterBotV1_response, } from './v1/chat.js';
|
|
5
5
|
import { CreateTransactionV1_request, CreateTransactionV1_response, CreateTransactionWithLegacyAccountV1_request, CreateTransactionWithLegacyAccountV1_response, } from './v1/createTransaction.js';
|
|
6
6
|
import { DeriveEntropyV1_request, DeriveEntropyV1_response } from './v1/deriveEntropy.js';
|
|
7
7
|
import { DevicePermissionV1_request, DevicePermissionV1_response } from './v1/devicePermission.js';
|
|
8
8
|
import { FeatureV1_request, FeatureV1_response } from './v1/feature.js';
|
|
9
9
|
import { HandshakeV1_request, HandshakeV1_response } from './v1/handshake.js';
|
|
10
|
-
import { JsonRpcMessageSendV1_request, JsonRpcMessageSendV1_response, JsonRpcMessageSubscribeV1_receive, JsonRpcMessageSubscribeV1_start, } from './v1/jsonRpc.js';
|
|
11
10
|
import { StorageClearV1_request, StorageClearV1_response, StorageReadV1_request, StorageReadV1_response, StorageWriteV1_request, StorageWriteV1_response, } from './v1/localStorage.js';
|
|
12
11
|
import { NavigateToV1_request, NavigateToV1_response } from './v1/navigation.js';
|
|
13
12
|
import { PushNotificationV1_request, PushNotificationV1_response } from './v1/notification.js';
|
|
14
|
-
import { PaymentBalanceSubscribeV1_receive, PaymentBalanceSubscribeV1_start, PaymentRequestV1_request, PaymentRequestV1_response, PaymentStatusSubscribeV1_receive, PaymentStatusSubscribeV1_start, PaymentTopUpV1_request, PaymentTopUpV1_response, } from './v1/payments.js';
|
|
15
|
-
import { PreimageLookupSubscribeV1_receive, PreimageLookupSubscribeV1_start, PreimageSubmitV1_request, PreimageSubmitV1_response, } from './v1/preimage.js';
|
|
13
|
+
import { PaymentBalanceSubscribeV1_interrupt, PaymentBalanceSubscribeV1_receive, PaymentBalanceSubscribeV1_start, PaymentRequestV1_request, PaymentRequestV1_response, PaymentStatusSubscribeV1_interrupt, PaymentStatusSubscribeV1_receive, PaymentStatusSubscribeV1_start, PaymentTopUpV1_request, PaymentTopUpV1_response, } from './v1/payments.js';
|
|
14
|
+
import { PreimageLookupSubscribeV1_interrupt, PreimageLookupSubscribeV1_receive, PreimageLookupSubscribeV1_start, PreimageSubmitV1_request, PreimageSubmitV1_response, } from './v1/preimage.js';
|
|
16
15
|
import { RemotePermissionV1_request, RemotePermissionV1_response } from './v1/remotePermission.js';
|
|
17
16
|
import { SignPayloadV1_request, SignPayloadV1_response, SignPayloadWithLegacyAccountV1_request, SignPayloadWithLegacyAccountV1_response, SignRawV1_request, SignRawV1_response, SignRawWithLegacyAccountV1_request, SignRawWithLegacyAccountV1_response, } from './v1/sign.js';
|
|
18
|
-
import { StatementStoreCreateProofV1_request, StatementStoreCreateProofV1_response, StatementStoreSubmitV1_request, StatementStoreSubmitV1_response, StatementStoreSubscribeV1_receive, StatementStoreSubscribeV1_start, } from './v1/statementStore.js';
|
|
19
|
-
import { ThemeSubscribeV1_receive, ThemeSubscribeV1_start } from './v1/theme.js';
|
|
17
|
+
import { StatementStoreCreateProofV1_request, StatementStoreCreateProofV1_response, StatementStoreSubmitV1_request, StatementStoreSubmitV1_response, StatementStoreSubscribeV1_interrupt, StatementStoreSubscribeV1_receive, StatementStoreSubscribeV1_start, } from './v1/statementStore.js';
|
|
18
|
+
import { ThemeSubscribeV1_interrupt, ThemeSubscribeV1_receive, ThemeSubscribeV1_start } from './v1/theme.js';
|
|
20
19
|
const enumFromArg = (enumValues, n) => {
|
|
21
20
|
return Enum(Object.fromEntries(Object.entries(enumValues).map(([key, value]) => [key, value[n]])));
|
|
22
21
|
};
|
|
@@ -32,10 +31,10 @@ const versionedSubscription = (values) => {
|
|
|
32
31
|
method: 'subscribe',
|
|
33
32
|
start: enumFromArg(values, 0),
|
|
34
33
|
receive: enumFromArg(values, 1),
|
|
34
|
+
interrupt: enumFromArg(values, 2),
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
export const hostApiProtocol = {
|
|
38
|
-
// Host calls
|
|
39
38
|
host_handshake: versionedRequest({
|
|
40
39
|
v1: [HandshakeV1_request, HandshakeV1_response],
|
|
41
40
|
}),
|
|
@@ -45,23 +44,15 @@ export const hostApiProtocol = {
|
|
|
45
44
|
host_push_notification: versionedRequest({
|
|
46
45
|
v1: [PushNotificationV1_request, PushNotificationV1_response],
|
|
47
46
|
}),
|
|
48
|
-
host_theme_subscribe: versionedSubscription({
|
|
49
|
-
v1: [ThemeSubscribeV1_start, ThemeSubscribeV1_receive],
|
|
50
|
-
}),
|
|
51
47
|
host_navigate_to: versionedRequest({
|
|
52
48
|
v1: [NavigateToV1_request, NavigateToV1_response],
|
|
53
49
|
}),
|
|
54
|
-
host_derive_entropy: versionedRequest({
|
|
55
|
-
v1: [DeriveEntropyV1_request, DeriveEntropyV1_response],
|
|
56
|
-
}),
|
|
57
|
-
// Permissions
|
|
58
50
|
host_device_permission: versionedRequest({
|
|
59
51
|
v1: [DevicePermissionV1_request, DevicePermissionV1_response],
|
|
60
52
|
}),
|
|
61
53
|
remote_permission: versionedRequest({
|
|
62
54
|
v1: [RemotePermissionV1_request, RemotePermissionV1_response],
|
|
63
55
|
}),
|
|
64
|
-
// Local storage
|
|
65
56
|
host_local_storage_read: versionedRequest({
|
|
66
57
|
v1: [StorageReadV1_request, StorageReadV1_response],
|
|
67
58
|
}),
|
|
@@ -71,15 +62,8 @@ export const hostApiProtocol = {
|
|
|
71
62
|
host_local_storage_clear: versionedRequest({
|
|
72
63
|
v1: [StorageClearV1_request, StorageClearV1_response],
|
|
73
64
|
}),
|
|
74
|
-
// Account management
|
|
75
|
-
host_account_get_root: versionedRequest({
|
|
76
|
-
v1: [AccountGetRootV1_request, AccountGetRootV1_response],
|
|
77
|
-
}),
|
|
78
|
-
host_request_login: versionedRequest({
|
|
79
|
-
v1: [RequestLoginV1_request, RequestLoginV1_response],
|
|
80
|
-
}),
|
|
81
65
|
host_account_connection_status_subscribe: versionedSubscription({
|
|
82
|
-
v1: [AccountConnectionStatusV1_start, AccountConnectionStatusV1_receive],
|
|
66
|
+
v1: [AccountConnectionStatusV1_start, AccountConnectionStatusV1_receive, AccountConnectionStatusV1_interrupt],
|
|
83
67
|
}),
|
|
84
68
|
host_account_get: versionedRequest({
|
|
85
69
|
v1: [AccountGetV1_request, AccountGetV1_response],
|
|
@@ -93,7 +77,6 @@ export const hostApiProtocol = {
|
|
|
93
77
|
host_get_legacy_accounts: versionedRequest({
|
|
94
78
|
v1: [GetLegacyAccountsV1_request, GetLegacyAccountsV1_response],
|
|
95
79
|
}),
|
|
96
|
-
// Signing
|
|
97
80
|
host_create_transaction: versionedRequest({
|
|
98
81
|
v1: [CreateTransactionV1_request, CreateTransactionV1_response],
|
|
99
82
|
}),
|
|
@@ -103,16 +86,9 @@ export const hostApiProtocol = {
|
|
|
103
86
|
host_sign_raw: versionedRequest({
|
|
104
87
|
v1: [SignRawV1_request, SignRawV1_response],
|
|
105
88
|
}),
|
|
106
|
-
host_sign_raw_with_legacy_account: versionedRequest({
|
|
107
|
-
v1: [SignRawWithLegacyAccountV1_request, SignRawWithLegacyAccountV1_response],
|
|
108
|
-
}),
|
|
109
89
|
host_sign_payload: versionedRequest({
|
|
110
90
|
v1: [SignPayloadV1_request, SignPayloadV1_response],
|
|
111
91
|
}),
|
|
112
|
-
host_sign_payload_with_legacy_account: versionedRequest({
|
|
113
|
-
v1: [SignPayloadWithLegacyAccountV1_request, SignPayloadWithLegacyAccountV1_response],
|
|
114
|
-
}),
|
|
115
|
-
// Chat
|
|
116
92
|
host_chat_create_room: versionedRequest({
|
|
117
93
|
v1: [ChatCreateRoomV1_request, ChatCreateRoomV1_response],
|
|
118
94
|
}),
|
|
@@ -120,20 +96,23 @@ export const hostApiProtocol = {
|
|
|
120
96
|
v1: [ChatRegisterBotV1_request, ChatRegisterBotV1_response],
|
|
121
97
|
}),
|
|
122
98
|
host_chat_list_subscribe: versionedSubscription({
|
|
123
|
-
v1: [ChatListSubscribeV1_start, ChatListSubscribeV1_receive],
|
|
99
|
+
v1: [ChatListSubscribeV1_start, ChatListSubscribeV1_receive, ChatListSubscribeV1_interrupt],
|
|
124
100
|
}),
|
|
125
101
|
host_chat_post_message: versionedRequest({
|
|
126
102
|
v1: [ChatPostMessageV1_request, ChatPostMessageV1_response],
|
|
127
103
|
}),
|
|
128
104
|
host_chat_action_subscribe: versionedSubscription({
|
|
129
|
-
v1: [ChatActionSubscribeV1_start, ChatActionSubscribeV1_receive],
|
|
105
|
+
v1: [ChatActionSubscribeV1_start, ChatActionSubscribeV1_receive, ChatActionSubscribeV1_interrupt],
|
|
130
106
|
}),
|
|
131
107
|
product_chat_custom_message_render_subscribe: versionedSubscription({
|
|
132
|
-
v1: [
|
|
108
|
+
v1: [
|
|
109
|
+
ChatCustomMessageRenderingV1_start,
|
|
110
|
+
ChatCustomMessageRenderingV1_receive,
|
|
111
|
+
ChatCustomMessageRenderingV1_interrupt,
|
|
112
|
+
],
|
|
133
113
|
}),
|
|
134
|
-
// Statement store (remote namespace)
|
|
135
114
|
remote_statement_store_subscribe: versionedSubscription({
|
|
136
|
-
v1: [StatementStoreSubscribeV1_start, StatementStoreSubscribeV1_receive],
|
|
115
|
+
v1: [StatementStoreSubscribeV1_start, StatementStoreSubscribeV1_receive, StatementStoreSubscribeV1_interrupt],
|
|
137
116
|
}),
|
|
138
117
|
remote_statement_store_create_proof: versionedRequest({
|
|
139
118
|
v1: [StatementStoreCreateProofV1_request, StatementStoreCreateProofV1_response],
|
|
@@ -141,36 +120,14 @@ export const hostApiProtocol = {
|
|
|
141
120
|
remote_statement_store_submit: versionedRequest({
|
|
142
121
|
v1: [StatementStoreSubmitV1_request, StatementStoreSubmitV1_response],
|
|
143
122
|
}),
|
|
144
|
-
// Preimage lookup
|
|
145
123
|
remote_preimage_lookup_subscribe: versionedSubscription({
|
|
146
|
-
v1: [PreimageLookupSubscribeV1_start, PreimageLookupSubscribeV1_receive],
|
|
124
|
+
v1: [PreimageLookupSubscribeV1_start, PreimageLookupSubscribeV1_receive, PreimageLookupSubscribeV1_interrupt],
|
|
147
125
|
}),
|
|
148
126
|
remote_preimage_submit: versionedRequest({
|
|
149
127
|
v1: [PreimageSubmitV1_request, PreimageSubmitV1_response],
|
|
150
128
|
}),
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
v1: [PaymentBalanceSubscribeV1_start, PaymentBalanceSubscribeV1_receive],
|
|
154
|
-
}),
|
|
155
|
-
host_payment_top_up: versionedRequest({
|
|
156
|
-
v1: [PaymentTopUpV1_request, PaymentTopUpV1_response],
|
|
157
|
-
}),
|
|
158
|
-
host_payment_request: versionedRequest({
|
|
159
|
-
v1: [PaymentRequestV1_request, PaymentRequestV1_response],
|
|
160
|
-
}),
|
|
161
|
-
host_payment_status_subscribe: versionedSubscription({
|
|
162
|
-
v1: [PaymentStatusSubscribeV1_start, PaymentStatusSubscribeV1_receive],
|
|
163
|
-
}),
|
|
164
|
-
// json rpc (deprecated: use remote_chain_* methods instead)
|
|
165
|
-
host_jsonrpc_message_send: versionedRequest({
|
|
166
|
-
v1: [JsonRpcMessageSendV1_request, JsonRpcMessageSendV1_response],
|
|
167
|
-
}),
|
|
168
|
-
host_jsonrpc_message_subscribe: versionedSubscription({
|
|
169
|
-
v1: [JsonRpcMessageSubscribeV1_start, JsonRpcMessageSubscribeV1_receive],
|
|
170
|
-
}),
|
|
171
|
-
// chain interaction (remote namespace)
|
|
172
|
-
remote_chain_head_follow: versionedSubscription({
|
|
173
|
-
v1: [ChainHeadFollowV1_start, ChainHeadFollowV1_receive],
|
|
129
|
+
remote_chain_head_follow_subscribe: versionedSubscription({
|
|
130
|
+
v1: [ChainHeadFollowV1_start, ChainHeadFollowV1_receive, ChainHeadFollowV1_interrupt],
|
|
174
131
|
}),
|
|
175
132
|
remote_chain_head_header: versionedRequest({
|
|
176
133
|
v1: [ChainHeadHeaderV1_request, ChainHeadHeaderV1_response],
|
|
@@ -208,4 +165,34 @@ export const hostApiProtocol = {
|
|
|
208
165
|
remote_chain_transaction_stop: versionedRequest({
|
|
209
166
|
v1: [TransactionStopV1_request, TransactionStopV1_response],
|
|
210
167
|
}),
|
|
168
|
+
host_theme_subscribe: versionedSubscription({
|
|
169
|
+
v1: [ThemeSubscribeV1_start, ThemeSubscribeV1_receive, ThemeSubscribeV1_interrupt],
|
|
170
|
+
}),
|
|
171
|
+
host_derive_entropy: versionedRequest({
|
|
172
|
+
v1: [DeriveEntropyV1_request, DeriveEntropyV1_response],
|
|
173
|
+
}),
|
|
174
|
+
host_account_get_root: versionedRequest({
|
|
175
|
+
v1: [AccountGetRootV1_request, AccountGetRootV1_response],
|
|
176
|
+
}),
|
|
177
|
+
host_request_login: versionedRequest({
|
|
178
|
+
v1: [RequestLoginV1_request, RequestLoginV1_response],
|
|
179
|
+
}),
|
|
180
|
+
host_sign_raw_with_legacy_account: versionedRequest({
|
|
181
|
+
v1: [SignRawWithLegacyAccountV1_request, SignRawWithLegacyAccountV1_response],
|
|
182
|
+
}),
|
|
183
|
+
host_sign_payload_with_legacy_account: versionedRequest({
|
|
184
|
+
v1: [SignPayloadWithLegacyAccountV1_request, SignPayloadWithLegacyAccountV1_response],
|
|
185
|
+
}),
|
|
186
|
+
host_payment_balance_subscribe: versionedSubscription({
|
|
187
|
+
v1: [PaymentBalanceSubscribeV1_start, PaymentBalanceSubscribeV1_receive, PaymentBalanceSubscribeV1_interrupt],
|
|
188
|
+
}),
|
|
189
|
+
host_payment_top_up: versionedRequest({
|
|
190
|
+
v1: [PaymentTopUpV1_request, PaymentTopUpV1_response],
|
|
191
|
+
}),
|
|
192
|
+
host_payment_request: versionedRequest({
|
|
193
|
+
v1: [PaymentRequestV1_request, PaymentRequestV1_response],
|
|
194
|
+
}),
|
|
195
|
+
host_payment_status_subscribe: versionedSubscription({
|
|
196
|
+
v1: [PaymentStatusSubscribeV1_start, PaymentStatusSubscribeV1_receive, PaymentStatusSubscribeV1_interrupt],
|
|
197
|
+
}),
|
|
211
198
|
};
|