Skip to content

Trigger Import API ​

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

POST /api/triggers/import/evm ​

加载并规范化 EVM ABI entries。

Arguments: 无。

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

FieldRequiredDescription
project是Project fullname.
source是EVM source name/fullname.
contractRequired if abi is missingContract address.
abiRequired if contract is missingABI JSON string.

响应:EvmAbiImportResult。

此 endpoint 只返回 ABI import entries,不会保存 triggers。请另行使用 PUT /api/triggers/:fullname 保存选中的 drafts。

POST /api/triggers/import/evm/abi ​

尝试按 contract address 加载 ABI。

Arguments: 无。

Payload:

FieldRequiredDescription
source是EVM source name/fullname.
contract是EVM contract address.

响应:EvmAbiResult。

POST /api/triggers/import/evm/drafts ​

根据 ABI 生成 EVM trigger drafts。

Arguments: 无。

Payload: import wizard 中的 EVM import config。

Common fields:

FieldRequiredDescription
project是Project fullname.
source是EVM source name/fullname.
category否Category for generated triggers.
contract否Contract address.
abi否ABI JSON string.
abiSourceOverride否provided 或 auto。
includeEvents否Whether to generate event triggers.
includeCalls否Whether to generate call/transaction triggers.

响应:TriggerImportDraftsResult。

POST /api/triggers/import/hypercore/drafts ​

根据所选 runtime source 和 actions 生成 HyperCore trigger drafts。

参数:无。

Payload:

字段必填说明
project是Project fullname。
source是HyperCore runtime source。
actionTypes否要包含的 action 类型。

响应包含 drafts 数组。

POST /api/triggers/import/solana/idl ​

尝试按 Program ID 加载 Solana IDL。

Payload:

FieldRequiredDescription
source是Solana source name/fullname.
programId是Solana program public key.

响应:Solana IDL metadata object,包含 source、programId、IDL/metadata account address 和 idl。

POST /api/triggers/import/solana/drafts ​

根据 IDL 生成 Solana trigger drafts。

Payload:

FieldRequiredDescription
project是Project fullname.
source是Solana source name/fullname.
programId是Solana program public key.
idl是Solana IDL JSON object 或 string.
category否Generated triggers 的 category.
includeEvents否是否包含 program events.
includeCalls否是否包含 instructions/calls.

响应:TriggerImportDraftsResult。

POST /api/triggers/import/substrate/drafts ​

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

Arguments: 无。

Payload: import wizard 中的 Substrate import config。

Common fields:

FieldRequiredDescription
project是Project fullname.
source是Substrate source name/fullname.
palletsOne ofSelected pallets/modules.
entriesOne ofSelected entries: { pallet, kind, name }, where kind is event or call.
includeEvents否Whether pallet import includes events.
includeCalls否Whether pallet import includes calls.
defaultsTemplate否Defaults template override object.
metaTemplate否Metadata template override object.
labelsTemplate否Labels template override object.
executionPolicy否Execution policy override for generated drafts.

响应:TriggerImportDraftsResult。

GET /api/triggers/substrate/source ​

返回 import wizard 使用的 Substrate source info。

Arguments:

ArgumentLocationDescription
sourceQuerySubstrate data source fullname/name.

Payload: 无。

响应:SubstrateSourceInfo。

GET /api/triggers/substrate/pallets ​

返回所选 source 的 Substrate pallets 列表。

Arguments:

ArgumentLocationDescription
sourceQuerySubstrate data source fullname/name.

Payload: 无。

响应:SubstratePalletSummary[]。

GET /api/triggers/substrate/pallet ​

返回指定 Substrate pallet 的 metadata。

Arguments:

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

Payload: 无。

响应:SubstratePalletMetadata。