diff --git a/packages/ui/src/runtime-config.ts b/packages/ui/src/runtime-config.ts index 57c71ec..7f97239 100644 --- a/packages/ui/src/runtime-config.ts +++ b/packages/ui/src/runtime-config.ts @@ -20,13 +20,21 @@ function getPlatformType(userAgent: string = navigator.userAgent): string { return "Unknown"; } +// `assetHub` drives the host's dotNS username resolution. Typed as an +// intersection so this compiles against @parity/truapi-host releases from +// before the field existed; once the dependency floor includes it, fold the +// field into the plain ProductRuntimeConfig literal. +type RuntimeConfigWithAssetHub = ProductRuntimeConfig & { + assetHub?: { genesisHash: string | Uint8Array }; +}; + // The window origin deliberately plays no part here: `productId` comes // solely from the label (or the explicit override). export function createTruapiRuntimeConfig( label: string, productId: string = labelToProductId(label), ): ProductRuntimeConfig { - return { + const config: RuntimeConfigWithAssetHub = { productId, host: { name: "Polkadot Web", @@ -44,8 +52,12 @@ export function createTruapiRuntimeConfig( bulletin: { genesisHash: getActiveServicesConfig().bulletin.genesis, }, + assetHub: { + genesisHash: getActiveServicesConfig().assethub.genesis, + }, pairing: { deeplinkScheme: "polkadotapp", }, }; + return config; } diff --git a/packages/ui/tests/runtime-config.test.ts b/packages/ui/tests/runtime-config.test.ts index 3e207cb..a7110fb 100644 --- a/packages/ui/tests/runtime-config.test.ts +++ b/packages/ui/tests/runtime-config.test.ts @@ -55,6 +55,9 @@ describe("createTruapiRuntimeConfig", () => { bulletin: { genesisHash: getActiveServicesConfig().bulletin.genesis, }, + assetHub: { + genesisHash: getActiveServicesConfig().assethub.genesis, + }, pairing: { deeplinkScheme: "polkadotapp", },