Types

type SwapActionParams

Description: Defines parameters for swap-related actions.

Properties:

  • chainId: Number, specifies the chain ID.

  • contractAddress: Address (optional), the address of the contract involved in the swap.

  • tokenIn: Address (optional), address of the input token.

  • tokenOut: Address (optional), address of the output token.

  • amountIn: BigInt or FilterOperator (optional), the input amount for the swap.

  • amountOut: BigInt or FilterOperator (optional), the output amount from the swap.

  • recipient: Address (optional), the address receiving the output of the swap.

  • deadline: BigInt or FilterOperator (optional), the deadline by which the swap must occur.

type SwapActionParams = {
  chainId: number
  contractAddress?: Address
  tokenIn?: Address
  tokenOut?: Address
  amountIn?: bigint | FilterOperator
  amountOut?: bigint | FilterOperator
  recipient?: Address
  deadline?: bigint | FilterOperator
}

type OptionsActionParams

Description: Specifies parameters for options-related actions.

Properties:

  • chainId: Number, identifies the chain ID.

  • contractAddress: Address (optional), address of the contract involved.

  • token: Address (optional), token address involved in the option.

  • amount: BigInt or FilterOperator (optional), amount involved in the option.

  • recipient: Address (optional), recipient address.

  • orderType: OrderType (optional), specifies the type of order (e.g., limit, market).

type OptionsActionParams = {
  chainId: number
  contractAddress?: Address
  token?: Address
  amount?: bigint | FilterOperator
  recipient?: Address
  orderType?: OrderType
}

type StakeActionParams

Description: Defines parameters for staking actions.

Properties:

  • chainId: Number, specifies the chain ID.

  • contractAddress: Address (optional), address of the contract involved.

  • tokenOne: Address (optional), first token's address used in staking.

  • amountOne: BigInt or FilterOperator (optional), amount of the first token staked.

  • tokenTwo: Address (optional), second token's address used in staking.

  • amountTwo: BigInt or FilterOperator (optional), amount of the second token staked.

  • duration: BigInt or FilterOperator (optional), the duration of the staking.

type StakeActionParams = {
  chainId: number
  contractAddress?: Address
  tokenOne?: Address
  amountOne?: bigint | FilterOperator
  tokenTwo?: Address
  amountTwo?: bigint | FilterOperator
  duration?: bigint | FilterOperator
}

type BridgeActionParams

Description: Parameters for bridge action between chains.

Properties:

  • sourceChainId: Number, identifies the source chain ID.

  • destinationChainId: Number, identifies the destination chain ID.

  • contractAddress: Address (optional), the contract's address used for bridging.

  • tokenAddress: Address (optional), the token's address being bridged.

  • amount: BigInt or FilterOperator (optional), amount of the token being bridged.

  • recipient: Address (optional), recipient's address on the destination chain.

type BridgeActionParams = {
  sourceChainId: number
  destinationChainId: number
  contractAddress?: Address
  tokenAddress?: Address
  amount?: bigint | FilterOperator
  recipient?: Address
}

type MintActionParams

Description: Parameters for minting actions in transactions.

Properties:

  • chainId: Number, indicates the chain ID where minting occurs.

  • contractAddress: Address, the contract's address for minting operations.

  • tokenId: Number (optional), identifies the specific token to be minted.

  • amount: Number or FilterOperator (optional), quantity of tokens to mint.

  • recipient: Address (optional), address receiving the minted tokens.

type MintActionParams = {
  chainId: number
  contractAddress: Address
  tokenId?: number
  amount?: number | FilterOperator
  recipient?: Address
}

type BurnActionParams

Description: Describes parameters for burn actions, often mirroring mint parameters. Properties:

  • Same as MintActionParams.Used for removing tokens from circulation.

type BurnActionParams = MintActionParam

type QuestActionParams

Description: Specifies parameters for actions related to quests.

Properties:

  • chainId: Number, the chain ID relevant to the quest.

  • rewardToken: Address (optional), token address used as a reward.

  • rewardAmount: BigInt or FilterOperator (optional), amount of the reward token.

  • startTime: BigInt or FilterOperator (optional), quest start time.

  • endTime: BigInt or FilterOperator (optional), quest end time.

  • totalParticipants: BigInt or FilterOperator (optional), number of participants.

  • actionSpec: String (optional), specifies the action criteria for the quest.

type QuestActionParams = {
  chainId: number
  rewardToken?: Address
  rewardAmount?: bigint | FilterOperator
  startTime?: bigint | FilterOperator
  endTime?: bigint | FilterOperator
  totalParticipants?: bigint | FilterOperator
  actionSpec?: string
}

type DelegateActionParams

Description: Details parameters for delegation actions.

Properties:

  • chainId: Number, the chain ID relevant to the delegate action.

  • delegate: Address (optional), address of the delegate.

  • project: Address or String, project address or identifier for delegation.

  • contractAddress: Address (optional), associated contract's address.

  • amount: BigInt or FilterOperator (optional), amount being delegated.

  • delegator: Address (optional), address of the delegator.

type DelegateActionParams = {
  chainId: number
  delegate?: Address
  project: Address | string
  contractAddress?: Address
  amount?: bigint | FilterOperator
  delegator?: Address
}

type VoteActionParams

Description: Details parameters for delegation actions.

Properties:

  • chainId: Number, the chain ID relevant to the voting action.

  • project: Address or String, project address or identifier for the vote.

  • support?: BigInt, Boolean, or FilterOperator (optional), indicates support for the proposal. Can represent a simple yes/no, a specific amount of support, or complex filtering conditions.

  • proposalId?: BigInt or FilterOperator (optional), identifier for the proposal being voted on. Can represent a specific proposal ID or complex filtering conditions related to proposal IDs.

type VoteActionParams = {
  chainId: number
  project: Address | string
  support?: bigint | boolean | FilterOperator
  proposalId?: bigint | FilterOperator
}

type ActionParams

Description: A union type representing different action parameter structures.

Properties:

  • Represents a combination of different action parameter types, such as SwapActionParams, StakeActionParams, BridgeActionParams, MintActionParams, DelegateActionParams, QuestActionParams, and OptionsActionParams.

  • Each variant within this union type caters to specific transaction types and contains properties relevant to that transaction.

type ActionParams =
  | SwapActionParams
  | StakeActionParams
  | BridgeActionParams
  | MintActionParams
  | DelegateActionParams
  | QuestActionParams
  | OptionsActionParams

type IActionPlugin

Description: Interface for action plugins in the system.

Properties:

  • pluginId: String, a unique identifier for the plugin.

  • getSupportedChainIds: Function, returns a list of supported blockchain IDs.

  • getSupportedTokenAddresses: Function, provides supported token addresses for a given chain.

  • Methods: Includes various functions like bridge, swap, mint, each corresponding to different action types and returning either a TransactionFilter or a PluginActionNotImplementedError.

View on Github


enum ActionType

Description: Enum representing different types of available actions.

Properties:

  • Defines specific action types like Bridge, Stake, Swap, Mint, Burn, Quest, Deposit, Delegate, Lend, Other, and Options.

  • Each value in this enum is a string that corresponds to a specific action type.

enum ActionType {
  Bridge = 'bridge',
  Stake = 'stake',
  Swap = 'swap',
  Mint = 'mint',
  Burn = 'burn',
  Quest = 'quest',
  Deposit = 'deposit',
  Delegate = 'delegate',
  Lend = 'lend',
  Other = 'other',
  Options = 'options',
}

type OrderType

Description: Enum for defining order types in options/derivatives transactions.

Properties:

  • Limit: Represents a limit order type.

  • Market: Represents a market order type.

enum OrderType {
  Limit = 'limit',
  Market = 'market',
}

type ArrayOperator

Description: Represents operations that can be performed on arrays within filters.

type ArrayOperator =
  | {
      $some?: FilterOperator[]
    }
  | {
      $first?: FilterOperator
    }
  | {
      $last?: FilterOperator
    }
  | {
      $nth?: NthFilter
    }

type LogicalOperator

Description: Defines logical operations for combining multiple filter criteria.

type LogicalOperator =
  | {
      $and?: FilterOperator[]
    }
  | {
      $or?: FilterOperator[]
    }

type NumericOperator

Description: Specifies numerical operations for filtering.

type NumericOperator =
  | bigint
  | number
  | string
  | {
      $gt?: bigint
    }
  | {
      $gte?: bigint
    }
  | {
      $lt?: bigint
    }
  | {
      $lte?: bigint
    }

type StringOperator

Description: Defines string operations for filtering, using regular expressions.

Properties:

  • $regex?: A regular expression string for matching.

type StringOperator = {
  $regex?: string
}

type FilterOperator

Description: A union type that encompasses various filtering operations, including logical, numeric, array, and string operations.

type FilterOperator =
  | LogicalOperator
  | NumericOperator
  | ArrayOperator
  | StringOperator

type TransactionFilter

Description: Represents a filter applied to transactions, where each property of a transaction can be filtered using a FilterOperator.

type TransactionFilter = {
  [K in keyof Transaction]: FilterOperator
}

type FilterObject

Description: An object representing a complex filter structure, where each key corresponds to a condition defined by the Filter type.

type FilterObject = {
  [key: string]: Filter
}

type BitmaskFilter

Description: Allows filtering based on bitmask operations.

Properties:

  • bitmask: The bitmask value, which can be a bigint, number, or string.

  • value: The value to compare against the bitmask, can be a bigint, number, string, or NumericOperator.

type BitmaskFilter = {
  bitmask: bigint | number | string
  value: bigint | number | string | NumericOperator
}

type NthFilter

Description: Specifies a filter to apply to the nth element of an array.

Properties:

  • index: The index of the element to apply the filter to, can be a bigint, number, or string.

  • value: The filter to apply, can be either a TransactionFilter or a FilterObject.

type NthFilter = {
  index: bigint | number | string
  value: TransactionFilter | FilterObject
}

type Filter

Description: Represents the base type for filters, which can be a primitive value, a FilterObject, a filter array, or an ABI type.

type Filter = Primitive | FilterObject | FilterArray | Abi

Last updated