Skip to content

Trigger Import API

Trigger import endpoints 帮助根据外部描述生成 trigger drafts:EVM ABI、Substrate metadata/pallets 和 source metadata。

POST /api/v2/triggers/import/evm

加载并规范化 EVM ABI entries。

Arguments: 无。

Payload: EVM ABI import input。通常包含 ABI JSON 或 ABI entries。

FieldRequiredDescription
projectProject fullname.
sourceEVM source name/fullname.
contractRequired if abi is missingContract address.
abiRequired if contract is missingABI JSON string.

响应:EvmAbiImportResult

POST /api/v2/triggers/import/evm/abi

尝试按 contract address 加载 ABI。

Arguments: 无。

Payload:

FieldRequiredDescription
sourceEVM source name/fullname.
contractEVM contract address.

响应:EvmAbiResult

POST /api/v2/triggers/import/evm/drafts

根据 ABI 生成 EVM trigger drafts。

Arguments: 无。

Payload: import wizard 中的 EVM import config。

Common fields:

FieldRequiredDescription
projectProject fullname.
sourceEVM source name/fullname.
categoryCategory for generated triggers.
contractContract address.
abiABI JSON string.
abiSourceOverrideprovidedauto
includeEventsWhether to generate event triggers.
includeCallsWhether to generate call/transaction triggers.

响应:TriggerImportDraftsResult

POST /api/v2/triggers/import/substrate/drafts

根据 metadata/pallet selection 生成 Substrate trigger drafts。

Arguments: 无。

Payload: import wizard 中的 Substrate import config。

Common fields:

FieldRequiredDescription
projectProject fullname.
sourceSubstrate source name/fullname.
palletsOne ofSelected pallets/modules.
entriesOne ofSelected entries: { pallet, kind, name }, where kind is event or call.
includeEventsWhether pallet import includes events.
includeCallsWhether pallet import includes calls.
defaultsTemplateDefaults template override object.
metaTemplateMetadata template override object.
labelsTemplateLabels template override object.
executionPolicyExecution policy override for generated drafts.

响应:TriggerImportDraftsResult

GET /api/v2/triggers/substrate/source

返回 import wizard 使用的 Substrate source info。

Arguments:

ArgumentLocationDescription
sourceQuerySubstrate data source fullname/name.

Payload: 无。

响应:SubstrateSourceInfo

GET /api/v2/triggers/substrate/pallets

返回所选 source 的 Substrate pallets 列表。

Arguments:

ArgumentLocationDescription
sourceQuerySubstrate data source fullname/name.

Payload: 无。

响应:SubstratePalletSummary[]

GET /api/v2/triggers/substrate/pallet

返回指定 Substrate pallet 的 metadata。

Arguments:

ArgumentLocationDescription
sourceQuerySubstrate data source fullname/name.
palletQueryPallet/module name.

Payload: 无。

响应:SubstratePalletMetadata