Skip to content

Commit

Permalink
feat(): add blackList cli
Browse files Browse the repository at this point in the history
  • Loading branch information
zyjblockchain committed Aug 15, 2023
1 parent 2b52308 commit 01f5901
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions sdk/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,44 @@ func (c *Client) Balances(accid string) (balances schema.AccBalances, err error)
return
}

func (c *Client) BlackList(tokenTag string) ([]string, error) {
req := c.cli.Request()
req.Path(fmt.Sprintf("/black_list/%s", tokenTag))

res, err := req.Send()
if err != nil {
return nil, err
}
defer res.Close()
if !res.Ok {
err = decodeRespErr(res.Bytes())
return nil, err
}

result := make([]string, 0)
err = json.Unmarshal(res.Bytes(), &result)
return result, err
}

func (c *Client) WhiteList(tokenTag string) ([]string, error) {
req := c.cli.Request()
req.Path(fmt.Sprintf("/white_list/%s", tokenTag))

res, err := req.Send()
if err != nil {
return nil, err
}
defer res.Close()
if !res.Ok {
err = decodeRespErr(res.Bytes())
return nil, err
}

result := make([]string, 0)
err = json.Unmarshal(res.Bytes(), &result)
return result, err
}

// Txs
// option args: tokenId, action, withoutAction
// default value: page(1), orderBy(desc)
Expand Down

0 comments on commit 01f5901

Please # to comment.