Skip to content

Commit

Permalink
Feat(actions): add options type
Browse files Browse the repository at this point in the history
  • Loading branch information
Quazia committed Jan 4, 2024
1 parent 22fdea1 commit 95adc1d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type {
MintActionParams,
BurnActionParams,
QuestActionParams,
OptionsActionParams,
DelegateActionParams,
ActionParams,
IActionPlugin,
Expand Down
23 changes: 21 additions & 2 deletions src/actions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ export type SwapActionParams = {
deadline?: bigint | FilterOperator
}



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

export type StakeActionParams = {
chainId: number
contractAddress?: Address
Expand Down Expand Up @@ -66,9 +77,8 @@ export type ActionParams =
| BridgeActionParams
| MintActionParams
| DelegateActionParams
| MintActionParams
| QuestActionParams

| OptionsActionParams
export interface IActionPlugin {
pluginId: string
getSupportedChainIds: (task?: ActionType) => Promise<number[]>
Expand Down Expand Up @@ -97,6 +107,9 @@ export interface IActionPlugin {
quest?: (
params: QuestActionParams,
) => Promise<TransactionFilter> | Promise<PluginActionNotImplementedError>
options?: (
params: OptionsActionParams,
) => Promise<TransactionFilter> | Promise<PluginActionNotImplementedError>
}

export enum ActionType {
Expand All @@ -110,4 +123,10 @@ export enum ActionType {
Delegate = 'delegate',
Lend = 'lend',
Other = 'other',
Options = 'options',
}

export enum OrderType {
Limit = 'limit',
Market = 'market',
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type {
StakeActionParams,
BridgeActionParams,
MintActionParams,
OptionsActionParams,
DelegateActionParams,
ActionParams,
IActionPlugin,
Expand Down

0 comments on commit 95adc1d

Please sign in to comment.