Documentation ¶
Index ¶
- Constants
- func ParseMap(item stackitem.Item) (map[string]string, error)
- func UnwrapArrayOfUint160(items []stackitem.Item, err error) ([]util.Uint160, error)
- type Client
- func (c Client) AddSubjectKey(addr util.Uint160, key *keys.PublicKey) (tx util.Uint256, vub uint32, err error)
- func (c Client) AddSubjectKeyCall(addr util.Uint160, key *keys.PublicKey) (method string, args []any)
- func (c Client) AddSubjectToGroup(addr util.Uint160, groupID int64) (tx util.Uint256, vub uint32, err error)
- func (c Client) AddSubjectToGroupCall(addr util.Uint160, groupID int64) (method string, args []any)
- func (c Client) ClearAdmin() (tx util.Uint256, vub uint32, err error)
- func (c Client) ClearAdminCall() (method string, args []any)
- func (c Client) CreateGroup(namespace, group string) (tx util.Uint256, vub uint32, err error)
- func (c Client) CreateGroupCall(namespace, group string) (method string, args []any)
- func (c Client) CreateNamespace(namespace string) (tx util.Uint256, vub uint32, err error)
- func (c Client) CreateNamespaceCall(namespace string) (method string, args []any)
- func (c Client) CreateSubject(ns string, key *keys.PublicKey) (tx util.Uint256, vub uint32, err error)
- func (c Client) CreateSubjectCall(ns string, key *keys.PublicKey) (method string, args []any)
- func (c Client) DeleteGroup(namespace string, groupID int64) (tx util.Uint256, vub uint32, err error)
- func (c Client) DeleteGroupCall(namespace string, groupID int64) (method string, args []any)
- func (c Client) DeleteGroupKV(namespace string, groupID int64, key string) (tx util.Uint256, vub uint32, err error)
- func (c Client) DeleteGroupKVCall(namespace string, groupID int64, key string) (method string, args []any)
- func (c Client) DeleteSubject(addr util.Uint160) (tx util.Uint256, vub uint32, err error)
- func (c Client) DeleteSubjectCall(addr util.Uint160) (method string, args []any)
- func (c Client) DeleteSubjectKV(addr util.Uint160, key string) (tx util.Uint256, vub uint32, err error)
- func (c Client) DeleteSubjectKVCall(addr util.Uint160, key string) (method string, args []any)
- func (c Client) GetAdmin() (util.Uint160, bool, error)
- func (c Client) GetGroup(namespace string, groupID int64) (*Group, error)
- func (c Client) GetGroupByName(namespace, groupName string) (*Group, error)
- func (c Client) GetGroupExtended(namespace string, groupID int64) (*GroupExtended, error)
- func (c Client) GetGroupIDByName(namespace, groupName string) (int64, error)
- func (c Client) GetNamespace(namespace string) (*Namespace, error)
- func (c Client) GetNamespaceExtended(namespace string) (*NamespaceExtended, error)
- func (c Client) GetSubject(addr util.Uint160) (*Subject, error)
- func (c Client) GetSubjectByKey(key *keys.PublicKey) (*Subject, error)
- func (c Client) GetSubjectByName(namespace, subjectName string) (*Subject, error)
- func (c Client) GetSubjectExtended(addr util.Uint160) (*SubjectExtended, error)
- func (c Client) GetSubjectKV(addr util.Uint160, name string) (string, error)
- func (c Client) GetSubjectKeyByName(namespace, subjectName string) (*keys.PublicKey, error)
- func (c Client) ListFullSubjects(hashes []util.Uint160) ([]*Subject, error)
- func (c Client) ListGroupSubjects(namespace string, groupID int64) ([]util.Uint160, error)
- func (c Client) ListGroups(namespace string) ([]*Group, error)
- func (c Client) ListNamespaceSubjects(namespace string) ([]util.Uint160, error)
- func (c Client) ListNamespaces() ([]*Namespace, error)
- func (c Client) ListNonEmptyGroups(namespace string) ([]string, error)
- func (c Client) ListNonEmptyNamespaces() ([]string, error)
- func (c Client) ListSubjects() ([]util.Uint160, error)
- func (c Client) ParseGroupID(res *state.AppExecResult, err error) (int64, error)
- func (c Client) RemoveSubjectFromGroup(addr util.Uint160, groupID int64) (tx util.Uint256, vub uint32, err error)
- func (c Client) RemoveSubjectFromGroupCall(addr util.Uint160, groupID int64) (method string, args []any)
- func (c Client) RemoveSubjectKey(addr util.Uint160, key *keys.PublicKey) (tx util.Uint256, vub uint32, err error)
- func (c Client) RemoveSubjectKeyCall(addr util.Uint160, key *keys.PublicKey) (method string, args []any)
- func (c Client) SendTx(txn *commonclient.Transaction) (tx util.Uint256, vub uint32, err error)
- func (c Client) SetAdmin(owner util.Uint160) (tx util.Uint256, vub uint32, err error)
- func (c Client) SetAdminCall(owner util.Uint160) (method string, args []any)
- func (c Client) SetGroupKV(namespace string, groupID int64, key, val string) (tx util.Uint256, vub uint32, err error)
- func (c Client) SetGroupKVCall(namespace string, groupID int64, key, val string) (method string, args []any)
- func (c Client) SetGroupName(namespace string, groupID int64, name string) (tx util.Uint256, vub uint32, err error)
- func (c Client) SetGroupNameCall(namespace string, groupID int64, name string) (method string, args []any)
- func (c Client) SetSubjectKV(addr util.Uint160, key, val string) (tx util.Uint256, vub uint32, err error)
- func (c Client) SetSubjectKVCall(addr util.Uint160, key, val string) (method string, args []any)
- func (c Client) SetSubjectName(addr util.Uint160, name string) (tx util.Uint256, vub uint32, err error)
- func (c Client) SetSubjectNameCall(addr util.Uint160, name string) (method string, args []any)
- func (c Client) StartTx() *commonclient.Transaction
- func (c Client) Version() (int64, error)
- func (c Client) Wait(tx util.Uint256, vub uint32, err error) (*state.AppExecResult, error)
- func (c Client) Waiter() waiter.Waiter
- type Group
- type GroupExtended
- type Namespace
- type NamespaceExtended
- type Options
- type Subject
- type SubjectExtended
Constants ¶
const ( IAMPathKey = "iam-path" IAMARNKey = "iam-arn" IAMCreatedTimeKey = "ctime" IAMModifiedTimeKey = "mtime" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func New ¶
func New(ra actor.RPCActor, acc *wallet.Account, contract util.Uint160, opt Options) (*Client, error)
New creates a new Client. Options can be empty.
func NewSimple ¶
NewSimple creates a new Client using existing actor.Actor and default waiter options.
func (Client) AddSubjectKey ¶
func (c Client) AddSubjectKey(addr util.Uint160, key *keys.PublicKey) (tx util.Uint256, vub uint32, err error)
AddSubjectKey adds extra public key to subject. Must be invoked by contract owner.
func (Client) AddSubjectKeyCall ¶
func (c Client) AddSubjectKeyCall(addr util.Uint160, key *keys.PublicKey) (method string, args []any)
AddSubjectKeyCall provides args for AddSubjectKey to use in commonclient.Transaction.
func (Client) AddSubjectToGroup ¶
func (c Client) AddSubjectToGroup(addr util.Uint160, groupID int64) (tx util.Uint256, vub uint32, err error)
AddSubjectToGroup adds a new subject to group. Must be invoked by contract owner.
func (Client) AddSubjectToGroupCall ¶
AddSubjectToGroupCall provides args for AddSubjectToGroup to use in commonclient.Transaction.
func (Client) ClearAdmin ¶
ClearAdmin removes address that can perform write operations on contract. Must be invoked by committee.
func (Client) ClearAdminCall ¶
ClearAdminCall provides args for ClearAdmin to use in commonclient.Transaction.
func (Client) CreateGroup ¶
CreateGroup creates a new group in specific namespace. Must be invoked by contract owner.
func (Client) CreateGroupCall ¶
CreateGroupCall provides args for CreateGroup to use in commonclient.Transaction.
func (Client) CreateNamespace ¶
CreateNamespace create new namespace. Must be invoked by contract owner.
func (Client) CreateNamespaceCall ¶
CreateNamespaceCall provides args for CreateNamespace to use in commonclient.Transaction.
func (Client) CreateSubject ¶
func (c Client) CreateSubject(ns string, key *keys.PublicKey) (tx util.Uint256, vub uint32, err error)
CreateSubject creates new subject using public key and namespace. Must be invoked by contract owner.
func (Client) CreateSubjectCall ¶
CreateSubjectCall provides args for CreateSubject to use in commonclient.Transaction.
func (Client) DeleteGroup ¶
func (c Client) DeleteGroup(namespace string, groupID int64) (tx util.Uint256, vub uint32, err error)
DeleteGroup deletes group. Must be invoked by contract owner.
func (Client) DeleteGroupCall ¶
DeleteGroupCall provides args for DeleteGroup to use in commonclient.Transaction.
func (Client) DeleteGroupKV ¶
func (c Client) DeleteGroupKV(namespace string, groupID int64, key string) (tx util.Uint256, vub uint32, err error)
DeleteGroupKV removes group kv map. Must be invoked by contract owner.
func (Client) DeleteGroupKVCall ¶
func (c Client) DeleteGroupKVCall(namespace string, groupID int64, key string) (method string, args []any)
DeleteGroupKVCall provides args for DeleteGroupKV to use in commonclient.Transaction.
func (Client) DeleteSubject ¶
DeleteSubject delete subject and removes it from related namespaces and groups. Must be invoked by contract owner.
func (Client) DeleteSubjectCall ¶
DeleteSubjectCall provides args for DeleteSubject to use in commonclient.Transaction.
func (Client) DeleteSubjectKV ¶
func (c Client) DeleteSubjectKV(addr util.Uint160, key string) (tx util.Uint256, vub uint32, err error)
DeleteSubjectKV removes subject kv map. Must be invoked by contract owner.
func (Client) DeleteSubjectKVCall ¶
DeleteSubjectKVCall provides args for DeleteSubjectKV to use in commonclient.Transaction.
func (Client) GetAdmin ¶
GetAdmin returns address that can perform write operations on contract. Second return values is true iff admin is set.
func (Client) GetGroupByName ¶
GetGroupByName gets group by its name (namespace scope).
func (Client) GetGroupExtended ¶
func (c Client) GetGroupExtended(namespace string, groupID int64) (*GroupExtended, error)
GetGroupExtended gets extended group.
func (Client) GetGroupIDByName ¶
GetGroupIDByName gets group id its name (namespace scope).
func (Client) GetNamespace ¶
GetNamespace gets namespace.
func (Client) GetNamespaceExtended ¶
func (c Client) GetNamespaceExtended(namespace string) (*NamespaceExtended, error)
GetNamespaceExtended gets extended namespace.
func (Client) GetSubject ¶
GetSubject gets subject by address.
func (Client) GetSubjectByKey ¶
GetSubjectByKey gets subject by its primary or additional keys.
func (Client) GetSubjectByName ¶
GetSubjectByName gets subject by its name (namespace scope).
func (Client) GetSubjectExtended ¶
func (c Client) GetSubjectExtended(addr util.Uint160) (*SubjectExtended, error)
GetSubjectExtended gets extended subject by address.
func (Client) GetSubjectKV ¶ added in v0.21.0
GetSubjectKV invokes `getSubjectKV` method of contract.
func (Client) GetSubjectKeyByName ¶
GetSubjectKeyByName gets subject public key by its name (namespace scope).
func (Client) ListFullSubjects ¶ added in v0.20.0
ListFullSubjects gets list of subjects.
func (Client) ListGroupSubjects ¶
ListGroupSubjects gets all subjects in specific group.
func (Client) ListGroups ¶
ListGroups gets all groups in specific namespace.
func (Client) ListNamespaceSubjects ¶
ListNamespaceSubjects gets all subjects from namespace.
func (Client) ListNamespaces ¶
ListNamespaces gets all namespaces.
func (Client) ListNonEmptyGroups ¶
ListNonEmptyGroups gets groups that contain at least one subject.
func (Client) ListNonEmptyNamespaces ¶
ListNonEmptyNamespaces gets namespaces that contain at least one subject.
func (Client) ListSubjects ¶
ListSubjects gets all subjects.
func (Client) ParseGroupID ¶
ParseGroupID fetch groupID from stack after creating group method invocation.
func (Client) RemoveSubjectFromGroup ¶
func (c Client) RemoveSubjectFromGroup(addr util.Uint160, groupID int64) (tx util.Uint256, vub uint32, err error)
RemoveSubjectFromGroup removes subject from group. Must be invoked by contract owner.
func (Client) RemoveSubjectFromGroupCall ¶
func (c Client) RemoveSubjectFromGroupCall(addr util.Uint160, groupID int64) (method string, args []any)
RemoveSubjectFromGroupCall provides args for RemoveSubjectFromGroup to use in commonclient.Transaction.
func (Client) RemoveSubjectKey ¶
func (c Client) RemoveSubjectKey(addr util.Uint160, key *keys.PublicKey) (tx util.Uint256, vub uint32, err error)
RemoveSubjectKey removes extra public key from subject. Must be invoked by contract owner.
func (Client) RemoveSubjectKeyCall ¶
func (c Client) RemoveSubjectKeyCall(addr util.Uint160, key *keys.PublicKey) (method string, args []any)
RemoveSubjectKeyCall provides args for RemoveSubjectKey to use in commonclient.Transaction.
func (Client) SendTx ¶
func (c Client) SendTx(txn *commonclient.Transaction) (tx util.Uint256, vub uint32, err error)
SendTx sends provided transaction to blockchain.
func (Client) SetAdmin ¶
SetAdmin sets address that can perform write operations on contract. Must be invoked by committee.
func (Client) SetAdminCall ¶
SetAdminCall provides args for SetAdmin to use in commonclient.Transaction.
func (Client) SetGroupKV ¶
func (c Client) SetGroupKV(namespace string, groupID int64, key, val string) (tx util.Uint256, vub uint32, err error)
SetGroupKV updates group kv map. Must be invoked by contract owner. You can use some predefined key constants: IAMPathKey, IAMARNKey, IAMCreatedTimeKey, IAMModifiedTimeKey.
func (Client) SetGroupKVCall ¶
func (c Client) SetGroupKVCall(namespace string, groupID int64, key, val string) (method string, args []any)
SetGroupKVCall provides args for SetGroupKV to use in commonclient.Transaction.
func (Client) SetGroupName ¶
func (c Client) SetGroupName(namespace string, groupID int64, name string) (tx util.Uint256, vub uint32, err error)
SetGroupName updates subject name. Must be invoked by contract owner.
func (Client) SetGroupNameCall ¶
func (c Client) SetGroupNameCall(namespace string, groupID int64, name string) (method string, args []any)
SetGroupNameCall provides args for SetGroupName to use in commonclient.Transaction.
func (Client) SetSubjectKV ¶
func (c Client) SetSubjectKV(addr util.Uint160, key, val string) (tx util.Uint256, vub uint32, err error)
SetSubjectKV updates subject kv map. Must be invoked by contract owner. You can use some predefined key constants: IAMPathKey, IAMARNKey, IAMCreatedTimeKey, IAMModifiedTimeKey.
func (Client) SetSubjectKVCall ¶
SetSubjectKVCall provides args for SetSubjectKV to use in commonclient.Transaction.
func (Client) SetSubjectName ¶
func (c Client) SetSubjectName(addr util.Uint160, name string) (tx util.Uint256, vub uint32, err error)
SetSubjectName updates subject name. Must be invoked by contract owner.
func (Client) SetSubjectNameCall ¶
SetSubjectNameCall provides args for SetSubjectName to use in commonclient.Transaction.
func (Client) StartTx ¶
func (c Client) StartTx() *commonclient.Transaction
StartTx inits transaction.
type GroupExtended ¶
type GroupExtended struct { ID int64 Name string Namespace string KV map[string]string SubjectsCount int64 }
func ParseGroupExtended ¶ added in v0.20.0
func ParseGroupExtended(structArr []stackitem.Item) (*GroupExtended, error)
type NamespaceExtended ¶
func ParseNamespaceExtended ¶ added in v0.20.0
func ParseNamespaceExtended(structArr []stackitem.Item) (*NamespaceExtended, error)
type Options ¶
type Options struct { ProxyContract util.Uint160 Waiter commonclient.WaiterOptions }
type Subject ¶
type SubjectExtended ¶
type SubjectExtended struct { PrimaryKey *keys.PublicKey AdditionalKeys keys.PublicKeys Namespace string Name string KV map[string]string Groups []*Group }
func ParseSubjectExtended ¶ added in v0.20.0
func ParseSubjectExtended(structArr []stackitem.Item) (*SubjectExtended, error)