Solver
XinFin solver.
NormalSolver
- class swap.providers.xinfin.solver.NormalSolver(xprivate_key: str, account: int = 0, change: bool = False, address: int = 0, path: Optional[str] = None, strict: bool = True)
XinFin Normal solver.
- Parameters
xprivate_key (str) – XinFin sender xprivate key.
account (int) – XinFin derivation account, defaults to
0
.change (bool) – XinFin derivation change, defaults to
False
.address (int) – XinFin derivation address, defaults to
0
.path (str) – XinFin derivation path, defaults to
None
.strict (bool) – Strict for must be root xprivate key, default to
True
.
- Returns
NormalSolver – XinFin normal solver instance.
>>> from swap.providers.xinfin.solver import NormalSolver >>> sender_root_xprivate_key: str = "xprv9s21ZrQH143K3XihXQBN8Uar2WBtrjSzK2oRDEGQ25pA2kKAADoQXaiiVXht163ZTrdtTXfM4GqNRE9gWQHky25BpvBQuuhNCM3SKwWTPNJ" >>> normal_solver: NormalSolver = NormalSolver(xprivate_key=sender_root_xprivate_key) <swap.providers.xinfin.solver.FundSolver object at 0x03FCCA60>
FundSolver
- class swap.providers.xinfin.solver.FundSolver(xprivate_key: str, account: int = 0, change: bool = False, address: int = 0, path: Optional[str] = None, strict: bool = True)
XinFin Fund solver.
- Parameters
xprivate_key (str) – XinFin sender xprivate key.
account (int) – XinFin derivation account, defaults to
0
.change (bool) – XinFin derivation change, defaults to
False
.address (int) – XinFin derivation address, defaults to
0
.path (str) – XinFin derivation path, defaults to
None
.strict (bool) – Strict for must be root xprivate key, default to
True
.
- Returns
FundSolver – XinFin fund solver instance.
>>> from swap.providers.xinfin.solver import FundSolver >>> sender_root_xprivate_key: str = "xprv9s21ZrQH143K3XihXQBN8Uar2WBtrjSzK2oRDEGQ25pA2kKAADoQXaiiVXht163ZTrdtTXfM4GqNRE9gWQHky25BpvBQuuhNCM3SKwWTPNJ" >>> fund_solver: FundSolver = FundSolver(xprivate_key=sender_root_xprivate_key, path="m/44'/550'/0'/0/0") <swap.providers.xinfin.solver.FundSolver object at 0x03FCCA60>
WithdrawSolver
- class swap.providers.xinfin.solver.WithdrawSolver(xprivate_key: str, account: int = 0, change: bool = False, address: int = 0, path: Optional[str] = None, strict: bool = True)
XinFin Withdraw solver.
- Parameters
xprivate_key (str) – XinFin sender xprivate key.
account (int) – XinFin derivation account, defaults to
0
.change (bool) – XinFin derivation change, defaults to
False
.address (int) – XinFin derivation address, defaults to
0
.path (str) – XinFin derivation path, defaults to
None
.strict (bool) – Strict for must be root xprivate key, default to
True
.
- Returns
WithdrawSolver – XinFin withdraw solver instance.
>>> from swap.providers.xinfin.solver import WithdrawSolver >>> recipient_root_xprivate_key: str = "xprv9s21ZrQH143K3XihXQBN8Uar2WBtrjSzK2oRDEGQ25pA2kKAADoQXaiiVXht163ZTrdtTXfM4GqNRE9gWQHky25BpvBQuuhNCM3SKwWTPNJ" >>> withdraw_solver: WithdrawSolver = WithdrawSolver(xprivate_key=recipient_root_xprivate_key) <swap.providers.xinfin.solver.WithdrawSolver object at 0x03FCCA60>
RefundSolver
- class swap.providers.xinfin.solver.RefundSolver(xprivate_key: str, account: int = 0, change: bool = False, address: int = 0, path: Optional[str] = None, strict: bool = True)
XinFin Refund solver.
- Parameters
xprivate_key (str) – XinFin sender xprivate key.
account (int) – XinFin derivation account, defaults to
0
.change (bool) – XinFin derivation change, defaults to
False
.address (int) – XinFin derivation address, defaults to
0
.path (str) – XinFin derivation path, defaults to
None
.strict (bool) – Strict for must be root xprivate key, default to
True
.
- Returns
RefundSolver – XinFin refund solver instance.
>>> from swap.providers.xinfin.solver import RefundSolver >>> sender_root_xprivate_key: str = "xprv9s21ZrQH143K3XihXQBN8Uar2WBtrjSzK2oRDEGQ25pA2kKAADoQXaiiVXht163ZTrdtTXfM4GqNRE9gWQHky25BpvBQuuhNCM3SKwWTPNJ" >>> refund_solver: RefundSolver = RefundSolver(xprivate_key=sender_root_xprivate_key) <swap.providers.xinfin.solver.RefundSolver object at 0x03FCCA60>