Type alias SolCerberusTypes
SolCerberusTypes: {
accounts: [{
name: "app";
type: {
fields: [{
name: "id";
type: "publicKey";
}, {
name: "authority";
type: "publicKey";
}, {
name: "recovery";
type: {
option: "publicKey";
};
}, {
name: "bump";
type: "u8";
}, {
name: "name";
type: "string";
}, {
name: "rolesUpdatedAt";
type: "i64";
}, {
name: "rulesUpdatedAt";
type: "i64";
}, {
name: "cached";
type: "bool";
}, {
name: "fee";
type: {
option: "u64";
};
}, {
name: "accountType";
type: "u8";
}, {
name: "expiresAt";
type: {
option: "i64";
};
}];
kind: "struct";
};
}, {
name: "seed";
type: {
fields: [{
name: "initialized";
type: "bool";
}];
kind: "struct";
};
}, {
name: "role";
type: {
fields: [{
name: "appId";
type: "publicKey";
}, {
name: "address";
type: {
option: "publicKey";
};
}, {
name: "role";
type: "string";
}, {
name: "addressType";
type: {
defined: "AddressType";
};
}, {
name: "expiresAt";
type: {
option: "i64";
};
}, {
name: "bump";
type: "u8";
}];
kind: "struct";
};
}, {
name: "rule";
type: {
fields: [{
name: "appId";
type: "publicKey";
}, {
name: "namespace";
type: "u8";
}, {
name: "role";
type: "string";
}, {
name: "resource";
type: "string";
}, {
name: "permission";
type: "string";
}, {
name: "expiresAt";
type: {
option: "i64";
};
}, {
name: "bump";
type: "u8";
}];
kind: "struct";
};
}];
errors: [{
code: 6000;
msg: "Only current Authority or Recovery accounts can update the App authority";
name: "UnauthorizedAuthorityUpdate";
}, {
code: 6001;
msg: "Role, Resource or Permission must be betwen 1 and 16 alphanumeric characters long";
name: "InvalidRule";
}, {
code: 6002;
msg: "Role must be between 1 and 16 alphanumeric characters long";
name: "InvalidRole";
}, {
code: 6003;
msg: "The provided string is too short";
name: "StringTooShort";
}, {
code: 6004;
msg: "The provided string is too long";
name: "StringTooLong";
}, {
code: 6005;
msg: "The user does not have enough privileges to perform this action";
name: "Unauthorized";
}, {
code: 6006;
msg: "The Sol Cerberus APP ID does not match the one defined in the program";
name: "InvalidAppID";
}, {
code: 6007;
msg: "Invalid address type, mus be either 'Wallet', 'Nft', 'Collection' or a wildcard '*'";
name: "InvalidAddressType";
}, {
code: 6008;
msg: "Invalid namespace, must be either an u8 number (0-255) or a wildcard '*'";
name: "InvalidNamespace";
}, {
code: 6009;
msg: "SOL_CERBERUS_APP_ID is missing on lib.rs";
name: "MissingSolCerberusAppId";
}, {
code: 6010;
msg: "The Sol Cerberus Seed account is missing";
name: "MissingSeedAccount";
}, {
code: 6011;
msg: "Only program authority can perform this action";
name: "UnauthorizedProgramAuthority";
}, {
code: 6012;
msg: "Insufficient funds for transaction";
name: "InsufficientFunds";
}];
events: [{
fields: [{
index: false;
name: "time";
type: "i64";
}, {
index: true;
name: "appId";
type: "publicKey";
}, {
index: false;
name: "authority";
type: "publicKey";
}];
name: "AppChanged";
}, {
fields: [{
index: false;
name: "time";
type: "i64";
}, {
index: true;
name: "appId";
type: "publicKey";
}];
name: "RolesChanged";
}, {
fields: [{
index: false;
name: "time";
type: "i64";
}, {
index: true;
name: "appId";
type: "publicKey";
}];
name: "RulesChanged";
}];
instructions: [{
accounts: [{
isMut: true;
isSigner: true;
name: "authority";
}, {
isMut: true;
isSigner: false;
name: "app";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
kind: "arg";
path: "app_data.id";
type: {
defined: "AppData";
};
}];
};
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "appData";
type: {
defined: "AppData";
};
}];
name: "initializeApp";
}, {
accounts: [{
isMut: false;
isSigner: true;
name: "signer";
}, {
isMut: true;
isSigner: false;
name: "app";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "appData";
type: {
defined: "UpdateAppData";
};
}];
name: "updateApp";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "authority";
}, {
isMut: true;
isSigner: false;
name: "app";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "app.id";
type: "publicKey";
}];
};
}, {
isMut: true;
isSigner: false;
name: "collector";
}];
args: [];
name: "deleteApp";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "signer";
}, {
isMut: true;
isSigner: false;
name: "rule";
pda: {
seeds: [{
kind: "arg";
path: "rule_data.namespace";
type: {
defined: "RuleData";
};
}, {
kind: "arg";
path: "rule_data.role";
type: {
defined: "RuleData";
};
}, {
kind: "arg";
path: "rule_data.resource";
type: {
defined: "RuleData";
};
}, {
kind: "arg";
path: "rule_data.permission";
type: {
defined: "RuleData";
};
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "solCerberusApp";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRole";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule2";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusToken";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusMetadata";
}, {
isMut: true;
isOptional: true;
isSigner: false;
name: "solCerberusSeed";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "seed";
}, {
kind: "account";
path: "signer";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "ruleData";
type: {
defined: "RuleData";
};
}];
name: "addRule";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "signer";
}, {
isMut: true;
isSigner: false;
name: "rule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "rule.permission";
type: "string";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "solCerberusApp";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRole";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule2";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusToken";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusMetadata";
}, {
isMut: true;
isOptional: true;
isSigner: false;
name: "solCerberusSeed";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "seed";
}, {
kind: "account";
path: "signer";
type: "publicKey";
}];
};
}, {
isMut: true;
isSigner: false;
name: "collector";
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [];
name: "deleteRule";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "signer";
}, {
isMut: true;
isSigner: false;
name: "role";
}, {
isMut: false;
isSigner: false;
name: "solCerberusApp";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRole";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusToken";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusMetadata";
}, {
isMut: true;
isOptional: true;
isSigner: false;
name: "solCerberusSeed";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "seed";
}, {
kind: "account";
path: "signer";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "assignRoleData";
type: {
defined: "AssignRoleData";
};
}];
name: "assignRole";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "signer";
}, {
isMut: true;
isSigner: false;
name: "role";
}, {
isMut: false;
isSigner: false;
name: "solCerberusApp";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRole";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusToken";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusMetadata";
}, {
isMut: true;
isOptional: true;
isSigner: false;
name: "solCerberusSeed";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "seed";
}, {
kind: "account";
path: "signer";
type: "publicKey";
}];
};
}, {
isMut: true;
isSigner: false;
name: "collector";
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [];
name: "deleteAssignedRole";
}, {
accounts: [{
isMut: false;
isSigner: true;
name: "authority";
}, {
isMut: true;
isSigner: false;
name: "app";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "app.id";
type: "publicKey";
}];
};
relations: ["authority"];
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "cacheUpdated";
type: "u8";
}];
docs: ["* Updates either app.roles_updated_at or app.rules_updated_at fields, so clients\n * can keep track and cache roles & rules accordingly."];
name: "updateCache";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "signer";
}, {
isMut: false;
isSigner: false;
name: "solCerberusApp";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRole";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusToken";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusMetadata";
}, {
isMut: true;
isOptional: true;
isSigner: false;
name: "solCerberusSeed";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "seed";
}, {
kind: "account";
path: "signer";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "allowedRule";
type: {
defined: "AllowedRule";
};
}];
docs: ["* Checks if the current user is authorized to run the instruction,\n * throwing \"Unauthorized\" error otherwise."];
name: "allowed";
}];
name: "sol_cerberus";
types: [{
name: "AllowedRule";
type: {
fields: [{
name: "appId";
type: "publicKey";
}, {
name: "namespace";
type: "u8";
}, {
name: "resource";
type: "string";
}, {
name: "permission";
type: "string";
}];
kind: "struct";
};
}, {
name: "AppData";
type: {
fields: [{
name: "id";
type: "publicKey";
}, {
name: "recovery";
type: {
option: "publicKey";
};
}, {
name: "name";
type: "string";
}, {
name: "cached";
type: "bool";
}];
kind: "struct";
};
}, {
name: "UpdateAppData";
type: {
fields: [{
name: "authority";
type: "publicKey";
}, {
name: "recovery";
type: {
option: "publicKey";
};
}, {
name: "name";
type: "string";
}, {
name: "cached";
type: "bool";
}, {
name: "fee";
type: {
option: "u64";
};
}, {
name: "accountType";
type: "u8";
}, {
name: "expiresAt";
type: {
option: "i64";
};
}];
kind: "struct";
};
}, {
name: "AssignRoleData";
type: {
fields: [{
name: "address";
type: {
option: "publicKey";
};
}, {
name: "role";
type: "string";
}, {
name: "addressType";
type: {
defined: "AddressType";
};
}, {
name: "expiresAt";
type: {
option: "i64";
};
}];
kind: "struct";
};
}, {
name: "RuleData";
type: {
fields: [{
name: "namespace";
type: "u8";
}, {
name: "role";
type: "string";
}, {
name: "resource";
type: "string";
}, {
name: "permission";
type: "string";
}, {
name: "expiresAt";
type: {
option: "i64";
};
}];
kind: "struct";
};
}, {
docs: ["AccountTypes:", "0 => Basic (Apps with default fees)", "1 => Free (Apps with no fees)"];
name: "AccountTypes";
type: {
kind: "enum";
variants: [{
name: "Basic";
}, {
name: "Free";
}];
};
}, {
docs: ["CacheUpdated:", "0 => Roles (When roles change)", "1 => Rules (When rules change)"];
name: "CacheUpdated";
type: {
kind: "enum";
variants: [{
name: "Roles";
}, {
name: "Rules";
}];
};
}, {
name: "AddressType";
type: {
kind: "enum";
variants: [{
name: "Wallet";
}, {
name: "Nft";
}, {
name: "Collection";
}];
};
}, {
docs: ["Namespaces:", "0 => Rule (Normal permissions)", "1 => AssignRole (White list of roles that can be assigned by certain role)", "2 => DeleteAssignRole (White list of roles that can be deleted by certain role)", "3 => AddRuleNSRole (White list of namespaces and roles that can be created by certain role)", "4 => AddRuleResourcePerm (White list of resources and permissions that can be created by certain role)", "5 => DeleteRuleNSRole (White list of namespaces and roles that can be deleted by certain role)", "6 => DeleteRuleResourcePerm (White list of resources and permissions that can be deleted by certain role)"];
name: "Namespaces";
type: {
kind: "enum";
variants: [{
name: "Rule";
}, {
name: "AssignRole";
}, {
name: "DeleteAssignRole";
}, {
name: "AddRuleNSRole";
}, {
name: "AddRuleResourcePerm";
}, {
name: "DeleteRuleNSRole";
}, {
name: "DeleteRuleResourcePerm";
}];
};
}];
version: "0.1.12";
}
Type declaration
accounts: [{
name: "app";
type: {
fields: [{
name: "id";
type: "publicKey";
}, {
name: "authority";
type: "publicKey";
}, {
name: "recovery";
type: {
option: "publicKey";
};
}, {
name: "bump";
type: "u8";
}, {
name: "name";
type: "string";
}, {
name: "rolesUpdatedAt";
type: "i64";
}, {
name: "rulesUpdatedAt";
type: "i64";
}, {
name: "cached";
type: "bool";
}, {
name: "fee";
type: {
option: "u64";
};
}, {
name: "accountType";
type: "u8";
}, {
name: "expiresAt";
type: {
option: "i64";
};
}];
kind: "struct";
};
}, {
name: "seed";
type: {
fields: [{
name: "initialized";
type: "bool";
}];
kind: "struct";
};
}, {
name: "role";
type: {
fields: [{
name: "appId";
type: "publicKey";
}, {
name: "address";
type: {
option: "publicKey";
};
}, {
name: "role";
type: "string";
}, {
name: "addressType";
type: {
defined: "AddressType";
};
}, {
name: "expiresAt";
type: {
option: "i64";
};
}, {
name: "bump";
type: "u8";
}];
kind: "struct";
};
}, {
name: "rule";
type: {
fields: [{
name: "appId";
type: "publicKey";
}, {
name: "namespace";
type: "u8";
}, {
name: "role";
type: "string";
}, {
name: "resource";
type: "string";
}, {
name: "permission";
type: "string";
}, {
name: "expiresAt";
type: {
option: "i64";
};
}, {
name: "bump";
type: "u8";
}];
kind: "struct";
};
}]
errors: [{
code: 6000;
msg: "Only current Authority or Recovery accounts can update the App authority";
name: "UnauthorizedAuthorityUpdate";
}, {
code: 6001;
msg: "Role, Resource or Permission must be betwen 1 and 16 alphanumeric characters long";
name: "InvalidRule";
}, {
code: 6002;
msg: "Role must be between 1 and 16 alphanumeric characters long";
name: "InvalidRole";
}, {
code: 6003;
msg: "The provided string is too short";
name: "StringTooShort";
}, {
code: 6004;
msg: "The provided string is too long";
name: "StringTooLong";
}, {
code: 6005;
msg: "The user does not have enough privileges to perform this action";
name: "Unauthorized";
}, {
code: 6006;
msg: "The Sol Cerberus APP ID does not match the one defined in the program";
name: "InvalidAppID";
}, {
code: 6007;
msg: "Invalid address type, mus be either 'Wallet', 'Nft', 'Collection' or a wildcard '*'";
name: "InvalidAddressType";
}, {
code: 6008;
msg: "Invalid namespace, must be either an u8 number (0-255) or a wildcard '*'";
name: "InvalidNamespace";
}, {
code: 6009;
msg: "SOL_CERBERUS_APP_ID is missing on lib.rs";
name: "MissingSolCerberusAppId";
}, {
code: 6010;
msg: "The Sol Cerberus Seed account is missing";
name: "MissingSeedAccount";
}, {
code: 6011;
msg: "Only program authority can perform this action";
name: "UnauthorizedProgramAuthority";
}, {
code: 6012;
msg: "Insufficient funds for transaction";
name: "InsufficientFunds";
}]
events: [{
fields: [{
index: false;
name: "time";
type: "i64";
}, {
index: true;
name: "appId";
type: "publicKey";
}, {
index: false;
name: "authority";
type: "publicKey";
}];
name: "AppChanged";
}, {
fields: [{
index: false;
name: "time";
type: "i64";
}, {
index: true;
name: "appId";
type: "publicKey";
}];
name: "RolesChanged";
}, {
fields: [{
index: false;
name: "time";
type: "i64";
}, {
index: true;
name: "appId";
type: "publicKey";
}];
name: "RulesChanged";
}]
instructions: [{
accounts: [{
isMut: true;
isSigner: true;
name: "authority";
}, {
isMut: true;
isSigner: false;
name: "app";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
kind: "arg";
path: "app_data.id";
type: {
defined: "AppData";
};
}];
};
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "appData";
type: {
defined: "AppData";
};
}];
name: "initializeApp";
}, {
accounts: [{
isMut: false;
isSigner: true;
name: "signer";
}, {
isMut: true;
isSigner: false;
name: "app";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "appData";
type: {
defined: "UpdateAppData";
};
}];
name: "updateApp";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "authority";
}, {
isMut: true;
isSigner: false;
name: "app";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "app.id";
type: "publicKey";
}];
};
}, {
isMut: true;
isSigner: false;
name: "collector";
}];
args: [];
name: "deleteApp";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "signer";
}, {
isMut: true;
isSigner: false;
name: "rule";
pda: {
seeds: [{
kind: "arg";
path: "rule_data.namespace";
type: {
defined: "RuleData";
};
}, {
kind: "arg";
path: "rule_data.role";
type: {
defined: "RuleData";
};
}, {
kind: "arg";
path: "rule_data.resource";
type: {
defined: "RuleData";
};
}, {
kind: "arg";
path: "rule_data.permission";
type: {
defined: "RuleData";
};
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "solCerberusApp";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRole";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule2";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusToken";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusMetadata";
}, {
isMut: true;
isOptional: true;
isSigner: false;
name: "solCerberusSeed";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "seed";
}, {
kind: "account";
path: "signer";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "ruleData";
type: {
defined: "RuleData";
};
}];
name: "addRule";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "signer";
}, {
isMut: true;
isSigner: false;
name: "rule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "rule.permission";
type: "string";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "solCerberusApp";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRole";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule2";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule2.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusToken";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusMetadata";
}, {
isMut: true;
isOptional: true;
isSigner: false;
name: "solCerberusSeed";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "seed";
}, {
kind: "account";
path: "signer";
type: "publicKey";
}];
};
}, {
isMut: true;
isSigner: false;
name: "collector";
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [];
name: "deleteRule";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "signer";
}, {
isMut: true;
isSigner: false;
name: "role";
}, {
isMut: false;
isSigner: false;
name: "solCerberusApp";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRole";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusToken";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusMetadata";
}, {
isMut: true;
isOptional: true;
isSigner: false;
name: "solCerberusSeed";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "seed";
}, {
kind: "account";
path: "signer";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "assignRoleData";
type: {
defined: "AssignRoleData";
};
}];
name: "assignRole";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "signer";
}, {
isMut: true;
isSigner: false;
name: "role";
}, {
isMut: false;
isSigner: false;
name: "solCerberusApp";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRole";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusToken";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusMetadata";
}, {
isMut: true;
isOptional: true;
isSigner: false;
name: "solCerberusSeed";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "seed";
}, {
kind: "account";
path: "signer";
type: "publicKey";
}];
};
}, {
isMut: true;
isSigner: false;
name: "collector";
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [];
name: "deleteAssignedRole";
}, {
accounts: [{
isMut: false;
isSigner: true;
name: "authority";
}, {
isMut: true;
isSigner: false;
name: "app";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "app.id";
type: "publicKey";
}];
};
relations: ["authority"];
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "cacheUpdated";
type: "u8";
}];
docs: ["* Updates either app.roles_updated_at or app.rules_updated_at fields, so clients\n * can keep track and cache roles & rules accordingly."];
name: "updateCache";
}, {
accounts: [{
isMut: true;
isSigner: true;
name: "signer";
}, {
isMut: false;
isSigner: false;
name: "solCerberusApp";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "app";
}, {
account: "App";
kind: "account";
path: "sol_cerberus_app.id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRule";
pda: {
seeds: [{
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.namespace";
type: "u8";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.role";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.resource";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.permission";
type: "string";
}, {
account: "Rule";
kind: "account";
path: "sol_cerberus_rule.app_id";
type: "publicKey";
}];
};
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusRole";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusToken";
}, {
isMut: false;
isOptional: true;
isSigner: false;
name: "solCerberusMetadata";
}, {
isMut: true;
isOptional: true;
isSigner: false;
name: "solCerberusSeed";
pda: {
seeds: [{
kind: "const";
type: "string";
value: "seed";
}, {
kind: "account";
path: "signer";
type: "publicKey";
}];
};
}, {
isMut: false;
isSigner: false;
name: "systemProgram";
}];
args: [{
name: "allowedRule";
type: {
defined: "AllowedRule";
};
}];
docs: ["* Checks if the current user is authorized to run the instruction,\n * throwing \"Unauthorized\" error otherwise."];
name: "allowed";
}]
name: "sol_cerberus"
types: [{
name: "AllowedRule";
type: {
fields: [{
name: "appId";
type: "publicKey";
}, {
name: "namespace";
type: "u8";
}, {
name: "resource";
type: "string";
}, {
name: "permission";
type: "string";
}];
kind: "struct";
};
}, {
name: "AppData";
type: {
fields: [{
name: "id";
type: "publicKey";
}, {
name: "recovery";
type: {
option: "publicKey";
};
}, {
name: "name";
type: "string";
}, {
name: "cached";
type: "bool";
}];
kind: "struct";
};
}, {
name: "UpdateAppData";
type: {
fields: [{
name: "authority";
type: "publicKey";
}, {
name: "recovery";
type: {
option: "publicKey";
};
}, {
name: "name";
type: "string";
}, {
name: "cached";
type: "bool";
}, {
name: "fee";
type: {
option: "u64";
};
}, {
name: "accountType";
type: "u8";
}, {
name: "expiresAt";
type: {
option: "i64";
};
}];
kind: "struct";
};
}, {
name: "AssignRoleData";
type: {
fields: [{
name: "address";
type: {
option: "publicKey";
};
}, {
name: "role";
type: "string";
}, {
name: "addressType";
type: {
defined: "AddressType";
};
}, {
name: "expiresAt";
type: {
option: "i64";
};
}];
kind: "struct";
};
}, {
name: "RuleData";
type: {
fields: [{
name: "namespace";
type: "u8";
}, {
name: "role";
type: "string";
}, {
name: "resource";
type: "string";
}, {
name: "permission";
type: "string";
}, {
name: "expiresAt";
type: {
option: "i64";
};
}];
kind: "struct";
};
}, {
docs: ["AccountTypes:", "0 => Basic (Apps with default fees)", "1 => Free (Apps with no fees)"];
name: "AccountTypes";
type: {
kind: "enum";
variants: [{
name: "Basic";
}, {
name: "Free";
}];
};
}, {
docs: ["CacheUpdated:", "0 => Roles (When roles change)", "1 => Rules (When rules change)"];
name: "CacheUpdated";
type: {
kind: "enum";
variants: [{
name: "Roles";
}, {
name: "Rules";
}];
};
}, {
name: "AddressType";
type: {
kind: "enum";
variants: [{
name: "Wallet";
}, {
name: "Nft";
}, {
name: "Collection";
}];
};
}, {
docs: ["Namespaces:", "0 => Rule (Normal permissions)", "1 => AssignRole (White list of roles that can be assigned by certain role)", "2 => DeleteAssignRole (White list of roles that can be deleted by certain role)", "3 => AddRuleNSRole (White list of namespaces and roles that can be created by certain role)", "4 => AddRuleResourcePerm (White list of resources and permissions that can be created by certain role)", "5 => DeleteRuleNSRole (White list of namespaces and roles that can be deleted by certain role)", "6 => DeleteRuleResourcePerm (White list of resources and permissions that can be deleted by certain role)"];
name: "Namespaces";
type: {
kind: "enum";
variants: [{
name: "Rule";
}, {
name: "AssignRole";
}, {
name: "DeleteAssignRole";
}, {
name: "AddRuleNSRole";
}, {
name: "AddRuleResourcePerm";
}, {
name: "DeleteRuleNSRole";
}, {
name: "DeleteRuleResourcePerm";
}];
};
}]
version: "0.1.12"