@novasamatech/host-api 0.7.1 → 0.7.2-1
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 +2 -11
- package/dist/protocol/impl.d.ts +139 -147
- package/dist/protocol/impl.js +31 -49
- package/dist/protocol/messageCodec.d.ts +419 -466
- package/dist/protocol/v1/payments.d.ts +2 -2
- package/dist/protocol/v1/payments.js +2 -2
- package/package.json +2 -2
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
|
@@ -40,19 +40,11 @@ export declare const hostApiProtocol: {
|
|
|
40
40
|
reason: string;
|
|
41
41
|
}, "GenericError">>>];
|
|
42
42
|
}>;
|
|
43
|
-
readonly host_theme_subscribe: VersionedProtocolSubscription<{
|
|
44
|
-
readonly v1: [Codec<undefined>, Codec<"light" | "dark">, Codec<undefined>];
|
|
45
|
-
}>;
|
|
46
43
|
readonly host_navigate_to: VersionedProtocolRequest<{
|
|
47
44
|
readonly v1: [Codec<string>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
48
45
|
reason: string;
|
|
49
46
|
}, "NavigateToErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "NavigateToErr::PermissionDenied">>>];
|
|
50
47
|
}>;
|
|
51
|
-
readonly host_derive_entropy: VersionedProtocolRequest<{
|
|
52
|
-
readonly v1: [Codec<Uint8Array<ArrayBufferLike>>, Codec<import("scale-ts").ResultPayload<Uint8Array<ArrayBufferLike>, import("@novasamatech/scale").CodecError<{
|
|
53
|
-
reason: string;
|
|
54
|
-
}, "DeriveEntropyErr::Unknown">>>];
|
|
55
|
-
}>;
|
|
56
48
|
readonly host_device_permission: VersionedProtocolRequest<{
|
|
57
49
|
readonly v1: [Codec<"Notifications" | "Camera" | "Microphone" | "Bluetooth" | "NFC" | "Location" | "Clipboard" | "OpenUrl" | "Biometrics">, Codec<import("scale-ts").ResultPayload<boolean, import("@novasamatech/scale").CodecError<{
|
|
58
50
|
reason: string;
|
|
@@ -93,19 +85,6 @@ export declare const hostApiProtocol: {
|
|
|
93
85
|
reason: string;
|
|
94
86
|
}, "StorageErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "StorageErr::Full">>>];
|
|
95
87
|
}>;
|
|
96
|
-
readonly host_account_get_root: VersionedProtocolRequest<{
|
|
97
|
-
readonly v1: [Codec<undefined>, Codec<import("scale-ts").ResultPayload<{
|
|
98
|
-
publicKey: Uint8Array<ArrayBufferLike>;
|
|
99
|
-
name: string | undefined;
|
|
100
|
-
}, 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<{
|
|
101
|
-
reason: string;
|
|
102
|
-
}, "RequestCredentialsErr::Unknown">>>];
|
|
103
|
-
}>;
|
|
104
|
-
readonly host_request_login: VersionedProtocolRequest<{
|
|
105
|
-
readonly v1: [Codec<string | undefined>, Codec<import("scale-ts").ResultPayload<"success" | "alreadyConnected" | "rejected", import("@novasamatech/scale").CodecError<{
|
|
106
|
-
reason: string;
|
|
107
|
-
}, "LoginErr::Unknown">>>];
|
|
108
|
-
}>;
|
|
109
88
|
readonly host_account_connection_status_subscribe: VersionedProtocolSubscription<{
|
|
110
89
|
readonly v1: [Codec<undefined>, Codec<"disconnected" | "connected">, Codec<undefined>];
|
|
111
90
|
}>;
|
|
@@ -171,23 +150,6 @@ export declare const hostApiProtocol: {
|
|
|
171
150
|
reason: string;
|
|
172
151
|
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
173
152
|
}>;
|
|
174
|
-
readonly host_sign_raw_with_legacy_account: VersionedProtocolRequest<{
|
|
175
|
-
readonly v1: [Codec<{
|
|
176
|
-
signer: string;
|
|
177
|
-
payload: {
|
|
178
|
-
tag: "Bytes";
|
|
179
|
-
value: Uint8Array<ArrayBufferLike>;
|
|
180
|
-
} | {
|
|
181
|
-
tag: "Payload";
|
|
182
|
-
value: string;
|
|
183
|
-
};
|
|
184
|
-
}>, Codec<import("scale-ts").ResultPayload<{
|
|
185
|
-
signature: `0x${string}`;
|
|
186
|
-
signedTransaction: `0x${string}` | undefined;
|
|
187
|
-
}, import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
188
|
-
reason: string;
|
|
189
|
-
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
190
|
-
}>;
|
|
191
153
|
readonly host_sign_payload: VersionedProtocolRequest<{
|
|
192
154
|
readonly v1: [Codec<{
|
|
193
155
|
account: [string, number];
|
|
@@ -215,33 +177,6 @@ export declare const hostApiProtocol: {
|
|
|
215
177
|
reason: string;
|
|
216
178
|
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
217
179
|
}>;
|
|
218
|
-
readonly host_sign_payload_with_legacy_account: VersionedProtocolRequest<{
|
|
219
|
-
readonly v1: [Codec<{
|
|
220
|
-
signer: string;
|
|
221
|
-
payload: {
|
|
222
|
-
blockHash: `0x${string}`;
|
|
223
|
-
blockNumber: `0x${string}`;
|
|
224
|
-
era: `0x${string}`;
|
|
225
|
-
genesisHash: `0x${string}`;
|
|
226
|
-
method: `0x${string}`;
|
|
227
|
-
nonce: `0x${string}`;
|
|
228
|
-
specVersion: `0x${string}`;
|
|
229
|
-
tip: `0x${string}`;
|
|
230
|
-
transactionVersion: `0x${string}`;
|
|
231
|
-
signedExtensions: string[];
|
|
232
|
-
version: number;
|
|
233
|
-
assetId: `0x${string}` | undefined;
|
|
234
|
-
metadataHash: `0x${string}` | undefined;
|
|
235
|
-
mode: number | undefined;
|
|
236
|
-
withSignedTransaction: boolean | undefined;
|
|
237
|
-
};
|
|
238
|
-
}>, Codec<import("scale-ts").ResultPayload<{
|
|
239
|
-
signature: `0x${string}`;
|
|
240
|
-
signedTransaction: `0x${string}` | undefined;
|
|
241
|
-
}, import("@novasamatech/scale").CodecError<undefined, "SigningErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
242
|
-
reason: string;
|
|
243
|
-
}, "SigningErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::PermissionDenied"> | import("@novasamatech/scale").CodecError<undefined, "SigningErr::FailedToDecode">>>];
|
|
244
|
-
}>;
|
|
245
180
|
readonly host_chat_create_room: VersionedProtocolRequest<{
|
|
246
181
|
readonly v1: [Codec<{
|
|
247
182
|
roomId: string;
|
|
@@ -557,88 +492,7 @@ export declare const hostApiProtocol: {
|
|
|
557
492
|
reason: string;
|
|
558
493
|
}, "PreimageSubmitErr::Unknown">>>];
|
|
559
494
|
}>;
|
|
560
|
-
readonly
|
|
561
|
-
readonly v1: [Codec<undefined>, Codec<{
|
|
562
|
-
available: bigint;
|
|
563
|
-
}>, [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
564
|
-
reason: string;
|
|
565
|
-
}, "PaymentBalanceErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentBalanceErr::PermissionDenied">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
566
|
-
reason: string;
|
|
567
|
-
}, "PaymentBalanceErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentBalanceErr::PermissionDenied">>] & {
|
|
568
|
-
enc: import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
569
|
-
reason: string;
|
|
570
|
-
}, "PaymentBalanceErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentBalanceErr::PermissionDenied">>;
|
|
571
|
-
dec: import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
572
|
-
reason: string;
|
|
573
|
-
}, "PaymentBalanceErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentBalanceErr::PermissionDenied">>;
|
|
574
|
-
} & {
|
|
575
|
-
readonly PermissionDenied: import("@novasamatech/scale").ErrCodec<undefined, "PaymentBalanceErr::PermissionDenied">;
|
|
576
|
-
readonly Unknown: import("@novasamatech/scale").ErrCodec<{
|
|
577
|
-
reason: string;
|
|
578
|
-
}, "PaymentBalanceErr::Unknown">;
|
|
579
|
-
}];
|
|
580
|
-
}>;
|
|
581
|
-
readonly host_payment_top_up: VersionedProtocolRequest<{
|
|
582
|
-
readonly v1: [Codec<{
|
|
583
|
-
amount: bigint;
|
|
584
|
-
source: {
|
|
585
|
-
tag: "ProductAccount";
|
|
586
|
-
value: [string, number];
|
|
587
|
-
} | {
|
|
588
|
-
tag: "PrivateKey";
|
|
589
|
-
value: Uint8Array<ArrayBufferLike>;
|
|
590
|
-
};
|
|
591
|
-
}>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
592
|
-
reason: string;
|
|
593
|
-
}, "PaymentTopUpErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentTopUpErr::InsufficientFunds"> | import("@novasamatech/scale").CodecError<undefined, "PaymentTopUpErr::InvalidSource">>>];
|
|
594
|
-
}>;
|
|
595
|
-
readonly host_payment_request: VersionedProtocolRequest<{
|
|
596
|
-
readonly v1: [Codec<{
|
|
597
|
-
amount: bigint;
|
|
598
|
-
destination: Uint8Array<ArrayBufferLike>;
|
|
599
|
-
}>, Codec<import("scale-ts").ResultPayload<{
|
|
600
|
-
id: string;
|
|
601
|
-
}, import("@novasamatech/scale").CodecError<undefined, "PaymentRequestErr::Rejected"> | import("@novasamatech/scale").CodecError<{
|
|
602
|
-
reason: string;
|
|
603
|
-
}, "PaymentRequestErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentRequestErr::InsufficientBalance">>>];
|
|
604
|
-
}>;
|
|
605
|
-
readonly host_payment_status_subscribe: VersionedProtocolSubscription<{
|
|
606
|
-
readonly v1: [Codec<string>, Codec<{
|
|
607
|
-
tag: "Processing";
|
|
608
|
-
value: undefined;
|
|
609
|
-
} | {
|
|
610
|
-
tag: "Completed";
|
|
611
|
-
value: undefined;
|
|
612
|
-
} | {
|
|
613
|
-
tag: "Failed";
|
|
614
|
-
value: string;
|
|
615
|
-
}>, [import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
616
|
-
reason: string;
|
|
617
|
-
}, "PaymentStatusErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentStatusErr::PaymentNotFound">>, import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
618
|
-
reason: string;
|
|
619
|
-
}, "PaymentStatusErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentStatusErr::PaymentNotFound">>] & {
|
|
620
|
-
enc: import("scale-ts").Encoder<import("@novasamatech/scale").CodecError<{
|
|
621
|
-
reason: string;
|
|
622
|
-
}, "PaymentStatusErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentStatusErr::PaymentNotFound">>;
|
|
623
|
-
dec: import("scale-ts").Decoder<import("@novasamatech/scale").CodecError<{
|
|
624
|
-
reason: string;
|
|
625
|
-
}, "PaymentStatusErr::Unknown"> | import("@novasamatech/scale").CodecError<undefined, "PaymentStatusErr::PaymentNotFound">>;
|
|
626
|
-
} & {
|
|
627
|
-
readonly PaymentNotFound: import("@novasamatech/scale").ErrCodec<undefined, "PaymentStatusErr::PaymentNotFound">;
|
|
628
|
-
readonly Unknown: import("@novasamatech/scale").ErrCodec<{
|
|
629
|
-
reason: string;
|
|
630
|
-
}, "PaymentStatusErr::Unknown">;
|
|
631
|
-
}];
|
|
632
|
-
}>;
|
|
633
|
-
readonly host_jsonrpc_message_send: VersionedProtocolRequest<{
|
|
634
|
-
readonly v1: [Codec<[`0x${string}`, string]>, Codec<import("scale-ts").ResultPayload<undefined, import("@novasamatech/scale").CodecError<{
|
|
635
|
-
reason: string;
|
|
636
|
-
}, "GenericError">>>];
|
|
637
|
-
}>;
|
|
638
|
-
readonly host_jsonrpc_message_subscribe: VersionedProtocolSubscription<{
|
|
639
|
-
readonly v1: [Codec<`0x${string}`>, Codec<string>, Codec<undefined>];
|
|
640
|
-
}>;
|
|
641
|
-
readonly remote_chain_head_follow: VersionedProtocolSubscription<{
|
|
495
|
+
readonly remote_chain_head_follow_subscribe: VersionedProtocolSubscription<{
|
|
642
496
|
readonly v1: [Codec<{
|
|
643
497
|
genesisHash: `0x${string}`;
|
|
644
498
|
withRuntime: boolean;
|
|
@@ -870,5 +724,143 @@ export declare const hostApiProtocol: {
|
|
|
870
724
|
reason: string;
|
|
871
725
|
}, "GenericError">>>];
|
|
872
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
|
+
}>;
|
|
873
865
|
};
|
|
874
866
|
export {};
|
package/dist/protocol/impl.js
CHANGED
|
@@ -7,7 +7,6 @@ import { DeriveEntropyV1_request, DeriveEntropyV1_response } from './v1/deriveEn
|
|
|
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_interrupt, 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';
|
|
@@ -36,7 +35,6 @@ const versionedSubscription = (values) => {
|
|
|
36
35
|
};
|
|
37
36
|
};
|
|
38
37
|
export const hostApiProtocol = {
|
|
39
|
-
// Host calls
|
|
40
38
|
host_handshake: versionedRequest({
|
|
41
39
|
v1: [HandshakeV1_request, HandshakeV1_response],
|
|
42
40
|
}),
|
|
@@ -46,23 +44,15 @@ export const hostApiProtocol = {
|
|
|
46
44
|
host_push_notification: versionedRequest({
|
|
47
45
|
v1: [PushNotificationV1_request, PushNotificationV1_response],
|
|
48
46
|
}),
|
|
49
|
-
host_theme_subscribe: versionedSubscription({
|
|
50
|
-
v1: [ThemeSubscribeV1_start, ThemeSubscribeV1_receive, ThemeSubscribeV1_interrupt],
|
|
51
|
-
}),
|
|
52
47
|
host_navigate_to: versionedRequest({
|
|
53
48
|
v1: [NavigateToV1_request, NavigateToV1_response],
|
|
54
49
|
}),
|
|
55
|
-
host_derive_entropy: versionedRequest({
|
|
56
|
-
v1: [DeriveEntropyV1_request, DeriveEntropyV1_response],
|
|
57
|
-
}),
|
|
58
|
-
// Permissions
|
|
59
50
|
host_device_permission: versionedRequest({
|
|
60
51
|
v1: [DevicePermissionV1_request, DevicePermissionV1_response],
|
|
61
52
|
}),
|
|
62
53
|
remote_permission: versionedRequest({
|
|
63
54
|
v1: [RemotePermissionV1_request, RemotePermissionV1_response],
|
|
64
55
|
}),
|
|
65
|
-
// Local storage
|
|
66
56
|
host_local_storage_read: versionedRequest({
|
|
67
57
|
v1: [StorageReadV1_request, StorageReadV1_response],
|
|
68
58
|
}),
|
|
@@ -72,13 +62,6 @@ export const hostApiProtocol = {
|
|
|
72
62
|
host_local_storage_clear: versionedRequest({
|
|
73
63
|
v1: [StorageClearV1_request, StorageClearV1_response],
|
|
74
64
|
}),
|
|
75
|
-
// Account management
|
|
76
|
-
host_account_get_root: versionedRequest({
|
|
77
|
-
v1: [AccountGetRootV1_request, AccountGetRootV1_response],
|
|
78
|
-
}),
|
|
79
|
-
host_request_login: versionedRequest({
|
|
80
|
-
v1: [RequestLoginV1_request, RequestLoginV1_response],
|
|
81
|
-
}),
|
|
82
65
|
host_account_connection_status_subscribe: versionedSubscription({
|
|
83
66
|
v1: [AccountConnectionStatusV1_start, AccountConnectionStatusV1_receive, AccountConnectionStatusV1_interrupt],
|
|
84
67
|
}),
|
|
@@ -94,7 +77,6 @@ export const hostApiProtocol = {
|
|
|
94
77
|
host_get_legacy_accounts: versionedRequest({
|
|
95
78
|
v1: [GetLegacyAccountsV1_request, GetLegacyAccountsV1_response],
|
|
96
79
|
}),
|
|
97
|
-
// Signing
|
|
98
80
|
host_create_transaction: versionedRequest({
|
|
99
81
|
v1: [CreateTransactionV1_request, CreateTransactionV1_response],
|
|
100
82
|
}),
|
|
@@ -104,16 +86,9 @@ export const hostApiProtocol = {
|
|
|
104
86
|
host_sign_raw: versionedRequest({
|
|
105
87
|
v1: [SignRawV1_request, SignRawV1_response],
|
|
106
88
|
}),
|
|
107
|
-
host_sign_raw_with_legacy_account: versionedRequest({
|
|
108
|
-
v1: [SignRawWithLegacyAccountV1_request, SignRawWithLegacyAccountV1_response],
|
|
109
|
-
}),
|
|
110
89
|
host_sign_payload: versionedRequest({
|
|
111
90
|
v1: [SignPayloadV1_request, SignPayloadV1_response],
|
|
112
91
|
}),
|
|
113
|
-
host_sign_payload_with_legacy_account: versionedRequest({
|
|
114
|
-
v1: [SignPayloadWithLegacyAccountV1_request, SignPayloadWithLegacyAccountV1_response],
|
|
115
|
-
}),
|
|
116
|
-
// Chat
|
|
117
92
|
host_chat_create_room: versionedRequest({
|
|
118
93
|
v1: [ChatCreateRoomV1_request, ChatCreateRoomV1_response],
|
|
119
94
|
}),
|
|
@@ -136,7 +111,6 @@ export const hostApiProtocol = {
|
|
|
136
111
|
ChatCustomMessageRenderingV1_interrupt,
|
|
137
112
|
],
|
|
138
113
|
}),
|
|
139
|
-
// Statement store (remote namespace)
|
|
140
114
|
remote_statement_store_subscribe: versionedSubscription({
|
|
141
115
|
v1: [StatementStoreSubscribeV1_start, StatementStoreSubscribeV1_receive, StatementStoreSubscribeV1_interrupt],
|
|
142
116
|
}),
|
|
@@ -146,35 +120,13 @@ export const hostApiProtocol = {
|
|
|
146
120
|
remote_statement_store_submit: versionedRequest({
|
|
147
121
|
v1: [StatementStoreSubmitV1_request, StatementStoreSubmitV1_response],
|
|
148
122
|
}),
|
|
149
|
-
// Preimage lookup
|
|
150
123
|
remote_preimage_lookup_subscribe: versionedSubscription({
|
|
151
124
|
v1: [PreimageLookupSubscribeV1_start, PreimageLookupSubscribeV1_receive, PreimageLookupSubscribeV1_interrupt],
|
|
152
125
|
}),
|
|
153
126
|
remote_preimage_submit: versionedRequest({
|
|
154
127
|
v1: [PreimageSubmitV1_request, PreimageSubmitV1_response],
|
|
155
128
|
}),
|
|
156
|
-
|
|
157
|
-
host_payment_balance_subscribe: versionedSubscription({
|
|
158
|
-
v1: [PaymentBalanceSubscribeV1_start, PaymentBalanceSubscribeV1_receive, PaymentBalanceSubscribeV1_interrupt],
|
|
159
|
-
}),
|
|
160
|
-
host_payment_top_up: versionedRequest({
|
|
161
|
-
v1: [PaymentTopUpV1_request, PaymentTopUpV1_response],
|
|
162
|
-
}),
|
|
163
|
-
host_payment_request: versionedRequest({
|
|
164
|
-
v1: [PaymentRequestV1_request, PaymentRequestV1_response],
|
|
165
|
-
}),
|
|
166
|
-
host_payment_status_subscribe: versionedSubscription({
|
|
167
|
-
v1: [PaymentStatusSubscribeV1_start, PaymentStatusSubscribeV1_receive, PaymentStatusSubscribeV1_interrupt],
|
|
168
|
-
}),
|
|
169
|
-
// json rpc (deprecated: use remote_chain_* methods instead)
|
|
170
|
-
host_jsonrpc_message_send: versionedRequest({
|
|
171
|
-
v1: [JsonRpcMessageSendV1_request, JsonRpcMessageSendV1_response],
|
|
172
|
-
}),
|
|
173
|
-
host_jsonrpc_message_subscribe: versionedSubscription({
|
|
174
|
-
v1: [JsonRpcMessageSubscribeV1_start, JsonRpcMessageSubscribeV1_receive, JsonRpcMessageSubscribeV1_interrupt],
|
|
175
|
-
}),
|
|
176
|
-
// chain interaction (remote namespace)
|
|
177
|
-
remote_chain_head_follow: versionedSubscription({
|
|
129
|
+
remote_chain_head_follow_subscribe: versionedSubscription({
|
|
178
130
|
v1: [ChainHeadFollowV1_start, ChainHeadFollowV1_receive, ChainHeadFollowV1_interrupt],
|
|
179
131
|
}),
|
|
180
132
|
remote_chain_head_header: versionedRequest({
|
|
@@ -213,4 +165,34 @@ export const hostApiProtocol = {
|
|
|
213
165
|
remote_chain_transaction_stop: versionedRequest({
|
|
214
166
|
v1: [TransactionStopV1_request, TransactionStopV1_response],
|
|
215
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
|
+
}),
|
|
216
198
|
};
|