-
Notifications
You must be signed in to change notification settings - Fork 10
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
Enable wallet activity events support for webhooks at wallet level #189
base: v0.7.0
Are you sure you want to change the base?
Conversation
✅ Heimdall Review Status
|
lib/coinbase/wallet.rb
Outdated
# defaulting to an empty string. | ||
# | ||
# @return [Coinbase::Webhook] The newly created webhook instance. | ||
def create_webhook(notification_uri:, addresses: self.addresses.map(&:id), signature_header: '') |
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.
are we providing some sort of override to wallet addresses?
i feel they should not be able to do that... if custom group of addresses needs to be provided they can just go through webhook object
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.
Should we disallow clients to specify addresses when calling wallet.create_webhook()
? We can use the wallet's existing addresses.
notification_uri: notification_uri, | ||
event_type: Coinbase::Webhook::WALLET_ACTIVITY_EVENT, | ||
event_type_filter: { | ||
addresses: addresses.map(&:id), |
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.
Can the addresses
be determined by the backend?
Otherwise when we create a new address, the user would need to update the webhook or the backend would need to manage it anyways
@@ -21,10 +21,12 @@ | |||
let(:second_address_model) do | |||
build(:address_model, network_id, :with_seed, seed: seed, wallet_id: wallet_id, index: 1) | |||
end | |||
let(:webhook_model) { build(:webhook_model, :wallet_activity) } |
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.
If this is only used in the #create_webhook
test, please define it in that test.
The let
should generally be defined in the most narrow scope possible (e.g. the top-level lets
are referenced by multiple test cases or in a top-level before
block_
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.
could it be Eth?
What changed? Why?
wallet_activity
event type withevent_type_filter
->wallet_activity_filter
that tracks wallet addresses with wallet idwallet.create_webhook()
Qualified Impact