Skip to content

UniFFI Namespace Hierarchy #723

@arminsabouri

Description

@arminsabouri

Currently all of our UniFFI exported types live in one big module/library (not sure what the coloquial python term for this is). All of these classes, functions, etc... are then exported under one namespace (payjoin). Its unclear what exported types belongs to what part of the rust-payjoin api. For example when you from payjoin import UncheckedProposal its unclear if this is a receiver or sender type.

An easy fix would be to re-export specific types as submodules.
I.e
init.py

from payjoin.payjoin_ffi import *

# Re-export specific types into submodules
from . import receiver

__all__ = ['receiver']

receiver.py

from payjoin.payjoin_ffi import UncheckedProposal

__all__ = [UncheckedProposal]

From the application prespective:

from payjoin.receiver import UncheckedProposal

Metadata

Metadata

Assignees

No one assigned

    Labels

    ffigood first issueDoes NOT mean "an LLM can do this." Please discuss the constraints and intended approach.wontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions