@novasamatech/host-api 0.7.2-1 → 0.7.2-2

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.js CHANGED
@@ -297,6 +297,15 @@ export function createHostApi(transport) {
297
297
  value: new GenericError({ reason }),
298
298
  }));
299
299
  },
300
+ jsonrpcMessageSend(payload) {
301
+ return makeRequest(transport.request('host_jsonrpc_message_send', payload), () => ({
302
+ tag: payload.tag,
303
+ value: undefined,
304
+ }));
305
+ },
306
+ jsonrpcMessageSubscribe(args, callback) {
307
+ return transport.subscribe('host_jsonrpc_message_subscribe', args, callback);
308
+ },
300
309
  };
301
310
  }
302
311
  function makeRequest(promise, mapErr) {
@@ -492,6 +492,12 @@ export declare const hostApiProtocol: {
492
492
  reason: string;
493
493
  }, "PreimageSubmitErr::Unknown">>>];
494
494
  }>;
495
+ readonly host_jsonrpc_message_send: VersionedProtocolRequest<{
496
+ readonly v1: [Codec<undefined>, Codec<import("scale-ts").ResultPayload<undefined, undefined>>];
497
+ }>;
498
+ readonly host_jsonrpc_message_subscribe: VersionedProtocolSubscription<{
499
+ readonly v1: [Codec<undefined>, Codec<undefined>, Codec<undefined>];
500
+ }>;
495
501
  readonly remote_chain_head_follow_subscribe: VersionedProtocolSubscription<{
496
502
  readonly v1: [Codec<{
497
503
  genesisHash: `0x${string}`;
@@ -1,4 +1,5 @@
1
1
  import { Enum } from '@novasamatech/scale';
2
+ import { Result, _void } from 'scale-ts';
2
3
  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
4
  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
5
  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';
@@ -126,6 +127,14 @@ export const hostApiProtocol = {
126
127
  remote_preimage_submit: versionedRequest({
127
128
  v1: [PreimageSubmitV1_request, PreimageSubmitV1_response],
128
129
  }),
130
+ // json rpc (deprecated: use remote_chain_* methods instead)
131
+ host_jsonrpc_message_send: versionedRequest({
132
+ v1: [_void, Result(_void, _void)],
133
+ }),
134
+ // json rpc (deprecated: use remote_chain_* methods instead)
135
+ host_jsonrpc_message_subscribe: versionedSubscription({
136
+ v1: [_void, _void, _void],
137
+ }),
129
138
  remote_chain_head_follow_subscribe: versionedSubscription({
130
139
  v1: [ChainHeadFollowV1_start, ChainHeadFollowV1_receive, ChainHeadFollowV1_interrupt],
131
140
  }),
@@ -523,7 +523,17 @@ export declare const MessagePayload: EnumCodec<Record<"host_handshake_request",
523
523
  readonly v1: Codec<import("scale-ts").ResultPayload<`0x${string}`, import("@novasamatech/scale").CodecError<{
524
524
  reason: string;
525
525
  }, "PreimageSubmitErr::Unknown">>>;
526
- }>> & Record<"remote_chain_head_follow_subscribe_start", EnumCodec<{
526
+ }>> & Record<"host_jsonrpc_message_send_request", EnumCodec<{
527
+ readonly v1: Codec<undefined>;
528
+ }>> & Record<"host_jsonrpc_message_send_response", EnumCodec<{
529
+ readonly v1: Codec<import("scale-ts").ResultPayload<undefined, undefined>>;
530
+ }>> & Record<"host_jsonrpc_message_subscribe_start", EnumCodec<{
531
+ readonly v1: Codec<undefined>;
532
+ }>> & Record<"host_jsonrpc_message_subscribe_receive", EnumCodec<{
533
+ readonly v1: Codec<undefined>;
534
+ }>> & Record<"host_jsonrpc_message_subscribe_interrupt", EnumCodec<{
535
+ readonly v1: Codec<undefined>;
536
+ }>> & Record<"host_jsonrpc_message_subscribe_stop", Codec<undefined>> & Record<"remote_chain_head_follow_subscribe_start", EnumCodec<{
527
537
  readonly v1: Codec<{
528
538
  genesisHash: `0x${string}`;
529
539
  withRuntime: boolean;
@@ -1715,6 +1725,39 @@ export declare const Message: Codec<{
1715
1725
  reason: string;
1716
1726
  }, "PreimageSubmitErr::Unknown">>;
1717
1727
  };
1728
+ } | {
1729
+ tag: "host_jsonrpc_message_send_request";
1730
+ value: {
1731
+ tag: "v1";
1732
+ value: undefined;
1733
+ };
1734
+ } | {
1735
+ tag: "host_jsonrpc_message_send_response";
1736
+ value: {
1737
+ tag: "v1";
1738
+ value: import("scale-ts").ResultPayload<undefined, undefined>;
1739
+ };
1740
+ } | {
1741
+ tag: "host_jsonrpc_message_subscribe_start";
1742
+ value: {
1743
+ tag: "v1";
1744
+ value: undefined;
1745
+ };
1746
+ } | {
1747
+ tag: "host_jsonrpc_message_subscribe_receive";
1748
+ value: {
1749
+ tag: "v1";
1750
+ value: undefined;
1751
+ };
1752
+ } | {
1753
+ tag: "host_jsonrpc_message_subscribe_interrupt";
1754
+ value: {
1755
+ tag: "v1";
1756
+ value: undefined;
1757
+ };
1758
+ } | {
1759
+ tag: "host_jsonrpc_message_subscribe_stop";
1760
+ value: undefined;
1718
1761
  } | {
1719
1762
  tag: "remote_chain_head_follow_subscribe_start";
1720
1763
  value: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@novasamatech/host-api",
3
3
  "type": "module",
4
- "version": "0.7.2-1",
4
+ "version": "0.7.2-2",
5
5
  "description": "Host API: transport implementation for host - product integration.",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -22,7 +22,7 @@
22
22
  "README.md"
23
23
  ],
24
24
  "dependencies": {
25
- "@novasamatech/scale": "0.7.2-1",
25
+ "@novasamatech/scale": "0.7.2-2",
26
26
  "nanoevents": "9.1.0",
27
27
  "nanoid": "5.1.9",
28
28
  "neverthrow": "^8.2.0",