forked from eoscanada/eos-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
undelegatebw.go
31 lines (28 loc) · 887 Bytes
/
undelegatebw.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
package system
import (
eos "github.com/yekai1003/eos-go"
)
// NewUndelegateBW returns a `undelegatebw` action that lives on the
// `eosio.system` contract.
func NewUndelegateBW(from, receiver eos.AccountName, unstakeCPU, unstakeNet eos.Asset) *eos.Action {
return &eos.Action{
Account: AN("eosio"),
Name: ActN("undelegatebw"),
Authorization: []eos.PermissionLevel{
{Actor: from, Permission: PN("active")},
},
ActionData: eos.NewActionData(UndelegateBW{
From: from,
Receiver: receiver,
UnstakeNet: unstakeNet,
UnstakeCPU: unstakeCPU,
}),
}
}
// UndelegateBW represents the `eosio.system::undelegatebw` action.
type UndelegateBW struct {
From eos.AccountName `json:"from"`
Receiver eos.AccountName `json:"receiver"`
UnstakeNet eos.Asset `json:"unstake_net_quantity"`
UnstakeCPU eos.Asset `json:"unstake_cpu_quantity"`
}