-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86ec9c1
commit e3d501b
Showing
10 changed files
with
127 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,58 @@ | ||
package bitgo | ||
|
||
// TODO | ||
import ( | ||
"fmt" | ||
"time" | ||
) | ||
|
||
type Webhook struct { | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package bitgo | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
// List Wallet Webhooks | ||
|
||
func TestListWalletWebhooks(t *testing.T) { | ||
coin, params := getTestCoin(t) | ||
|
||
_, err := coin.ListWalletWebhooks(params.WalletId, GetWalletParams{AllTokens: true}) | ||
if err != nil { | ||
t.Fatal(err.Error()) | ||
} | ||
} | ||
|
||
// Add Wallet Webhook | ||
|
||
// Remove Wallet Webhook | ||
|
||
// Simulate Wallet Webhook | ||
|
||
// List User Webhooks | ||
|
||
// Add User Webhook | ||
|
||
// Remove User Webhook | ||
|
||
// Simulate User Webhook |