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 #318

Closed
wants to merge 4 commits into from
Closed

Smart contract webhook #318

wants to merge 4 commits into from

Conversation

howard-at-cb
Copy link
Contributor

@howard-at-cb howard-at-cb commented Nov 22, 2024

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

@cb-heimdall
Copy link

cb-heimdall commented Nov 22, 2024

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

2. given API now requires walletID for wallet webhook's eventTypeFilter, this change uses an empty string for wallet ID when updating wallet webhook's eventTypeFilter. This will eventually be modified because we will support updating wallet ID for wallet webhook's eventTypeFilter in the backend.
@howard-at-cb howard-at-cb force-pushed the smart-contract-webhook branch from b0df84a to 286536e Compare November 26, 2024 02:27
@howard-at-cb howard-at-cb deleted the smart-contract-webhook branch November 26, 2024 23:47
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