From b5d77c7da6adc1af15b173f7b0dcbbc4cc6ddb8a Mon Sep 17 00:00:00 2001 From: tarikgul Date: Thu, 16 Nov 2023 12:31:59 -0500 Subject: [PATCH] fix: main patch --- src/main.ts | 3 +- src/overrideTypes/typesBundle.ts | 57 ++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/overrideTypes/typesBundle.ts diff --git a/src/main.ts b/src/main.ts index 02ec9e7dc..79484d11d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -26,6 +26,7 @@ import { json } from 'express'; import packageJSON from '../package.json'; import App from './App'; +import tempTypesBundle from './overrideTypes/typesBundle'; import { getControllersForSpec } from './chains-config'; import { consoleOverride } from './logging/consoleOverride'; import { Log } from './logging/Log'; @@ -50,7 +51,7 @@ async function main() { : new WsProvider(config.SUBSTRATE.URL), /* eslint-disable @typescript-eslint/no-var-requires */ typesBundle: TYPES_BUNDLE - ? (require(TYPES_BUNDLE) as OverrideBundleType) + ? (tempTypesBundle as OverrideBundleType) : undefined, typesChain: TYPES_CHAIN ? (require(TYPES_CHAIN) as Record) diff --git a/src/overrideTypes/typesBundle.ts b/src/overrideTypes/typesBundle.ts new file mode 100644 index 000000000..a7f2d0ed6 --- /dev/null +++ b/src/overrideTypes/typesBundle.ts @@ -0,0 +1,57 @@ +import { OverrideBundleDefinition } from "@polkadot/types/types"; + +const definitionsWestmint: OverrideBundleDefinition = { + types: [ + { + minmax: [0, 9434], + types: { + TempAssetId: "Option" + }, + }, + { + minmax: [9435, undefined], + types: { + TempAssetId: "Option" + }, + }, + ], + signedExtensions: { + ChargeAssetTxPayment: { + extrinsic: { + tip: 'Compact', + // eslint-disable-next-line sort-keys + assetId: 'TempAssetId' + }, + payload: {} + } + } +}; + +const definitionsStatemine: OverrideBundleDefinition = { + types: [ + { + minmax: [0, 9999], + types: { + TempAssetId: "Option" + }, + }, + { + minmax: [10000, undefined], + types: { + TempAssetId: "Option" + }, + }, + ], + signedExtensions: { + ChargeAssetTxPayment: { + extrinsic: { + tip: 'Compact', + // eslint-disable-next-line sort-keys + assetId: 'TempAssetId' + }, + payload: {} + } + } + }; + +export default { typesBundle: { spec: { "statemine": definitionsStatemine, "westmint": definitionsWestmint } } };