Skip to content

Conversation

@chaoyaji-cb
Copy link
Contributor

What changed? Why?

  • Added the signature header attribute when create webhook
  • Drop unnecessary fields when update the webhook

Qualified Impact

testing

> const w4 = await Webhook.create('base-mainnet', 'https://bug_bash.net', 'erc20_transfer', [{ contract_address: '0x24d6C74D811cfDe65995Ed26FD08Af445f8aaB06' }], 'node_js_testing')
undefined
> w4.toString()
`Webhook { id: '66cf98862b3574304368e6b9', network_id: 'base-mainnet', event_type: 'erc20_transfer', event_filter: [{"contract_address":"0x24d6C74D811cfDe65995Ed26FD08Af445f8aaB06"}], notification_uri: 'https://bug_bash.net', signature_header: 'node_js_testing' }`
image

Comment on lines 186 to 190
`event_type: '${this.getEventType()}', event_filter: ${JSON.stringify(this.getEventFilters())}, ` +
`notification_uri: '${this.getNotificationURI()}', signature_header: '${this.getSignatureHeader()}' }`
);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we camel case these please

});
});

describe(".getSignatureHeader", () => {
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
describe(".getSignatureHeader", () => {
describe("#getSignatureHeader", () => {

please use # for instance methods and . for static methods

notificationUri: string,
eventType: WebhookEventType,
eventFilters: Array<WebhookEventFilter>,
signatureHeader = "",
Copy link
Contributor

Choose a reason for hiding this comment

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

The create args are getting large. Let's consider adding a createWebhookOptions type

Copy link
Contributor

Choose a reason for hiding this comment

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

Example using createTransfer

export type CreateTransferOptions = {

test # .

use option

lint fix

test

fix test

added one more test

update

conflict

con

con

lint fix
@chaoyaji-cb chaoyaji-cb merged commit eec38cb into v0.3.0 Sep 4, 2024
@alex-stone alex-stone deleted the webhook-signature branch September 5, 2024 22:12
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