forked from eoscanada/eos-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unlinkauth.go
36 lines (32 loc) · 906 Bytes
/
unlinkauth.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
package system
import "github.com/eoscanada/eos-go"
// NewUnlinkAuth creates an action from the `eosio.system` contract
// called `unlinkauth`.
//
// `unlinkauth` detaches a previously set permission from a
// `code::actionName`. See `linkauth`.
func NewUnlinkAuth(account, code eos.AccountName, actionName eos.ActionName) *eos.Action {
a := &eos.Action{
Account: AN("eosio"),
Name: ActN("unlinkauth"),
Authorization: []eos.PermissionLevel{
{
Actor: account,
Permission: eos.PermissionName("active"),
},
},
ActionData: eos.NewActionData(UnlinkAuth{
Account: account,
Code: code,
Type: actionName,
}),
}
return a
}
// UnlinkAuth represents the native `unlinkauth` action, through the
// system contract.
type UnlinkAuth struct {
Account eos.AccountName `json:"account"`
Code eos.AccountName `json:"code"`
Type eos.ActionName `json:"type"`
}