HSG & MHSG Handlers
Last updated
Last updated
The following section describes a different way of interacting with HSG and MHSG instances, than documented in the previous sections. In particular, in the previous sections, for each operation on the and contracts, there's a matching function in the SDK.
In addition to these individual functions, the SDK also includes a single handler for calling the write operations of both HSG and MHSG instances. This enables HSG/MHSG interactions to be optionally handled in a similar way to , by working with the HSG and MHSG and the single write functions .
Call a HSG/MHSG instance's write function.
Arguments:
account
- Viem account (Address for JSON-RPC accounts or Account for other types).
type
- 'HSG' or 'MHSG'.
instance
- The MHSG/HSG instance address.
Response:
status
- "success" if transaction was successful, "reverted" if transaction reverted.
transactionHash
- transaction's hash.
Get a HSG or MHSG instance live parameters:
Safe address
Min threshold
Target threshold
Max signers
Owner Hat
Arguments:
instance
- Instance's address.
Response:
An array of objects, each containing a parameter's information:
label
- The parameter's name/description.
value
- The parameter's value, as was returned from the instance contract.
solidityType
- The parameter's Solidity type.
displayType
- The parameter's display type. Its purpose is for UIs to be able to render an appropriate component for the parameter
Get the metadata object of HSG or MHSG.
Arguments:
"HSG" or "MHSG"
Response:
Represents a HSG or MHSG metadata object.
A custom HSG/MHSG role. Each role is associated with a hat and grants permissions to the hat's wearer(s) to call certain functions on the contract.
There are two special roles with a reserved ID:
public
role, associated with functions that are permitted to any caller.
hatAdmins
role, associated with functions that are permitted to the target hat's admins.
The HSG/MHSG write functions. Each write function is associated with a role that grants permissions to the role's wearer(s) to call the function on the contract.
HSG/MHSG write function argument.
func
- The write function to call, provided as an object of type .
args
- The arguments with which to call the function, as objects of type .
Both the HSG and MHSG metadata objects include their ABIs, all their together with the metadata of each function and the that are associated with them.
An object of type .