Skip to content

ChainGraph API Documentation / @badaitech/chaingraph-types / serialize

Function: serialize() ​

serialize<T>(secretType, secret): unknown

Defined in: packages/chaingraph-types/src/port/base/secret.ts:339

Serialize a secret of supported type.

Type Parameters ​

T ​

T extends "string" | "openai" | "0g" | "anthropic" | "gemini" | "coinmarketcap" | "deepseek" | "groq" | "moonshot" | "xAPI" | "xApp" | "OkxDexApi" | "alchemy"

Parameters ​

secretType ​

T

type of the secret value.

secret ​

EncryptedSecretValue<T>

the secret value to serialize.

Returns ​

unknown

Throws ​

Error if secret type is not supported.

Licensed under BUSL-1.1