MCPcopy
hub / github.com/subquery/subql / prepareUserInput

Function prepareUserInput

packages/cli/src/controller/generate-controller.ts:104–131  ·  view source on GitHub ↗
(
  selectedEvents: Record<string, EventFragment>,
  selectedFunctions: Record<string, FunctionFragment>,
  existingDs: T,
  address: string | undefined,
  startBlock: number,
  abiFileName: string,
  extractor: ManifestExtractor<T>
)

Source from the content-addressed store, hash-verified

102}
103
104export function prepareUserInput<T>(
105 selectedEvents: Record<string, EventFragment>,
106 selectedFunctions: Record<string, FunctionFragment>,
107 existingDs: T,
108 address: string | undefined,
109 startBlock: number,
110 abiFileName: string,
111 extractor: ManifestExtractor<T>
112): UserInput {
113 const [cleanEvents, cleanFunctions] = filterExistingMethods(
114 selectedEvents,
115 selectedFunctions,
116 existingDs,
117 address,
118 extractor
119 );
120
121 const constructedEvents = constructMethod<EventFragment>(cleanEvents);
122 const constructedFunctions = constructMethod<FunctionFragment>(cleanFunctions);
123
124 return {
125 startBlock: startBlock,
126 functions: constructedFunctions,
127 events: constructedEvents,
128 abiPath: `./abis/${abiFileName}`,
129 address: address,
130 };
131}
132
133export function constructMethod<T extends ConstructorFragment | Fragment>(
134 cleanedFragment: Record<string, T>

Callers 1

generateAdapterFunction · 0.90

Calls 2

filterExistingMethodsFunction · 0.85
constructMethodFunction · 0.85

Tested by

no test coverage detected