-
Notifications
You must be signed in to change notification settings - Fork 0
introduce wallet activity webhook #1
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
base: v0.6.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR introduces support for wallet activity webhooks in the Coinbase SDK for Node.js, enhancing the webhook functionality with more specific event filtering capabilities.
- Added
eventTypeFilter
field toCreateWebhookOptions
type insrc/coinbase/types.ts
- Implemented
createWebhook
method inWallet
class insrc/coinbase/wallet.ts
- Updated
Webhook
class insrc/coinbase/webhook.ts
to handle neweventTypeFilter
parameter - Modified webhook test suite in
src/tests/webhook_test.ts
to cover new functionality - Changes align with the example provided in the PR description, demonstrating proper implementation
4 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings
addresses: this.addresses.map(address => address.getId()!), | ||
wallet_id: this.getId()!, | ||
}, | ||
signatureHeader: signatureHeader, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: this.addresses might be empty if listAddresses hasn't been called. Consider adding a check or calling listAddresses if needed
/** | ||
* Creates a Webhook. | ||
* | ||
* @param notificationUri - [String] The URI to which the webhook notifications will be sent. | ||
* @param signatureHeader - [String] (Optional) A header used to sign the webhook request, | ||
* defaulting to an empty string. | ||
* | ||
* @returns [Coinbase::Webhook] The newly created webhook instance. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Add @throws annotation to document potential errors
public getEventTypeFilter(): WebhookEventTypeFilter | undefined { | ||
return this.model?.event_type_filter; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Add JSDoc for the return type
What changed? Why?
Qualified Impact