Skip to content

Commit

Permalink
Add tx resubmission notification (#186)
Browse files Browse the repository at this point in the history
* feat: tx resubmission notification
  • Loading branch information
0xSulpiride authored Nov 7, 2022
1 parent c126a63 commit f76fdb9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "etherspot",
"version": "1.38.2",
"version": "1.38.3",
"description": "Etherspot SDK",
"keywords": [
"ether",
Expand Down
1 change: 1 addition & 0 deletions src/sdk/notification/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum NotificationTypes {
ENSNodeUpdated = 'ENSNodeUpdated',
GatewayBatchCreated = 'GatewayBatchCreated',
GatewayBatchUpdated = 'GatewayBatchUpdated',
GatewayBatchResubmitted = 'GatewayBatchResubmitted',
P2PPaymentChannelCreated = 'P2PPaymentChannelCreated',
P2PPaymentChannelUpdated = 'P2PPaymentChannelUpdated',
P2PPaymentDepositCreated = 'P2PPaymentDepositCreated',
Expand Down
12 changes: 12 additions & 0 deletions src/sdk/notification/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NotificationTypes } from './constants';
import { GatewayTransaction } from '../gateway';

export interface BaseNotification<T = any, P = any> {
type: T;
Expand Down Expand Up @@ -35,6 +36,17 @@ export type GatewayBatchNotification = BaseNotification<
}
>;

export type GatewayResubmittedNotification = BaseNotification<
NotificationTypes.GatewayBatchResubmitted,
{
hash: string;
oldTransaction: {
id: number,
},
newTransaction: GatewayTransaction,
}
>

export type P2PPaymentChannelNotification = BaseNotification<
NotificationTypes.P2PPaymentChannelCreated | NotificationTypes.P2PPaymentChannelUpdated,
{
Expand Down

0 comments on commit f76fdb9

Please sign in to comment.