Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into matthew/boost-4267-im…
Browse files Browse the repository at this point in the history
…plement-getexternalurl-pods
  • Loading branch information
mmackz committed Jul 15, 2024
2 parents f318e67 + 6a029c8 commit 0278d6f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/kind-doors-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rabbitholegg/questdk-plugin-registry": minor
"@rabbitholegg/questdk-plugin-utils": minor
---

add `getExternalUrl` function to IActionPlugin
8 changes: 8 additions & 0 deletions packages/registry/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ export const getFees = (
}
}

export const getExternalUrl = (plugin: IActionPlugin, params: ActionParams) => {
if (typeof plugin.getExternalUrl === 'function') {
return plugin.getExternalUrl(params)
} else {
throw new PluginActionNotImplementedError()
}
}

export const canValidate = (plugin: IActionPlugin, actionType: ActionType) => {
switch (actionType) {
case ActionType.Follow:
Expand Down
1 change: 1 addition & 0 deletions packages/utils/src/types/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ export interface IActionPlugin {
getFees?: (
params: ActionParams,
) => Promise<{ actionFee: bigint; projectFee: bigint }>
getExternalUrl?: (params: ActionParams) => Promise<string>
validate?: (
validationPayload: PluginActionValidation,
) =>
Expand Down

0 comments on commit 0278d6f

Please sign in to comment.