mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #46389 [coinbase-commerce-node] - verifyEventBody function by @Johann-S
This commit is contained in:
parent
0cfd1d7b7d
commit
3acf01d3ca
@ -338,3 +338,10 @@ const paginationExample: Pagination = {
|
||||
*/
|
||||
// tslint:disable-next-line:void-return no-void-expression
|
||||
const shouldBeVoid: void = Webhook.verifySigHeader(JSON.stringify(eventResponseExample), 'some-signature', 'my-secret');
|
||||
|
||||
/**
|
||||
* Verify event body.
|
||||
*
|
||||
* @link https://github.com/coinbase/coinbase-commerce-node/blob/v1.0.4/lib/Webhook.js#L10
|
||||
*/
|
||||
Webhook.verifyEventBody(JSON.stringify(eventResponseExample), 'some-signature', 'my-secret');
|
||||
|
||||
7
types/coinbase-commerce-node/index.d.ts
vendored
7
types/coinbase-commerce-node/index.d.ts
vendored
@ -594,6 +594,13 @@ declare namespace Webhook {
|
||||
* @link https://github.com/coinbase/coinbase-commerce-node#verify-signature-header
|
||||
*/
|
||||
function verifySigHeader(rawBody: string, signature: string, sharedSecret: string): void;
|
||||
|
||||
/**
|
||||
* Verify event body.
|
||||
*
|
||||
* @link https://github.com/coinbase/coinbase-commerce-node/blob/v1.0.4/lib/Webhook.js#L10
|
||||
*/
|
||||
function verifyEventBody(rawBody: string, signature: string, sharedSecret: string): resources.Event;
|
||||
}
|
||||
|
||||
export {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user