@novasamatech/host-container 0.7.5-4 → 0.7.6
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/createContainer.js +10 -1
- package/dist/types.d.ts +2 -0
- package/package.json +2 -2
package/dist/createContainer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChatBotRegistrationErr, ChatMessagePostingErr, ChatRoomRegistrationErr, CreateProofErr, CreateTransactionErr, DeriveEntropyErr, DevicePermission, GenericError, GetUserIdErr, LoginErr, NavigateToErr, PaymentBalanceErr, PaymentRequestErr, PaymentStatusErr, PaymentTopUpErr, PreimageSubmitErr, RemotePermission, RequestCredentialsErr, SigningErr, StatementProofErr, StorageErr, createTransport, enumValue, isEnumVariant, resultErr, resultOk, } from '@novasamatech/host-api';
|
|
1
|
+
import { ChatBotRegistrationErr, ChatMessagePostingErr, ChatRoomRegistrationErr, CreateProofErr, CreateTransactionErr, DeriveEntropyErr, DevicePermission, GenericError, GetUserIdErr, LoginErr, NavigateToErr, PaymentBalanceErr, PaymentRequestErr, PaymentStatusErr, PaymentTopUpErr, PreimageSubmitErr, RemotePermission, RequestCredentialsErr, ResourceAllocationErr, SigningErr, StatementProofErr, StorageErr, createTransport, enumValue, isEnumVariant, resultErr, resultOk, } from '@novasamatech/host-api';
|
|
2
2
|
import { err, errAsync, ok, okAsync } from 'neverthrow';
|
|
3
3
|
import { createChainConnectionManager } from './chainConnectionManager.js';
|
|
4
4
|
const UNSUPPORTED_MESSAGE_FORMAT_ERROR = 'Unsupported message format';
|
|
@@ -183,10 +183,13 @@ export function createContainer(provider) {
|
|
|
183
183
|
const handleChatPostMessageSlot = makeNotImplementedSlot('host_chat_post_message', () => new ChatMessagePostingErr.Unknown({ reason: NOT_IMPLEMENTED }));
|
|
184
184
|
const handleStatementStoreSubmitSlot = makePermissionGatedRequestSlot('remote_statement_store_submit', 'StatementSubmit', () => new GenericError({ reason: NOT_IMPLEMENTED }));
|
|
185
185
|
const handleStatementStoreCreateProofSlot = makeNotImplementedSlot('remote_statement_store_create_proof', () => new StatementProofErr.Unknown({ reason: NOT_IMPLEMENTED }));
|
|
186
|
+
const handleStatementStoreCreateProofAuthorizedSlot = makeNotImplementedSlot('remote_statement_store_create_proof_authorized', () => new StatementProofErr.Unknown({ reason: NOT_IMPLEMENTED }));
|
|
186
187
|
const handlePreimageSubmitSlot = makePermissionGatedRequestSlot('remote_preimage_submit', 'PreimageSubmit', () => new PreimageSubmitErr.Unknown({ reason: NOT_IMPLEMENTED }));
|
|
187
188
|
// payment request slots
|
|
188
189
|
const handlePaymentTopUpSlot = makeNotImplementedSlot('host_payment_top_up', () => new PaymentTopUpErr.Unknown({ reason: NOT_IMPLEMENTED }));
|
|
189
190
|
const handlePaymentRequestSlot = makeNotImplementedSlot('host_payment_request', () => new PaymentRequestErr.Unknown({ reason: NOT_IMPLEMENTED }));
|
|
191
|
+
// resource allocation slot
|
|
192
|
+
const handleRequestResourceAllocationSlot = makeNotImplementedSlot('host_request_resource_allocation', () => new ResourceAllocationErr.Unknown({ reason: NOT_IMPLEMENTED }));
|
|
190
193
|
// subscription slots — default interrupts on next microtask so that
|
|
191
194
|
// the caller has a chance to register an onInterrupt listener first
|
|
192
195
|
const handleThemeSubscribeSlot = makeInterruptSlot('host_theme_subscribe', () => enumValue('v1', undefined));
|
|
@@ -296,6 +299,9 @@ export function createContainer(provider) {
|
|
|
296
299
|
handleStatementStoreCreateProof(handler) {
|
|
297
300
|
return handleV1Request(handleStatementStoreCreateProofSlot, () => new StatementProofErr.Unknown({ reason: UNSUPPORTED_MESSAGE_FORMAT_ERROR }), handler);
|
|
298
301
|
},
|
|
302
|
+
handleStatementStoreCreateProofAuthorized(handler) {
|
|
303
|
+
return handleV1Request(handleStatementStoreCreateProofAuthorizedSlot, () => new StatementProofErr.Unknown({ reason: UNSUPPORTED_MESSAGE_FORMAT_ERROR }), handler);
|
|
304
|
+
},
|
|
299
305
|
handleStatementStoreSubmit(handler) {
|
|
300
306
|
return handleV1Request(handleStatementStoreSubmitSlot, () => new GenericError({ reason: UNSUPPORTED_MESSAGE_FORMAT_ERROR }), handler);
|
|
301
307
|
},
|
|
@@ -317,6 +323,9 @@ export function createContainer(provider) {
|
|
|
317
323
|
handlePaymentStatusSubscribe(handler) {
|
|
318
324
|
return handleV1Subscription(handlePaymentStatusSubscribeSlot, handler);
|
|
319
325
|
},
|
|
326
|
+
handleRequestResourceAllocation(handler) {
|
|
327
|
+
return handleV1Request(handleRequestResourceAllocationSlot, () => new ResourceAllocationErr.Unknown({ reason: UNSUPPORTED_MESSAGE_FORMAT_ERROR }), handler);
|
|
328
|
+
},
|
|
320
329
|
// chain interaction
|
|
321
330
|
handleChainConnection(factory) {
|
|
322
331
|
init();
|
package/dist/types.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ export type Container = {
|
|
|
88
88
|
}, callback: (node: CodecType<typeof CustomRendererNode>) => void): Subscription;
|
|
89
89
|
handleStatementStoreSubscribe: InferHandler<'v1', HostApiProtocol['remote_statement_store_subscribe']>;
|
|
90
90
|
handleStatementStoreCreateProof: InferHandler<'v1', HostApiProtocol['remote_statement_store_create_proof']>;
|
|
91
|
+
handleStatementStoreCreateProofAuthorized: InferHandler<'v1', HostApiProtocol['remote_statement_store_create_proof_authorized']>;
|
|
91
92
|
handleStatementStoreSubmit: InferHandler<'v1', HostApiProtocol['remote_statement_store_submit']>;
|
|
92
93
|
handlePreimageLookupSubscribe: InferHandler<'v1', HostApiProtocol['remote_preimage_lookup_subscribe']>;
|
|
93
94
|
handlePreimageSubmit: InferHandler<'v1', HostApiProtocol['remote_preimage_submit']>;
|
|
@@ -95,6 +96,7 @@ export type Container = {
|
|
|
95
96
|
handlePaymentTopUp: InferHandler<'v1', HostApiProtocol['host_payment_top_up']>;
|
|
96
97
|
handlePaymentRequest: InferHandler<'v1', HostApiProtocol['host_payment_request']>;
|
|
97
98
|
handlePaymentStatusSubscribe: InferHandler<'v1', HostApiProtocol['host_payment_status_subscribe']>;
|
|
99
|
+
handleRequestResourceAllocation: InferHandler<'v1', HostApiProtocol['host_request_resource_allocation']>;
|
|
98
100
|
handleChainConnection: (factory: (genesisHash: HexString) => JsonRpcProvider | null) => VoidFunction;
|
|
99
101
|
isReady(): Promise<boolean>;
|
|
100
102
|
dispose(): void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novasamatech/host-container",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.6",
|
|
5
5
|
"description": "Host container for hosting and managing products within the Polkadot ecosystem.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@noble/hashes": "2.2.0",
|
|
29
29
|
"polkadot-api": ">=2",
|
|
30
30
|
"@polkadot-api/substrate-client": "^0.7.0",
|
|
31
|
-
"@novasamatech/host-api": "0.7.
|
|
31
|
+
"@novasamatech/host-api": "0.7.6",
|
|
32
32
|
"nanoid": "5.1.9",
|
|
33
33
|
"neverthrow": "^8.2.0"
|
|
34
34
|
},
|