-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re-organize event system and add audit check
- Loading branch information
Showing
10 changed files
with
179 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package eclair | ||
|
||
import ( | ||
"encoding/json" | ||
) | ||
|
||
const ( | ||
auditPath = "/audit" | ||
) | ||
|
||
type AuditResponse struct { | ||
Sent []PaymentSent `json:"sent"` | ||
Received []PaymentReceived `json:"received"` | ||
Relayed []PaymentRelayed `json:"relayed"` | ||
} | ||
|
||
func (c *Client) Audit() (*AuditResponse, error) { | ||
var response AuditResponse | ||
data, err := c.Post(auditPath, nil, nil) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
err = json.Unmarshal(data, &response) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return &response, nil | ||
} |
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 eclair | ||
|
||
type ChannelCreated struct { | ||
Type string `json:"type"` | ||
RemoteNodeId string `json:"remoteNodeId"` | ||
IsInitiator bool `json:"isInitiator"` | ||
TemporaryChannelId string `json:"temporaryChannelId"` | ||
InitialFeeRatePerKw int `json:"initialFeeratePerKw"` | ||
FundingTxFeeRatePerKw int `json:"fundingTxFeeratePerKw"` | ||
} | ||
|
||
type ChannelOpened struct { | ||
Type string `json:"type"` | ||
RemoteNodeId string `json:"remoteNodeId"` | ||
ChannelId string `json:"channelId"` | ||
} | ||
|
||
type ChannelStateChanged struct { | ||
Type string `json:"type"` | ||
ChannelId string `json:"channelId"` | ||
RemoteNodeId string `json:"remoteNodeId"` | ||
PreviousState string `json:"previousState"` | ||
CurrentState string `json:"currentState"` | ||
} | ||
|
||
type ChannelClosed struct { | ||
Type string `json:"type"` | ||
ChannelId string `json:"channelId"` | ||
ClosingType string `json:"closingType"` | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package eclair | ||
|
||
type Failure struct { | ||
FailureType string `json:"failureType"` | ||
FailureMessage string `json:"failureMessage"` | ||
FailedRoute []string `json:"failedRoute"` | ||
} |
Oops, something went wrong.