Skip to content

Commit dcbca80

Browse files
authored
Rename product-sdk to host-api-wrapper (#169)
1 parent 8c97f2c commit dcbca80

41 files changed

Lines changed: 96 additions & 56 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This is an Nx monorepo for the host-product integration SDKs — a set of TypeSc
1212
### Glossary
1313

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

1818
## Common Commands
@@ -45,7 +45,7 @@ Run `npm run build` before `typecheck` since typecheck depends on built artifact
4545
### Tests
4646

4747
- **Per-package unit tests** live next to source under `packages/*/src/**/*.spec.ts`.
48-
- **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__/`.
48+
- **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__/`.
4949

5050
## Tech Stack
5151

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
## Packages
1313

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

1818
### For Host developers

__tests__/hostApi/accounts.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import {
99
createTransport,
1010
toHex,
1111
} from '@novasamatech/host-api';
12+
import type { AccountConnectionStatus, ProductAccount } from '@novasamatech/host-api-wrapper';
13+
import { createAccountsProvider } from '@novasamatech/host-api-wrapper';
1214
import type { ContainerHandlerOf } from '@novasamatech/host-container';
1315
import { createContainer } from '@novasamatech/host-container';
14-
import type { AccountConnectionStatus, ProductAccount } from '@novasamatech/product-sdk';
15-
import { createAccountsProvider } from '@novasamatech/product-sdk';
1616

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

__tests__/hostApi/chainInteraction.e2e.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable @typescript-eslint/no-non-null-assertion */
22

33
import { createTransport } from '@novasamatech/host-api';
4+
import { WellKnownChain, createPapiProvider } from '@novasamatech/host-api-wrapper';
45
import { createContainer } from '@novasamatech/host-container';
5-
import { WellKnownChain, createPapiProvider } from '@novasamatech/product-sdk';
66

77
import type { JsonRpcMessage, JsonRpcProvider, JsonRpcRequest, JsonRpcResponse } from '@polkadot-api/json-rpc-provider';
88
import { isRequest, isResponse } from '@polkadot-api/json-rpc-provider';

__tests__/hostApi/chainInteraction.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import type { HexString } from '@novasamatech/host-api';
44
import { createHostApi, createTransport, enumValue } from '@novasamatech/host-api';
5+
import { WellKnownChain, createPapiProvider } from '@novasamatech/host-api-wrapper';
56
import { createContainer } from '@novasamatech/host-container';
6-
import { WellKnownChain, createPapiProvider } from '@novasamatech/product-sdk';
77

88
import type { JsonRpcMessage } from '@polkadot-api/json-rpc-provider';
99
import type { JsonRpcProvider } from 'polkadot-api';

__tests__/hostApi/chat.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import {
77
createTransport,
88
enumValue,
99
} from '@novasamatech/host-api';
10+
import type { ChatMessageContent } from '@novasamatech/host-api-wrapper';
11+
import { createProductChatManager } from '@novasamatech/host-api-wrapper';
1012
import type { ContainerHandlerOf } from '@novasamatech/host-container';
1113
import { createContainer } from '@novasamatech/host-container';
12-
import type { ChatMessageContent } from '@novasamatech/product-sdk';
13-
import { createProductChatManager } from '@novasamatech/product-sdk';
1414

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

__tests__/hostApi/chatReactRenderer.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ globalThis['IS_REACT_ACT_ENVIRONMENT'] = true;
55

66
import type { CodecType } from '@novasamatech/host-api';
77
import { CustomRendererNode, Modifier, createTransport, enumValue } from '@novasamatech/host-api';
8+
import { createProductChatManager } from '@novasamatech/host-api-wrapper';
89
import { createContainer } from '@novasamatech/host-container';
910
import {
1011
Box,
@@ -16,7 +17,6 @@ import {
1617
TextField,
1718
registerChatMessageRenderer,
1819
} from '@novasamatech/product-react-renderer';
19-
import { createProductChatManager } from '@novasamatech/product-sdk';
2020

2121
import { nanoid } from 'nanoid';
2222
import { act, useState } from 'react';

__tests__/hostApi/containerDefaultHandlers.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { LoginErr, RequestCredentialsErr, StorageErr, createTransport } from '@novasamatech/host-api';
2+
import { createAccountsProvider, createLocalStorage } from '@novasamatech/host-api-wrapper';
23
import { createContainer } from '@novasamatech/host-container';
3-
import { createAccountsProvider, createLocalStorage } from '@novasamatech/product-sdk';
44

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

__tests__/hostApi/injectedWeb3Provider.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import {
66
createTransport,
77
toHex,
88
} from '@novasamatech/host-api';
9+
import { createLegacyExtensionEnableFactory } from '@novasamatech/host-api-wrapper';
910
import type { ContainerHandlerOf } from '@novasamatech/host-container';
1011
import { createContainer } from '@novasamatech/host-container';
11-
import { createLegacyExtensionEnableFactory } from '@novasamatech/product-sdk';
1212

1313
import type { SignerResult } from '@polkadot/types/types';
1414
import { AccountId } from '@polkadot-api/substrate-bindings';

__tests__/hostApi/localStorage.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { StorageErr, createTransport } from '@novasamatech/host-api';
2+
import { createLocalStorage } from '@novasamatech/host-api-wrapper';
23
import type { ContainerHandlerOf } from '@novasamatech/host-container';
34
import { createContainer } from '@novasamatech/host-container';
4-
import { createLocalStorage } from '@novasamatech/product-sdk';
55

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

0 commit comments

Comments
 (0)