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

Add webhook creation support #35

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

jair-rosa-cb
Copy link

@jair-rosa-cb jair-rosa-cb commented Dec 18, 2024

What changed? Why?

  • Added webhooks creation support
Screenshot 2024-12-19 at 17 42 12

Qualified Impact

@jair-rosa-cb jair-rosa-cb marked this pull request as ready for review December 19, 2024 22:03
* @returns Details of the created webhook
*/
export async function createWebhook(
wallet: Wallet,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wallet is an unused parameter. It can be removed and still conform to CdpAction - ref

Comment on lines 13 to 14
- Sender address for erc20_transfer and erc721_transfer events (listen on transfers originating from this address))
- Recipient address for erc20_transfer and erc721_transfer events (listen on transfers being made to this address))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Sender address for erc20_transfer and erc721_transfer events (listen on transfers originating from this address))
- Recipient address for erc20_transfer and erc721_transfer events (listen on transfers being made to this address))
- Sender address for erc20_transfer and erc721_transfer events (listen on transfers originating from this address)
- Recipient address for erc20_transfer and erc721_transfer events (listen on transfers being made to this address)

),
);

const EventTypeFilter = z.object({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add JSDoc string

case "wallet_activity":
webhookOptions.eventTypeFilter = {
addresses: eventTypeFilter.addresses || [],
wallet_id: "", // this is required by SDK, but can be an empty value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this required by the SDK if it is unused?

Can we delete line 84 entirely or must it be specified as ""

Copy link
Author

@jair-rosa-cb jair-rosa-cb Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SDK requires this param although it's not required to have a valid value, something we'll look into, but we need this param for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants