pysui.sui.sui_pgql.config package
Submodules
pysui.sui.sui_pgql.config.confgroup module
Sui Configuration Group.
- class pysui.sui.sui_pgql.config.confgroup.ProfileAlias(alias: str, public_key_base64: str)
Bases:
DataClassJsonMixinHolds alias for base64 public key.
- alias: str
- public_key_base64: str
- __init__(alias: str, public_key_base64: str) None
- class pysui.sui.sui_pgql.config.confgroup.ProfileKey(private_key_base64: str)
Bases:
DataClassJsonMixinHolds private key base64 string.
- private_key_base64: str
- __init__(private_key_base64: str) None
- class pysui.sui.sui_pgql.config.confgroup.Profile(profile_name: str, url: str, faucet_url: str | None = None, faucet_status_url: str | None = None)
Bases:
DataClassJsonMixinUnique connection profile.
- profile_name: str
- url: str
- faucet_url: str | None = None
- faucet_status_url: str | None = None
- __init__(profile_name: str, url: str, faucet_url: str | None = None, faucet_status_url: str | None = None) None
- class pysui.sui.sui_pgql.config.confgroup.ProfileGroup(group_name: str, using_profile: str, using_address: str, alias_list: list[~pysui.sui.sui_pgql.config.confgroup.ProfileAlias], key_list: list[~pysui.sui.sui_pgql.config.confgroup.ProfileKey], address_list: list[str] | None = <factory>, profiles: list[~pysui.sui.sui_pgql.config.confgroup.Profile] | None = <factory>)
Bases:
DataClassJsonMixinRepresents a group of profile.
- group_name: str
- using_profile: str
- using_address: str
- alias_list: list[ProfileAlias]
- key_list: list[ProfileKey]
- address_list: list[str] | None
- property active_address: str
Return the active address.
- property active_alias: str
Return the alias associated to the using (active) address.
- address_for_alias(*, alias: str) str
Get address associated with alias.
- alias_for_address(*, address: str) ProfileAlias
Get alias associated with address.
- alias_name_for_address(*, address: str) str
Get alias associated with address.
- replace_alias_name(*, from_alias: str, to_alias: str) str
Replace alias name and return associated address.
- address_keypair(*, address: str) SuiKeyPair
Fetch an addresses KeyPair.
- __init__(group_name: str, using_profile: str, using_address: str, alias_list: list[~pysui.sui.sui_pgql.config.confgroup.ProfileAlias], key_list: list[~pysui.sui.sui_pgql.config.confgroup.ProfileKey], address_list: list[str] | None = <factory>, profiles: list[~pysui.sui.sui_pgql.config.confgroup.Profile] | None = <factory>) None
- static new_keypair_parts(*, of_keytype: SignatureScheme | None = SignatureScheme.ED25519, word_counts: int | None = 12, derivation_path: str | None = None, alias: str | None = None, alias_list: list[ProfileAlias]) tuple[str, str, ProfileKey, ProfileAlias]
.
- add_keypair_and_parts(*, new_address: str, new_alias: ProfileAlias, new_key: ProfileKey, make_active: bool | None = False) str
Add a new keypair with associated address and alias.
pysui.sui.sui_pgql.config.conflegacy module
Sui Legacy Configuration (JSON RPC) setup.
- class pysui.sui.sui_pgql.config.conflegacy.KeystoreFile(File: str)
Bases:
objectSui default config points to keyfile.
- File: str
- __init__(File: str) None
- dataclass_json_config = {'letter_case': <function camelcase>}
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: str | int | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
- class pysui.sui.sui_pgql.config.conflegacy.ConfigEnv(alias: str, rpc: str, ws: str | None = None, basic_auth: str | None = None)
Bases:
objectSui default config environment.
- alias: str
- rpc: str
- ws: str | None = None
- basic_auth: str | None = None
- __init__(alias: str, rpc: str, ws: str | None = None, basic_auth: str | None = None) None
- dataclass_json_config = {'letter_case': <function camelcase>}
- classmethod from_dict(kvs: dict | list | str | int | float | bool | None, *, infer_missing=False) A
- classmethod from_json(s: str | bytes | bytearray, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw) A
- classmethod schema(*, infer_missing: bool = False, only=None, exclude=(), many: bool = False, context=None, load_only=(), dump_only=(), partial: bool = False, unknown=None) SchemaF[A]
- to_dict(encode_json=False) Dict[str, dict | list | str | int | float | bool | None]
- to_json(*, skipkeys: bool = False, ensure_ascii: bool = True, check_circular: bool = True, allow_nan: bool = True, indent: str | int | None = None, separators: Tuple[str, str] | None = None, default: Callable | None = None, sort_keys: bool = False, **kw) str
- class pysui.sui.sui_pgql.config.conflegacy.ConfigSui(keystore: KeystoreFile, active_env: str, active_address: str, envs: list[ConfigEnv])
Bases:
DataClassJsonMixinSui default config.
- keystore: KeystoreFile
- active_env: str
- active_address: str
- __init__(keystore: KeystoreFile, active_env: str, active_address: str, envs: list[ConfigEnv]) None
- pysui.sui.sui_pgql.config.conflegacy.address_and_alias_from_keystring(indata: str, calias: list[ProfileAlias]) tuple[str, ProfileAlias]
From a 44 char keypair string create an address string and return matched alias.
- pysui.sui.sui_pgql.config.conflegacy.load_client_yaml(client_file: Path, json_rpc_group: str) ProfileGroup
.
pysui.sui.sui_pgql.config.confmodel module
Sui Configuration Model.
- class pysui.sui.sui_pgql.config.confmodel.PysuiConfigModel(sui_binary: str | None = '', group_active: str | None = '', groups: list[~pysui.sui.sui_pgql.config.confgroup.ProfileGroup] | None = <factory>)
Bases:
DataClassJsonMixinpysui configuration in memory model.
- sui_binary: str | None = ''
- group_active: str | None = ''
- groups: list[ProfileGroup] | None
- has_group(*, group_name: str) bool
Test for group existence.
- remove_group(*, group_name: str) None
Remove a group from the group list.
- get_group(*, group_name: str) ProfileGroup
Get a group or throw exception if doesn’t exist.
- property active_group: ProfileGroup
Returns the active group.
- property active_address: str
Returns the active address from the active group.
- initialize_json_rpc(*, sui_config: Path, sui_binary: Path, json_rpc_group_name: str) bool
Initialize group from sui configuration client.yaml.
- initialize_gql_rpc(*, sui_binary: Path, gql_rpc_group_name: str, json_rpc_group_name: str) bool
Initialize GraphQL with defaults if not found.
- __init__(sui_binary: str | None = '', group_active: str | None = '', groups: list[~pysui.sui.sui_pgql.config.confgroup.ProfileGroup] | None = <factory>) None
- add_group(*, group: ProfileGroup, make_active: bool, overwrite: bool = False) bool
.
pysui.sui.sui_pgql.config.pysui_config module
Pysui Configuration.
- class pysui.sui.sui_pgql.config.pysui_config.PysuiConfiguration(*, from_cfg_path: str | None = None, group_name: str | None = 'sui_gql_config', profile_name: str | None = None, address: str | None = None, alias: str | None = None, persist: bool | None = False)
Bases:
objectpysui configuration class.
- SUI_JSON_RPC_GROUP: str = 'sui_json_config'
- SUI_GQL_RPC_GROUP: str = 'sui_gql_config'
- __init__(*, from_cfg_path: str | None = None, group_name: str | None = 'sui_gql_config', profile_name: str | None = None, address: str | None = None, alias: str | None = None, persist: bool | None = False)
Initialize configuration.
- to_json(*_cmds, **kwargs) str
.
- refresh_legacy(*, replace: bool = True)
Refresh from legacy Sui JSON RPC client yaml.
- property model: PysuiConfigModel
.
- property active_group: ProfileGroup
Return the active group.
- property active_address: str
Returns the active groups active address.
- property active_address_alias: str
Returns the active groups active address.
- property active_env: str
Returns the active groups active profile name.
- property url: str
Returns the active groups active profile url.
- property faucet_url: str
Returns the active groups active profile faucet url.
- property faucet_status_url: str
Returns the active groups active profile faucet status url.
- property config_path: str
Return configuration breadcrump path.
- address_for_alias(*, alias_name: str) str
Return the address for the alias name in current group.
- alias_for_address(*, address: str) str
Return the alias for the address in current group.
- rename_alias(*, existing_alias: str, new_alias: str, in_group: str | None = None, persist: bool | None = False) str
Rename an alias in a group, default to active_group.
- make_active(*, group_name: str | None = None, profile_name: str | None = None, address: str | None = None, alias: str | None = None, persist: bool | None = True)
Activate specific aspects of configuration.
- new_keypair(*, of_keytype: SignatureScheme, in_group: str | None = None, word_counts: int | None = 12, derivation_path: str | None = None, make_active: bool | None = False, alias: str | None = None, persist: bool | None = True) tuple[str, str]
Creates a new keypair returning generated passphrase and associated address.
Module contents
Pysui Sui GraphQL Configuration Package.