Skip to content

Commit

Permalink
add unlisten
Browse files Browse the repository at this point in the history
  • Loading branch information
patricksalomoneoscanada committed Nov 27, 2018
1 parent e8990b8 commit 5a9657d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -13,8 +13,8 @@ Websocket consumer for the https://dfuse.io API on EOS networks.
ga.ReqID = "get-accounts-jsons"
ga.StartBlock = -5000
ga.Listen = true
ga.Data.Account = "accountsjson"
ga.Data.ActionName = "set"
ga.Data.Accounts = "accountsjson"
ga.Data.ActionNames = "set"

fmt.Println("Sending `get_actions` message")
err = client.Send(ga)
Expand Down
5 changes: 4 additions & 1 deletion actions.go
Expand Up @@ -13,8 +13,11 @@ type GetActionTraces struct {
CommonOut

Data struct {
Receivers string `json:"receivers,omitempty"`
Accounts string `json:"accounts"`
ActionNames string `json:"action_names,omitempty"`
Receiver string `json:"receiver,omitempty"`
Account string `json:"account"`
Account string `json:"account,omitempty"`
ActionName string `json:"action_name,omitempty"`
WithDBOps bool `json:"with_dbops"`
WithRAMOps bool `json:"with_ramops"`
Expand Down
4 changes: 2 additions & 2 deletions examples/actionload/main.go
Expand Up @@ -28,8 +28,8 @@ func main() {
ga.StartBlock = -10
ga.Listen = true
ga.WithProgress = 5
ga.Data.Account = "eosio.token"
ga.Data.ActionName = "transfer"
ga.Data.Accounts = "eosio.token"
ga.Data.ActionNames = "transfer"
ga.Data.WithInlineTraces = true

fmt.Println("Sending `get_actions` message")
Expand Down
4 changes: 2 additions & 2 deletions message_test.go
Expand Up @@ -18,8 +18,8 @@ func Test_GetActions(t *testing.T) {
ga.ReqID = "1"
ga.StartBlock = -10
ga.Listen = true
ga.Data.Account = "eosio.token"
ga.Data.ActionName = "transfer"
ga.Data.Accounts = "eosio.token"
ga.Data.ActionNames = "transfer"
ga.Data.WithInlineTraces = true

client.Send(ga)
Expand Down
20 changes: 20 additions & 0 deletions unlisten.go
@@ -0,0 +1,20 @@
package eosws

func init() {
RegisterOutgoingMessage("unlisten", Unlisten{})
RegisterIncomingMessage("unlistened", Unlistened{})
}

type Unlisten struct {
CommonOut
Data struct {
ReqID string `json:"req_id"`
} `json:"data"`
}

type Unlistened struct {
CommonIn
Data struct {
Success bool `json:"success"`
} `json:"data"`
}

0 comments on commit 5a9657d

Please sign in to comment.