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

Webhook update hotfix #289

Merged
merged 3 commits into from
Oct 9, 2024
Merged

Webhook update hotfix #289

merged 3 commits into from
Oct 9, 2024

Conversation

howard-at-cb
Copy link
Contributor

@howard-at-cb howard-at-cb commented Oct 9, 2024

What changed? Why?

Fixed a bug that overwrites existing webhook notification URI when only updating a webhook's addresses

 let wh = await Webhook.create({ networkId: "base-mainnet", notificationUri: "https://www.google.com/callback", eventType: "wallet_activity",  eventTypeFilter: {addresses: ["0xa55C5950F7A3C42Fa5799B2Cac0e455774a07382"], wallet_id: "w1"}, eventFilters: [{ contract_address: "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" }], signatureHeader: "optional-signature-string"});
undefined
> wh.update({eventTypeFilter: {addresses:["0x40A28c0fCc0BE09400bB89CdF556Cd8C4eF1c165","0x6f03b3Df22F0C57A4477EEAc3a49c2Bc4EAe2206"]}})
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 136,
  [Symbol(trigger_async_id_symbol)]: 4
}
> wh
Webhook {
  model: {
    created_at: '2024-10-09T18:47:59.182Z',
    event_filters: [ [Object] ],
    event_type: 'wallet_activity',
    event_type_filter: { addresses: [Array], wallet_id: 'w1' },
    id: '6706cfdf1f3dda7f7fc8f6d2',
    network_id: 'base-mainnet',
    notification_uri: 'https://www.google.com/callback',
    updated_at: '2024-10-09T18:48:13.901Z'
  }
}

 wh.update({notificationUri: "https://abc.com/callback"})
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 563,
  [Symbol(trigger_async_id_symbol)]: 4
}
> wh.toString()
`Webhook { id: '670706861f3dda7f7fc8f6d9', networkId: 'base-mainnet', eventType: 'wallet_activity', eventFilter: [{"contract_address":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913"}], eventTypeFilter: {"addresses":["0x40a28c0fcc0be09400bb89cdf556cd8c4ef1c165","0x6f03b3df22f0c57a4477eeac3a49c2bc4eae2206"],"wallet_id":"w1"}, notificationUri: 'https://abc.com/callback', signatureHeader: 'undefined' }`

ref PR #288

Qualified Impact

@howard-at-cb howard-at-cb merged commit de829f6 into v0.8.1-release Oct 9, 2024
6 checks passed
@howard-at-cb howard-at-cb deleted the webhook-update-hotfix branch October 9, 2024 23:44
howard-at-cb added a commit that referenced this pull request Oct 11, 2024
* Webhook update hotfix (#289)

* update webhook bugfix

* address comments

* Update CHANGELOG.md

* Update webhook quickstart guide and package.json (#293)

* Update README.md

* Revert "Update README.md"

This reverts commit 9a7fb38.

* Update README.md

* 0.8.1
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.

3 participants