Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This is an Nx monorepo for the host-product integration SDKs — a set of TypeSc
### Glossary

- **host** — the embedding browser application (e.g. a wallet/SSO surface). Owns the page and runs `host-container`, `host-api`, etc.
- **product** — a Polkadot ecosystem app embedded inside the host. Built against `product-sdk`; its worker code runs inside `host-worker-sandbox`.
- **product** — a Polkadot ecosystem app embedded inside the host. Built against `host-api-wrapper`; its worker code runs inside `host-worker-sandbox`.
- **papp** — short for "Polkadot Mobile". `host-papp` is the host-side integration layer that pairs with it via deeplink handshake and routes signing requests.

## Common Commands
Expand Down Expand Up @@ -45,7 +45,7 @@ Run `npm run build` before `typecheck` since typecheck depends on built artifact
### Tests

- **Per-package unit tests** live next to source under `packages/*/src/**/*.spec.ts`.
- **Integration tests** live in top-level `__tests__/` and exercise full host ↔ product flows across packages (transport, container, product-sdk wired together). Shared test helpers live in `__tests__/hostApi/__mocks__/`.
- **Integration tests** live in top-level `__tests__/` and exercise full host ↔ product flows across packages (transport, container, host-api-wrapper wired together). Shared test helpers live in `__tests__/hostApi/__mocks__/`.

## Tech Stack

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
## Packages

### For Product developers
* [**product-sdk**](./packages/product-sdk/README.md) — SDK for integrating and running a product inside the Polkadot browser host.
* [**host-api-wrapper**](./packages/host-api-wrapper/README.md) — Host API wrapper for integrating and running a product inside the Polkadot browser host.
* [**product-react-renderer**](./packages/product-react-renderer/README.md) — Custom React reconciler for rendering native UI widgets from product scripts.

### For Host developers
Expand Down
4 changes: 2 additions & 2 deletions __tests__/hostApi/accounts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import {
createTransport,
toHex,
} from '@novasamatech/host-api';
import type { AccountConnectionStatus, ProductAccount } from '@novasamatech/host-api-wrapper';
import { createAccountsProvider } from '@novasamatech/host-api-wrapper';
import type { ContainerHandlerOf } from '@novasamatech/host-container';
import { createContainer } from '@novasamatech/host-container';
import type { AccountConnectionStatus, ProductAccount } from '@novasamatech/product-sdk';
import { createAccountsProvider } from '@novasamatech/product-sdk';

import { describe, expect, it, vi } from 'vitest';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/hostApi/chainInteraction.e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */

import { createTransport } from '@novasamatech/host-api';
import { WellKnownChain, createPapiProvider } from '@novasamatech/host-api-wrapper';
import { createContainer } from '@novasamatech/host-container';
import { WellKnownChain, createPapiProvider } from '@novasamatech/product-sdk';

import type { JsonRpcMessage, JsonRpcProvider, JsonRpcRequest, JsonRpcResponse } from '@polkadot-api/json-rpc-provider';
import { isRequest, isResponse } from '@polkadot-api/json-rpc-provider';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hostApi/chainInteraction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import type { HexString } from '@novasamatech/host-api';
import { createHostApi, createTransport, enumValue } from '@novasamatech/host-api';
import { WellKnownChain, createPapiProvider } from '@novasamatech/host-api-wrapper';
import { createContainer } from '@novasamatech/host-container';
import { WellKnownChain, createPapiProvider } from '@novasamatech/product-sdk';

import type { JsonRpcMessage } from '@polkadot-api/json-rpc-provider';
import type { JsonRpcProvider } from 'polkadot-api';
Expand Down
4 changes: 2 additions & 2 deletions __tests__/hostApi/chat.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import {
createTransport,
enumValue,
} from '@novasamatech/host-api';
import type { ChatMessageContent } from '@novasamatech/host-api-wrapper';
import { createProductChatManager } from '@novasamatech/host-api-wrapper';
import type { ContainerHandlerOf } from '@novasamatech/host-container';
import { createContainer } from '@novasamatech/host-container';
import type { ChatMessageContent } from '@novasamatech/product-sdk';
import { createProductChatManager } from '@novasamatech/product-sdk';

import { describe, expect, it, vi } from 'vitest';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/hostApi/chatReactRenderer.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ globalThis['IS_REACT_ACT_ENVIRONMENT'] = true;

import type { CodecType } from '@novasamatech/host-api';
import { CustomRendererNode, Modifier, createTransport, enumValue } from '@novasamatech/host-api';
import { createProductChatManager } from '@novasamatech/host-api-wrapper';
import { createContainer } from '@novasamatech/host-container';
import {
Box,
Expand All @@ -16,7 +17,6 @@ import {
TextField,
registerChatMessageRenderer,
} from '@novasamatech/product-react-renderer';
import { createProductChatManager } from '@novasamatech/product-sdk';

import { nanoid } from 'nanoid';
import { act, useState } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hostApi/containerDefaultHandlers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LoginErr, RequestCredentialsErr, StorageErr, createTransport } from '@novasamatech/host-api';
import { createAccountsProvider, createLocalStorage } from '@novasamatech/host-api-wrapper';
import { createContainer } from '@novasamatech/host-container';
import { createAccountsProvider, createLocalStorage } from '@novasamatech/product-sdk';

import { describe, expect, it, vi } from 'vitest';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/hostApi/injectedWeb3Provider.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
createTransport,
toHex,
} from '@novasamatech/host-api';
import { createLegacyExtensionEnableFactory } from '@novasamatech/host-api-wrapper';
import type { ContainerHandlerOf } from '@novasamatech/host-container';
import { createContainer } from '@novasamatech/host-container';
import { createLegacyExtensionEnableFactory } from '@novasamatech/product-sdk';

import type { SignerResult } from '@polkadot/types/types';
import { AccountId } from '@polkadot-api/substrate-bindings';
Expand Down
2 changes: 1 addition & 1 deletion __tests__/hostApi/localStorage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StorageErr, createTransport } from '@novasamatech/host-api';
import { createLocalStorage } from '@novasamatech/host-api-wrapper';
import type { ContainerHandlerOf } from '@novasamatech/host-container';
import { createContainer } from '@novasamatech/host-container';
import { createLocalStorage } from '@novasamatech/product-sdk';

import { describe, expect, it, vi } from 'vitest';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/hostApi/metaProvider.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ConnectionStatus } from '@novasamatech/host-api';
import { createTransport } from '@novasamatech/host-api';
import { createMetaProvider } from '@novasamatech/host-api-wrapper';
import { createContainer } from '@novasamatech/host-container';
import { createMetaProvider } from '@novasamatech/product-sdk';

import { describe, expect, it, vi } from 'vitest';

Expand Down
4 changes: 2 additions & 2 deletions __tests__/hostApi/payments.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PaymentRequestErr, PaymentTopUpErr, createTransport } from '@novasamatech/host-api';
import type { PaymentBalance, PaymentStatus } from '@novasamatech/host-api-wrapper';
import { createPaymentManager } from '@novasamatech/host-api-wrapper';
import type { ContainerHandlerOf } from '@novasamatech/host-container';
import { createContainer } from '@novasamatech/host-container';
import type { PaymentBalance, PaymentStatus } from '@novasamatech/product-sdk';
import { createPaymentManager } from '@novasamatech/product-sdk';

import { describe, expect, it, vi } from 'vitest';

Expand Down
2 changes: 1 addition & 1 deletion __tests__/hostApi/preimage.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PreimageSubmitErr, createTransport } from '@novasamatech/host-api';
import { createPreimageManager } from '@novasamatech/host-api-wrapper';
import type { ContainerHandlerOf } from '@novasamatech/host-container';
import { createContainer } from '@novasamatech/host-container';
import { createPreimageManager } from '@novasamatech/product-sdk';

import { describe, expect, it, vi } from 'vitest';

Expand Down
8 changes: 4 additions & 4 deletions __tests__/hostApi/statementStore.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { GenericError, StatementProofErr, createTransport, enumValue } from '@novasamatech/host-api';
import type { ContainerHandlerOf } from '@novasamatech/host-container';
import { createContainer } from '@novasamatech/host-container';
import type {
ProductAccountId,
SignedStatement,
Statement,
StatementTopicFilter,
Topic,
} from '@novasamatech/product-sdk';
import { createStatementStore } from '@novasamatech/product-sdk';
} from '@novasamatech/host-api-wrapper';
import { createStatementStore } from '@novasamatech/host-api-wrapper';
import type { ContainerHandlerOf } from '@novasamatech/host-container';
import { createContainer } from '@novasamatech/host-container';

import { describe, expect, it, vi } from 'vitest';

Expand Down
Loading