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

Smart contract webhook #321

Merged
merged 9 commits into from
Nov 27, 2024
Merged

Smart contract webhook #321

merged 9 commits into from
Nov 27, 2024

Conversation

howard-at-cb
Copy link
Contributor

What changed? Why?

allow create and update for smart contract activity event webhook

 let w1 = await Webhook.create({ networkId: "base-mainnet", notificationUri: "https://ea.com/callback", eventType: "wallet_activity",  eventTypeFilter: {addresses: ["0xa55C5950F7A3C42Fa5799B2Cac0e455774a07382"], wallet_id: ""}, signatureHeader: "optional-signature-string"});

> w1.update({eventTypeFilter: {addresses:["0x40A28c0fCc0BE09400bB89CdF556Cd8C4eF1c165","0x6f03b3Df22F0C57A4477EEAc3a49c2Bc4EAe2206"]}})

> w1.toString()
`Webhook { id: '67452cef0e6f6e4ca45cce24', networkId: 'base-mainnet', eventType: 'wallet_activity', eventFilter: undefined, eventTypeFilter: {"addresses":["0x40a28c0fcc0be09400bb89cdf556cd8c4ef1c165","0x6f03b3df22f0c57a4477eeac3a49c2bc4eae2206"],"wallet_id":""}, notificationUri: 'https://ea.com/callback', signatureHeader: 'undefined' }`

>  const wa2 = await Wallet.create();

> let wh2 = await wa2.createWebhook('https://youtube.com')

> wh2.toString()
`Webhook { id: '67452d5a0e6f6e4ca45cce25', networkId: 'base-sepolia', eventType: 'wallet_activity', eventFilter: undefined, eventTypeFilter: {"addresses":["0xd9b5a99221256c403863e0ed81182389d57c093a"],"wallet_id":"451149df-a6d6-45d6-95c1-64c646b5f5ad"}, notificationUri: 'https://youtube.com', signatureHeader: 'undefined' }`

let w0 = await Webhook.create({ networkId: "base-mainnet", notificationUri: "https://ea.com/callback", eventType: "smart_contract_event_activity",  eventTypeFilter: {contract_addresses: ["0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "0x940181a94a35a4569e4529a3cdfb74e38fd98631"]}, signatureHeader: "optional-signature-string"});

> w0.update({eventTypeFilter: {contract_addresses:["0x40A28c0fCc0BE09400bB89CdF556Cd8C4eF1c165","0x6f03b3Df22F0C57A4477EEAc3a49c2Bc4EAe2206"]}})

 w0.update({notificationUri: "https://bbc.com/callback"})

> w0.toString()
`Webhook { id: '67452fd10e6f6e4ca45cce26', networkId: 'base-mainnet', eventType: 'smart_contract_event_activity', eventFilter: undefined, eventTypeFilter: {"contract_addresses":["0x40a28c0fcc0be09400bb89cdf556cd8c4ef1c165","0x6f03b3df22f0c57a4477eeac3a49c2bc4eae2206"]}, notificationUri: 'https://bbc.com/callback', signatureHeader: 'undefined' }`

Qualified Impact

@howard-at-cb howard-at-cb marked this pull request as ready for review November 26, 2024 23:47
@@ -25,7 +25,7 @@ import {
FetchHistoricalStakingBalances200Response,
StakingRewardStateEnum,
StakingRewardFormat,
FeatureSet,
FeatureSet, WebhookWalletActivityFilter,
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
FeatureSet, WebhookWalletActivityFilter,
FeatureSet,
WebhookWalletActivityFilter,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@alex-stone alex-stone merged commit bd89bdf into v0.11.0 Nov 27, 2024
4 checks passed
@alex-stone alex-stone deleted the contract-webhook branch November 27, 2024 20:43
@alex-stone alex-stone mentioned this pull request Nov 27, 2024
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