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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 0.8.10 (2026-06-16)

### 🩹 Fixes

- **host-chat:** update account service params

### ❤️ Thank You

- Sergey Zhuravlev @johnthecat

## 0.8.9 (2026-06-15)

### 🩹 Fixes
Expand Down
70 changes: 35 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/handoff-service/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@novasamatech/handoff-service",
"type": "module",
"version": "0.8.9",
"version": "0.8.10",
"description": "HOP (Handoff Pool) file transfer service for P2P chat",
"license": "Apache-2.0",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/host-api-wrapper/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@novasamatech/host-api-wrapper",
"type": "module",
"version": "0.8.9",
"version": "0.8.10",
"description": "Host API wrapper: integrate and run your product inside Polkadot browser.",
"license": "Apache-2.0",
"repository": {
Expand All @@ -28,7 +28,7 @@
"@polkadot/extension-inject": "^0.63.1",
"@polkadot-api/json-rpc-provider-proxy": "^0.4.0",
"@polkadot-api/substrate-bindings": "^0.20.3",
"@novasamatech/host-api": "0.8.9",
"@novasamatech/host-api": "0.8.10",
"polkadot-api": ">=2",
"neverthrow": "^8.2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/host-api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@novasamatech/host-api",
"type": "module",
"version": "0.8.9",
"version": "0.8.10",
"description": "Host API: transport implementation for host - product integration.",
"license": "Apache-2.0",
"repository": {
Expand All @@ -22,7 +22,7 @@
"README.md"
],
"dependencies": {
"@novasamatech/scale": "0.8.9",
"@novasamatech/scale": "0.8.10",
"nanoevents": "9.1.0",
"nanoid": "5.1.11",
"neverthrow": "^8.2.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/host-chat/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@novasamatech/host-chat",
"type": "module",
"version": "0.8.9",
"version": "0.8.10",
"description": "Host statement store chat integration",
"license": "Apache-2.0",
"repository": {
Expand Down Expand Up @@ -40,9 +40,9 @@
"README.md"
],
"dependencies": {
"@novasamatech/scale": "0.8.9",
"@novasamatech/statement-store": "0.8.9",
"@novasamatech/storage-adapter": "0.8.9",
"@novasamatech/scale": "0.8.10",
"@novasamatech/statement-store": "0.8.10",
"@novasamatech/storage-adapter": "0.8.10",
"nanoid": "5.1.11",
"neverthrow": "^8.2.0"
},
Expand Down
47 changes: 9 additions & 38 deletions packages/host-chat/src/accountService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import type { People_lite } from '../.papi/descriptors/dist/index.js';

import { toError } from './helpers.js';

interface NetworkConfig {
id: Network;
name: string;
wsUrl: string;
apiUrl: string;
interface Config {
identityEndpoint: string;
client: LazyClient;
}

type AccountStatus = 'ASSIGNED' | 'PENDING';
Expand All @@ -23,8 +21,6 @@ type AccountService = {
getConsumerInfo(address: string): ResultAsync<Identity | null, Error>;
};

type Network = 'paseo-next' | 'paseo-next-v2' | 'preview' | 'stable';

type SearchResponse = {
candidateAccountId: string;
username: string;
Expand Down Expand Up @@ -56,8 +52,10 @@ export type Identity = {
credibility: Credibility;
};

export const createAccountService = (network: Network, lazyClient: LazyClient): AccountService => {
const networkConfig = NETWORK_CONFIGS[network];
export const createAccountService = (config: Config): AccountService => {
const identityEndpoint = config.identityEndpoint.endsWith('/')
? config.identityEndpoint
: `${config.identityEndpoint}/`;

return {
search(query, status) {
Expand All @@ -68,7 +66,7 @@ export const createAccountService = (network: Network, lazyClient: LazyClient):
});

const request = fromPromise(
fetch(`${networkConfig.apiUrl}/usernames?${params}`, {
fetch(`${identityEndpoint}usernames?${params}`, {
method: 'GET',
headers: { Accept: 'application/json' },
}),
Expand All @@ -88,7 +86,7 @@ export const createAccountService = (network: Network, lazyClient: LazyClient):
getConsumerInfo(address) {
const textDecoder = new TextDecoder();
const accountId = AccountId();
const client = lazyClient.getClient();
const client = config.client.getClient();
const api = client.getUnsafeApi<People_lite>();

const consumerInfo = fromPromise(api.query.Resources?.Consumers?.getValue(address), toError);
Expand Down Expand Up @@ -126,30 +124,3 @@ export const createAccountService = (network: Network, lazyClient: LazyClient):
},
};
};

const NETWORK_CONFIGS: Record<Network, NetworkConfig> = {
stable: {
id: 'stable',
name: 'PoP Stable',
wsUrl: 'wss://pop3-testnet.parity-lab.parity.io/people',
apiUrl: 'https://polkadot-app.api.polkadotcommunity.foundation/api/v1',
},
preview: {
id: 'preview',
name: 'PoP Preview',
wsUrl: 'wss://previewnet.substrate.dev/people',
apiUrl: 'https://polkadot-app-stg.parity.io/api/v1',
},
'paseo-next': {
id: 'paseo-next',
name: 'Paseo Next',
wsUrl: 'wss://paseo-people-next-rpc.polkadot.io',
apiUrl: 'https://identity-backend.parity-testnet.parity.io/api/v1',
},
'paseo-next-v2': {
id: 'paseo-next-v2',
name: 'Paseo Next V2',
wsUrl: 'wss://paseo-people-next-system-rpc.polkadot.io',
apiUrl: 'https://identity-backend-next.parity-testnet.parity.io/api/v1',
},
};
4 changes: 2 additions & 2 deletions packages/host-container/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@novasamatech/host-container",
"type": "module",
"version": "0.8.9",
"version": "0.8.10",
"description": "Host container for hosting and managing products within the Polkadot ecosystem.",
"license": "Apache-2.0",
"repository": {
Expand All @@ -28,7 +28,7 @@
"@noble/hashes": "2.2.0",
"polkadot-api": ">=2",
"@polkadot-api/substrate-client": "^0.7.0",
"@novasamatech/host-api": "0.8.9",
"@novasamatech/host-api": "0.8.10",
"nanoevents": "9.1.0",
"nanoid": "5.1.11",
"neverthrow": "^8.2.0"
Expand Down
Loading