-
Notifications
You must be signed in to change notification settings - Fork 5
/
webhook-notifications.go
58 lines (44 loc) · 1.07 KB
/
webhook-notifications.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package bitgo
import (
"fmt"
"time"
)
type WebhookEvent struct {
Hash string `json:"hash"`
Transfer string `json:"transfer"`
Coin string `json:"coin"`
Type string `json:"type"`
Wallet string `json:"wallet"`
}
type Webhook struct {
ID string `json:"id"`
Label string `json:"label"`
Created time.Time `json:"created"`
WalletID string `json:"walletId"`
Coin string `json:"coin"`
Type string `json:"type"`
URL string `json:"url"`
Version int `json:"version"`
}
type Webhooks []Webhook
type ListWebhooks struct {
Webhooks Webhooks `json:"webhooks"`
}
// List Wallet Webhooks
func (b *BitGo) ListWalletWebhooks(walletId string, params GetWalletParams) (webhooks Webhooks, err error) {
responce := ListWebhooks{}
err = b.get(
fmt.Sprintf("%s/wallet/%s/webhooks",
b.coin,
walletId),
nil,
&responce)
return responce.Webhooks, err
}
// Add Wallet Webhook
// Remove Wallet Webhook
// Simulate Wallet Webhook
// List User Webhooks
// Add User Webhook
// Remove User Webhook
// Simulate User Webhook