Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Adds Burn, Mint and Quest Action Types #50

Merged
merged 7 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gold-lizards-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rabbitholegg/questdk": minor
---

Add mint, burn, and quest action types
2 changes: 2 additions & 0 deletions src/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export type {
StakeActionParams,
BridgeActionParams,
MintActionParams,
BurnActionParams,
QuestActionParams,
DelegateActionParams,
ActionParams,
IActionPlugin,
Expand Down
25 changes: 24 additions & 1 deletion src/actions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,22 @@ export type BridgeActionParams = {
}

export type MintActionParams = {
chainId: number
address: string
tokenId: number
quantity: number
amount: number
}

export type BurnActionParams = MintActionParams

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

export type DelegateActionParams = {
Expand All @@ -53,6 +66,8 @@ export type ActionParams =
| BridgeActionParams
| MintActionParams
| DelegateActionParams
| MintActionParams
| QuestActionParams

export interface IActionPlugin {
pluginId: string
Expand All @@ -76,13 +91,21 @@ export interface IActionPlugin {
delegate?: (
params: DelegateActionParams,
) => Promise<TransactionFilter> | Promise<PluginActionNotImplementedError>
burn?: (
params: DelegateActionParams,
) => Promise<TransactionFilter> | Promise<PluginActionNotImplementedError>
quest?: (
params: DelegateActionParams,
) => Promise<TransactionFilter> | Promise<PluginActionNotImplementedError>
}

export enum ActionType {
Bridge = 'bridge',
Stake = 'stake',
Swap = 'swap',
Mint = 'mint',
Burn = 'burn',
Quest = 'quest',
Deposit = 'deposit',
Delegate = 'delegate',
Lend = 'lend',
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export { PluginActionNotImplementedError } from './errors/plugin.js'

export type {
SwapActionParams,
BurnActionParams,
QuestActionParams,
StakeActionParams,
BridgeActionParams,
MintActionParams,
Expand Down