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