Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 6a1171d

Browse files
feat: Add ParachainID to SubstrateConfig (#362)
<!--- Provide a general summary of your changes in the Title above --> ## Description `SubstrateConfig` didn't provide Parachain ID of a chain. It is needed because widget is using it to index Api promise objects. ## Related Issue Or Context sprintertech/sygma-widget#134 (comment) ## Types of changes - [x] Added ParachainID to config interface --------- Co-authored-by: Marin Petrunić <[email protected]>
1 parent a105900 commit 6a1171d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

packages/sdk/src/chains/Substrate/types/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,8 @@ export enum PolkadotParachain {
5050
COMPOSABLE = 2019,
5151
}
5252

53-
export type ParachainID = KusamaParachain | PolkadotParachain | number;
53+
export enum RococoParachain {
54+
RHALA = 2004,
55+
}
56+
57+
export type ParachainID = KusamaParachain | PolkadotParachain | RococoParachain | number;

packages/sdk/src/config/localConfig.ts

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ export const localConfig: RawConfig = {
141141
nativeTokenDecimals: BigInt(18),
142142
blockConfirmations: 1,
143143
bridge: '0x',
144+
parachainId: 0, // local setup is not parachain
144145
handlers: [
145146
{
146147
type: ResourceType.FUNGIBLE,

packages/sdk/src/types/config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { ParachainID } from 'chains/Substrate/index.js';
12
import type { FeeHandlerType, Resource, ResourceType } from './types.js';
23

34
export enum Environment {
@@ -44,6 +45,7 @@ export interface EthereumConfig extends BaseConfig<Network.EVM> {
4445

4546
export interface SubstrateConfig extends BaseConfig<Network.SUBSTRATE> {
4647
handlers: Array<Handler>;
48+
parachainId: ParachainID;
4749
}
4850

4951
export interface RawConfig {

0 commit comments

Comments
 (0)