denotify-client 1.1.15 → 1.1.17
Sign up to get free protection for your applications and to get access to all the features.
- package/.env +1 -1
- package/.eslintrc +35 -16
- package/.lintstagedrc +2 -2
- package/.prettierrc +14 -14
- package/.stylelintrc +16 -16
- package/.vscode/settings.json +3 -1
- package/README.md +1 -1
- package/dist/denotify-client.cjs +4 -4
- package/dist/denotify-client.d.ts +101 -68
- package/dist/denotify-client.iife.js +4 -4
- package/dist/denotify-client.mjs +2119 -2050
- package/dts-bundle-generator.config.ts +12 -12
- package/index.html +10 -10
- package/package.json +57 -52
- package/tsconfig.json +3 -5
- package/types/alertbuilder.d.ts +95 -95
- package/types/client.d.ts +11 -11
- package/types/denotifyclient.d.ts +49 -49
- package/types/functionbuilder.d.ts +28 -28
- package/types/index.d.ts +6 -6
- package/types/notifications/index.d.ts +30 -30
- package/types/notifications/notification.d.ts +17 -17
- package/types/notifications/notify_discord_webhook.d.ts +25 -25
- package/types/triggers/handler_function_call.d.ts +53 -53
- package/types/triggers/handler_function_call_v2.d.ts +83 -83
- package/types/triggers/handler_onchain_event.d.ts +44 -44
- package/types/triggers/index.d.ts +54 -54
- package/types/triggers/trigger.d.ts +50 -50
- package/types/types/notification.d.ts +4 -4
- package/types/types/trigger.d.ts +17 -17
- package/types/types/types.d.ts +14 -14
- package/types/util/filter.d.ts +56 -56
@@ -1,36 +1,36 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
NotificationTypeId,
|
3
|
+
NotificationConfig,
|
4
|
+
NotifyRawId,
|
5
|
+
NotifyRawConfig,
|
6
|
+
NotifyRawResponse,
|
7
|
+
NotifyRawUpdate,
|
8
|
+
NotificationRawConfig,
|
9
|
+
Notification
|
10
10
|
} from './notification.js'
|
11
11
|
import {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
12
|
+
DiscordWebhook,
|
13
|
+
NotifyDiscordWebhookRawId,
|
14
|
+
NOTIFY_DISCORD_WEBHOOK_RAW_ID,
|
15
|
+
NotifyDiscordWebhookRawConfig,
|
16
|
+
NotifyDiscordWebhookRawResponse,
|
17
|
+
NotifyDiscordWebhookRawUpdate,
|
18
|
+
NotifyDiscordWebhook
|
19
19
|
} from './notify_discord_webhook.js'
|
20
20
|
export {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
21
|
+
DiscordWebhook,
|
22
|
+
NotifyDiscordWebhookRawId,
|
23
|
+
NOTIFY_DISCORD_WEBHOOK_RAW_ID,
|
24
|
+
NotifyDiscordWebhookRawConfig,
|
25
|
+
NotifyDiscordWebhookRawResponse,
|
26
|
+
NotifyDiscordWebhookRawUpdate,
|
27
|
+
NotifyDiscordWebhook,
|
28
|
+
NotificationTypeId,
|
29
|
+
NotificationConfig,
|
30
|
+
NotifyRawId,
|
31
|
+
NotifyRawConfig,
|
32
|
+
NotifyRawResponse,
|
33
|
+
NotifyRawUpdate,
|
34
|
+
NotificationRawConfig,
|
35
|
+
Notification
|
36
36
|
}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
DiscordWebhook,
|
3
|
+
NotifyDiscordWebhookRawConfig,
|
4
|
+
NotifyDiscordWebhookRawId,
|
5
|
+
NotifyDiscordWebhookRawResponse,
|
6
|
+
NotifyDiscordWebhookRawUpdate
|
7
7
|
} from './notify_discord_webhook.js'
|
8
8
|
export type NotificationTypeId = 'Discord'
|
9
9
|
export type NotificationConfig = DiscordWebhook
|
@@ -12,20 +12,20 @@ export type NotifyRawConfig = NotifyDiscordWebhookRawConfig
|
|
12
12
|
export type NotifyRawResponse = NotifyDiscordWebhookRawResponse
|
13
13
|
export type NotifyRawUpdate = NotifyDiscordWebhookRawUpdate
|
14
14
|
export type NotificationRawConfig = {
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
name: string
|
16
|
+
notify_type: NotifyRawId
|
17
|
+
notify: NotifyRawConfig
|
18
18
|
}
|
19
19
|
export type NotificationRawResponse = {
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
notify_type: NotifyRawId
|
21
|
+
notify: NotifyRawResponse
|
22
|
+
error: boolean
|
23
|
+
error_message: string | null
|
24
|
+
error_timestamp: number | null
|
25
25
|
}
|
26
26
|
export declare class Notification {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
static SimpleToRaw(
|
28
|
+
id: NotificationTypeId,
|
29
|
+
config: NotificationConfig
|
30
|
+
): NotificationRawConfig
|
31
31
|
}
|
@@ -1,38 +1,38 @@
|
|
1
1
|
import { NotificationRawConfig } from './notification.js'
|
2
2
|
export type DiscordWebhook = {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
url: string
|
4
|
+
username?: string
|
5
|
+
avatar_url?: string
|
6
|
+
message: string
|
7
7
|
}
|
8
8
|
export type NotifyDiscordWebhookRawId = 'notify_discord_webhook'
|
9
9
|
export declare const NOTIFY_DISCORD_WEBHOOK_RAW_ID = 'notify_discord_webhook'
|
10
10
|
export type NotifyDiscordWebhookRawConfig = {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
url: string
|
12
|
+
username?: string
|
13
|
+
avatar_url?: string
|
14
|
+
message: string
|
15
15
|
}
|
16
16
|
export type NotifyDiscordWebhookRawResponse = {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
id: number
|
18
|
+
created_at: string
|
19
|
+
url: string
|
20
|
+
username: string
|
21
|
+
avatar_url: string
|
22
|
+
message: string
|
23
23
|
}
|
24
24
|
export type NotifyDiscordWebhookRawUpdate = {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
url?: string
|
26
|
+
username?: string
|
27
|
+
avatar_url?: string
|
28
|
+
message?: string
|
29
29
|
}
|
30
30
|
export declare class NotifyDiscordWebhook {
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
static SimpleToRaw(config: DiscordWebhook): NotificationRawConfig
|
32
|
+
static validateCreate(options: any): Promise<{
|
33
|
+
username?: string | undefined
|
34
|
+
avatar_url?: string | undefined
|
35
|
+
message: string
|
36
|
+
url: string
|
37
|
+
}>
|
38
38
|
}
|
@@ -1,66 +1,66 @@
|
|
1
1
|
import { Condition } from '../types/types.js'
|
2
2
|
import { Network, TriggerRawConfig } from './trigger.js'
|
3
3
|
export type PollFunctionV1 = {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
4
|
+
nBlocks: number
|
5
|
+
address: string
|
6
|
+
abi: any
|
7
|
+
fixedArgs?: (string | number)[]
|
8
|
+
function: string
|
9
|
+
condition: Condition
|
10
|
+
responseArgIndex?: number
|
11
|
+
responseArgDecimals?: number
|
12
|
+
constant?: number
|
13
13
|
}
|
14
14
|
export type HandlerFunctionCallRawConfig = {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
15
|
+
nBlocks: number
|
16
|
+
address: string
|
17
|
+
abi: any
|
18
|
+
fixedArgs?: (string | number)[]
|
19
|
+
function: string
|
20
|
+
condition: Condition
|
21
|
+
responseArgIndex?: number
|
22
|
+
responseArgDecimals?: number
|
23
|
+
constant?: number
|
24
24
|
}
|
25
25
|
export type HandlerFunctionCallUpdate = Partial<HandlerFunctionCallRawConfig>
|
26
26
|
export type HandlerFunctionCallRawResponse = {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
27
|
+
id: number
|
28
|
+
created_at: string
|
29
|
+
nBlocks: number
|
30
|
+
address: string
|
31
|
+
fixedArgs: string[]
|
32
|
+
responseArgIndex: number
|
33
|
+
responseArgDecimals: number
|
34
|
+
function: string
|
35
|
+
condition: Condition
|
36
|
+
constant: number
|
37
|
+
abi: string[]
|
38
|
+
version: number
|
39
39
|
}
|
40
40
|
export type HandlerFunctionCallRawUpdate = {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
41
|
+
address?: string
|
42
|
+
function?: string
|
43
|
+
abi?: any
|
44
|
+
constant?: number
|
45
|
+
nBlocks?: number
|
46
|
+
confition?: Condition
|
47
|
+
fixedArgs?: (string | number)[]
|
48
|
+
responseArgIndex?: number
|
49
|
+
responseArgDecimals?: number
|
50
50
|
}
|
51
51
|
export declare class HandlerFunctionCall {
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
52
|
+
static SimpleToRaw(
|
53
|
+
name: string,
|
54
|
+
network: Network,
|
55
|
+
config: PollFunctionV1
|
56
|
+
): TriggerRawConfig
|
57
|
+
static validateCreate(options: any): Promise<{
|
58
|
+
condition?: string | undefined
|
59
|
+
nBlocks?: number | undefined
|
60
|
+
constant?: number | undefined
|
61
|
+
responseArgIndex?: number | undefined
|
62
|
+
responseArgDecimals?: number | undefined
|
63
|
+
address: string
|
64
|
+
abi: any[]
|
65
|
+
}>
|
66
66
|
}
|
@@ -10,97 +10,97 @@ type TimeBase = 'blocks' | 'time'
|
|
10
10
|
*
|
11
11
|
*/
|
12
12
|
export type PollFunctionV2 = {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
timeBase: TimeBase
|
14
|
+
nBlocks?: number
|
15
|
+
timePeriod?: string | null
|
16
|
+
startTime?: number
|
17
|
+
debounceCount?: number
|
18
|
+
functions: FunctionCallerConfig
|
19
|
+
triggerOn: 'always' | 'filter'
|
20
|
+
latch?: boolean
|
21
|
+
filterVersion?: string
|
22
|
+
filter?: FilterConfig
|
23
23
|
}
|
24
24
|
export type HandlerFunctionCallV2RawConfig = {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
25
|
+
timeBase: TimeBase
|
26
|
+
nBlocks?: number
|
27
|
+
timePeriod?: string | null
|
28
|
+
startTime?: number
|
29
|
+
debounceCount?: number
|
30
|
+
functions: FunctionCallerConfig
|
31
|
+
triggerOn: 'always' | 'filter'
|
32
|
+
latch?: boolean
|
33
|
+
filterVersion?: string
|
34
|
+
filter?: FilterConfig
|
35
35
|
}
|
36
36
|
export type HandlerFunctionCallV2Update =
|
37
|
-
|
37
|
+
Partial<HandlerFunctionCallV2RawConfig>
|
38
38
|
export type HandlerFunctionCallV2RawResponse = {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
39
|
+
id: number
|
40
|
+
created_at: string
|
41
|
+
nBlocks: number
|
42
|
+
address: string
|
43
|
+
fixedArgs: string[]
|
44
|
+
responseArgIndex: number
|
45
|
+
responseArgDecimals: number
|
46
|
+
function: string
|
47
|
+
condition: Condition
|
48
|
+
constant: number
|
49
|
+
abi: string[]
|
50
|
+
version: number
|
51
51
|
}
|
52
52
|
export type HandlerFunctionCallV2RawUpdate = {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
53
|
+
address?: string
|
54
|
+
function?: string
|
55
|
+
abi?: any
|
56
|
+
constant?: number
|
57
|
+
nBlocks?: number
|
58
|
+
confition?: Condition
|
59
|
+
fixedArgs?: (string | number)[]
|
60
|
+
responseArgIndex?: number
|
61
|
+
responseArgDecimals?: number
|
62
62
|
}
|
63
63
|
export declare class HandlerFunctionCallV2 {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
64
|
+
static SimpleToRaw(
|
65
|
+
name: string,
|
66
|
+
network: Network,
|
67
|
+
config: PollFunctionV2
|
68
|
+
): TriggerRawConfig
|
69
|
+
static validateCreate(options: any): Promise<{
|
70
|
+
filter?:
|
71
|
+
| {
|
72
|
+
conditions?:
|
73
|
+
| {
|
74
|
+
operation?: string | undefined
|
75
|
+
constant?: {} | undefined
|
76
|
+
logic: NonNullable<
|
77
|
+
'AND' | 'OR' | 'XOR' | 'NAND' | 'NOR' | 'WHERE' | undefined
|
78
|
+
>
|
79
|
+
key: string
|
80
|
+
type: NonNullable<'String' | 'Address' | 'Number' | undefined>
|
81
|
+
}[]
|
82
|
+
| undefined
|
83
|
+
logic: NonNullable<
|
84
|
+
'AND' | 'OR' | 'XOR' | 'NAND' | 'NOR' | 'WHERE' | undefined
|
85
|
+
>
|
86
|
+
}[]
|
87
|
+
| undefined
|
88
|
+
nBlocks?: number | undefined
|
89
|
+
timePeriod?: string | undefined
|
90
|
+
debounceCount?: number | undefined
|
91
|
+
functions?:
|
92
|
+
| {
|
93
|
+
function: string
|
94
|
+
address: string
|
95
|
+
bytecode: string
|
96
|
+
abiHash: string
|
97
|
+
}[]
|
98
|
+
| undefined
|
99
|
+
filterVersion?: string | undefined
|
100
|
+
latch: boolean
|
101
|
+
timeBase: NonNullable<'blocks' | 'time' | undefined>
|
102
|
+
startTime: number
|
103
|
+
triggerOn: 'always' | 'filter'
|
104
|
+
}>
|
105
105
|
}
|
106
106
|
export {}
|
@@ -1,57 +1,57 @@
|
|
1
1
|
import { Network, TriggerRawConfig } from './trigger.js'
|
2
2
|
import { Condition } from '../types/types.js'
|
3
3
|
export type OnchainEventV1 = {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
address: string
|
5
|
+
event: string
|
6
|
+
abi: any
|
7
|
+
condition: Condition
|
8
|
+
paramsIndex?: number
|
9
|
+
paramsDecimals?: number
|
10
|
+
constant?: number
|
11
11
|
}
|
12
12
|
export type HandlerOnchainEventRawConfig = {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
address: string
|
14
|
+
event: string
|
15
|
+
abi: any
|
16
|
+
condition: Condition
|
17
|
+
paramsIndex?: number
|
18
|
+
paramsDecimals?: number
|
19
|
+
constant?: number
|
20
20
|
}
|
21
21
|
export type HandlerOnchainEventUpdate = Partial<HandlerOnchainEventRawConfig>
|
22
22
|
export type HandlerOnchainEventRawResponse = {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
23
|
+
id: number
|
24
|
+
created_at: string
|
25
|
+
address: string
|
26
|
+
event: string
|
27
|
+
abi: any
|
28
|
+
paramsIndex: number
|
29
|
+
paramsDecimals: number
|
30
|
+
condition: Condition
|
31
|
+
constant: number
|
32
32
|
}
|
33
33
|
export type HandlerOnchainEventRawUpdate = {
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
address?: string
|
35
|
+
event?: string
|
36
|
+
abi?: any
|
37
|
+
paramsIndex?: number
|
38
|
+
paramsDecimals?: number
|
39
|
+
constant?: number
|
40
40
|
}
|
41
41
|
export declare class HandlerOnchainEvent {
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
42
|
+
static SimpleToRaw(
|
43
|
+
name: string,
|
44
|
+
network: Network,
|
45
|
+
config: OnchainEventV1
|
46
|
+
): TriggerRawConfig
|
47
|
+
static validateCreate(options: any): Promise<{
|
48
|
+
condition?: string | undefined
|
49
|
+
constant?: number | undefined
|
50
|
+
paramsIndex?: number | undefined
|
51
|
+
paramsDecimals?: number | undefined
|
52
|
+
event: string
|
53
|
+
address: string
|
54
|
+
abi: any[]
|
55
|
+
}>
|
56
|
+
static validateUpdate(options: any): void
|
57
57
|
}
|