Ownable Executor
The Ownable Executor module is a module that allows users to designate an owner that can execute transactions on their behalf and pays for gas.
You can find the source code for the module in the Core Modules repo (opens in a new tab) and the deployment address in the address book.
getInstallOwnableExecuter
The getInstallOwnableExecuter
function is used to create an instance of the Ownable Executor module. This function returns a module object.
import { getInstallOwnableExecuter } from "@rhinestone/module-sdk";
const ownableExecutor = getInstallOwnableExecuter({
owner: '0x..',
});
getAddOwnableExecutorOwnerAction
The getAddOwnableExecutorOwnerAction
function is used to add an owner to the executor. This function returns an execution object
import { getAddOwnableExecutorOwnerAction } from "@rhinestone/module-sdk";
const owner = "0x...";
const addOwnableExecutorOwnerAction = getAddOwnableExecutorOwnerAction({
owner,
});
getRemoveOwnableExecutorOwnerAction
The getRemoveOwnableExecutorOwnerAction
function is used to remove an owner from the executor. This function returns an execution object
import { getRemoveOwnableExecutorOwnerAction } from "@rhinestone/module-sdk";
const removeOwnableExecutorOwnerAction = await getRemoveOwnableExecutorOwnerAction(
{
client,
account,
owner,
}
);
getOwnableExecutorOwners
The getOwnableExecutorOwners
function is used to return ownable executor owners. This function returns an array of owners addresses.
import { getOwnableExecutorOwners } from "@rhinestone/module-sdk";
const params = {
account,
client,
};
const ownableValidatorOwners = await getOwnableExecutorOwners(params);
getExecuteOnOwnedAccountAction
The getExecuteOnOwnedAccountAction
function is used to execute action on owned account.
import { getExecuteOnOwnedAccountAction } from "@rhinestone/module-sdk";
const params = {
ownedAccount: '0x...',
execution: {
target: '0x...', // address
value: 0n,
callData: '0x...', // hex string
},
};
const executeOnOwnedAccountAction = getExecuteOnOwnedAccountAction(params);
getExecuteBatchOnOwnedAccountAction
The getExecuteBatchOnOwnedAccountAction
function is used to execute batch of actions on owned account.
import { getExecuteBatchOnOwnedAccountAction } from "@rhinestone/module-sdk";
const params = {
ownedAccount: '0x...',
executions: [{
target: '0x...', // address
value: 0n,
callData: '0x...', // hex string
}],
};
const executeOnOwnedAccountActions = getExecuteBatchOnOwnedAccountAction(params);
OWNABLE_EXECUTER_ADDRESS
The OWNABLE_EXECUTER_ADDRESS
is a constant that represents the module address.