Skip to content

Commit

Permalink
feat: add support for Enjin and Canary
Browse files Browse the repository at this point in the history
  • Loading branch information
Bradez committed Aug 9, 2024
1 parent 28ed90d commit 1d10052
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 0 deletions.
62 changes: 62 additions & 0 deletions src/chains-config/canaryControllers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { ControllerConfig } from '../types/chains-config';
import { initLRUCache, QueryFeeDetailsCache } from './cache';

/**
* Canary configuration for Sidecar.
*/
export const canaryControllers: ControllerConfig = {
controllers: [
'AccountsBalanceInfo',
'AccountsConvert',
'AccountsProxyInfo',
'AccountsStakingInfo',
'AccountsStakingPayouts',
'AccountsValidate',
'AccountsVestingInfo',
'Blocks',
'BlocksExtrinsics',
'BlocksTrace',
'BlocksRawExtrinsics',
'NodeNetwork',
'NodeTransactionPool',
'NodeVersion',
'PalletsDispatchables',
'PalletsConsts',
'PalletsErrors',
'PalletsEvents',
'PalletsNominationPools',
'PalletsStakingProgress',
'PalletsStakingValidators',
'PalletsStorage',
'Paras',
'RuntimeCode',
'RuntimeMetadata',
'RuntimeSpec',
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionSubmit',
],
options: {
finalizes: true,
minCalcFeeRuntime: 100,
blockStore: initLRUCache(),
hasQueryFeeApi: new QueryFeeDetailsCache(null, null),
},
};
62 changes: 62 additions & 0 deletions src/chains-config/enjinControllers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Copyright 2017-2022 Parity Technologies (UK) Ltd.
// This file is part of Substrate API Sidecar.
//
// Substrate API Sidecar is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { ControllerConfig } from '../types/chains-config';
import { initLRUCache, QueryFeeDetailsCache } from './cache';

/**
* Enjin configuration for Sidecar.
*/
export const enjinControllers: ControllerConfig = {
controllers: [
'AccountsBalanceInfo',
'AccountsConvert',
'AccountsProxyInfo',
'AccountsStakingInfo',
'AccountsStakingPayouts',
'AccountsValidate',
'AccountsVestingInfo',
'Blocks',
'BlocksExtrinsics',
'BlocksTrace',
'BlocksRawExtrinsics',
'NodeNetwork',
'NodeTransactionPool',
'NodeVersion',
'PalletsDispatchables',
'PalletsConsts',
'PalletsErrors',
'PalletsEvents',
'PalletsNominationPools',
'PalletsStakingProgress',
'PalletsStakingValidators',
'PalletsStorage',
'Paras',
'RuntimeCode',
'RuntimeMetadata',
'RuntimeSpec',
'TransactionDryRun',
'TransactionFeeEstimate',
'TransactionMaterial',
'TransactionSubmit',
],
options: {
finalizes: true,
minCalcFeeRuntime: 100,
blockStore: initLRUCache(),
hasQueryFeeApi: new QueryFeeDetailsCache(null, null),
},
};
4 changes: 4 additions & 0 deletions src/chains-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ import { astarControllers } from './astarControllers';
import { bifrostControllers } from './bifrostControllers';
import { bifrostPolkadotControllers } from './bifrostPolkadotControllers';
import { calamariControllers } from './calamariControllers';
import { canaryControllers } from './canaryControllers';
import { crustControllers } from './crustControllers';
import { defaultControllers } from './defaultControllers';
import { dockMainnetControllers } from './dockMainnetControllers';
import { dockPoSMainnetControllers } from './dockPoSMainnetControllers';
import { dockTestnetControllers } from './dockPoSTestnetControllers';
import { enjinControllers } from './enjinControllers';
import { heikoControllers } from './heikoControllers';
import { karuraControllers } from './karuraControllers';
import { kiltControllers } from './kiltControllers';
Expand Down Expand Up @@ -77,6 +79,8 @@ const specToControllerMap: { [x: string]: ControllerConfig } = {
bifrost_polkadot: bifrostPolkadotControllers,
heiko: heikoControllers,
parallel: parallelControllers,
enjin: enjinControllers,
canary: canaryControllers,
};

/**
Expand Down

0 comments on commit 1d10052

Please sign in to comment.