refactor: Move all coin interfaces to a dir
This commit is contained in:
parent
80f0098a3d
commit
20c0c372d0
@ -27,12 +27,12 @@ import concurrent.futures
|
|||||||
from sqlalchemy.orm import sessionmaker, scoped_session
|
from sqlalchemy.orm import sessionmaker, scoped_session
|
||||||
from sqlalchemy.orm.session import close_all_sessions
|
from sqlalchemy.orm.session import close_all_sessions
|
||||||
|
|
||||||
from .interface_part import PARTInterface, PARTInterfaceAnon, PARTInterfaceBlind
|
from .interface.part import PARTInterface, PARTInterfaceAnon, PARTInterfaceBlind
|
||||||
from .interface_btc import BTCInterface
|
from .interface.btc import BTCInterface
|
||||||
from .interface_ltc import LTCInterface
|
from .interface.ltc import LTCInterface
|
||||||
from .interface_nmc import NMCInterface
|
from .interface.nmc import NMCInterface
|
||||||
from .interface_xmr import XMRInterface
|
from .interface.xmr import XMRInterface
|
||||||
from .interface_passthrough_btc import PassthroughBTCInterface
|
from .interface.passthrough_btc import PassthroughBTCInterface
|
||||||
|
|
||||||
from . import __version__
|
from . import __version__
|
||||||
from .rpc_xmr import make_xmr_rpc2_func
|
from .rpc_xmr import make_xmr_rpc2_func
|
||||||
|
0
basicswap/interface/__init__.py
Normal file
0
basicswap/interface/__init__.py
Normal file
@ -14,22 +14,22 @@ import traceback
|
|||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from basicswap.contrib.test_framework import segwit_addr
|
from basicswap.contrib.test_framework import segwit_addr
|
||||||
|
|
||||||
from .util import (
|
from basicswap.util import (
|
||||||
dumpj,
|
dumpj,
|
||||||
ensure,
|
ensure,
|
||||||
make_int,
|
make_int,
|
||||||
b2h, i2b, b2i, i2h)
|
b2h, i2b, b2i, i2h)
|
||||||
from .util.ecc import (
|
from basicswap.util.ecc import (
|
||||||
ep,
|
ep,
|
||||||
pointToCPK, CPKToPoint,
|
pointToCPK, CPKToPoint,
|
||||||
getSecretInt)
|
getSecretInt)
|
||||||
from .util.script import (
|
from basicswap.util.script import (
|
||||||
decodeScriptNum,
|
decodeScriptNum,
|
||||||
getCompactSizeLen,
|
getCompactSizeLen,
|
||||||
SerialiseNumCompact,
|
SerialiseNumCompact,
|
||||||
getWitnessElementLen,
|
getWitnessElementLen,
|
||||||
)
|
)
|
||||||
from .util.address import (
|
from basicswap.util.address import (
|
||||||
toWIF,
|
toWIF,
|
||||||
b58encode,
|
b58encode,
|
||||||
decodeWif,
|
decodeWif,
|
||||||
@ -47,7 +47,7 @@ from coincurve.ecdsaotves import (
|
|||||||
ecdsaotves_dec_sig,
|
ecdsaotves_dec_sig,
|
||||||
ecdsaotves_rec_enc_key)
|
ecdsaotves_rec_enc_key)
|
||||||
|
|
||||||
from .contrib.test_framework.messages import (
|
from basicswap.contrib.test_framework.messages import (
|
||||||
COIN,
|
COIN,
|
||||||
COutPoint,
|
COutPoint,
|
||||||
CTransaction,
|
CTransaction,
|
||||||
@ -56,7 +56,7 @@ from .contrib.test_framework.messages import (
|
|||||||
CTxOut,
|
CTxOut,
|
||||||
FromHex)
|
FromHex)
|
||||||
|
|
||||||
from .contrib.test_framework.script import (
|
from basicswap.contrib.test_framework.script import (
|
||||||
CScript, CScriptOp,
|
CScript, CScriptOp,
|
||||||
OP_IF, OP_ELSE, OP_ENDIF,
|
OP_IF, OP_ELSE, OP_ENDIF,
|
||||||
OP_0, OP_2,
|
OP_0, OP_2,
|
||||||
@ -68,11 +68,11 @@ from .contrib.test_framework.script import (
|
|||||||
SegwitV0SignatureHash,
|
SegwitV0SignatureHash,
|
||||||
hash160)
|
hash160)
|
||||||
|
|
||||||
from .basicswap_util import (
|
from basicswap.basicswap_util import (
|
||||||
TxLockTypes)
|
TxLockTypes)
|
||||||
|
|
||||||
from .chainparams import CoinInterface, Coins
|
from basicswap.chainparams import CoinInterface, Coins
|
||||||
from .rpc import make_rpc_func, openrpc
|
from basicswap.rpc import make_rpc_func, openrpc
|
||||||
|
|
||||||
|
|
||||||
SEQUENCE_LOCKTIME_GRANULARITY = 9 # 512 seconds
|
SEQUENCE_LOCKTIME_GRANULARITY = 9 # 512 seconds
|
@ -5,8 +5,8 @@
|
|||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
from .interface_btc import BTCInterface
|
from .btc import BTCInterface
|
||||||
from .chainparams import Coins
|
from basicswap.chainparams import Coins
|
||||||
|
|
||||||
|
|
||||||
class LTCInterface(BTCInterface):
|
class LTCInterface(BTCInterface):
|
@ -5,9 +5,9 @@
|
|||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
from .interface_btc import BTCInterface
|
from .btc import BTCInterface
|
||||||
from .chainparams import Coins
|
from basicswap.chainparams import Coins
|
||||||
from .util import (
|
from basicswap.util import (
|
||||||
make_int,
|
make_int,
|
||||||
)
|
)
|
||||||
|
|
@ -8,30 +8,30 @@
|
|||||||
import hashlib
|
import hashlib
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
|
|
||||||
from .contrib.test_framework.messages import (
|
from basicswap.contrib.test_framework.messages import (
|
||||||
CTxOutPart,
|
CTxOutPart,
|
||||||
)
|
)
|
||||||
from .contrib.test_framework.script import (
|
from basicswap.contrib.test_framework.script import (
|
||||||
CScript,
|
CScript,
|
||||||
OP_0,
|
OP_0,
|
||||||
OP_DUP, OP_HASH160, OP_EQUALVERIFY, OP_CHECKSIG
|
OP_DUP, OP_HASH160, OP_EQUALVERIFY, OP_CHECKSIG
|
||||||
)
|
)
|
||||||
from .util import (
|
from basicswap.util import (
|
||||||
i2b,
|
i2b,
|
||||||
ensure,
|
ensure,
|
||||||
make_int,
|
make_int,
|
||||||
TemporaryError,
|
TemporaryError,
|
||||||
)
|
)
|
||||||
from .util.script import (
|
from basicswap.util.script import (
|
||||||
getP2WSH,
|
getP2WSH,
|
||||||
getCompactSizeLen,
|
getCompactSizeLen,
|
||||||
getWitnessElementLen,
|
getWitnessElementLen,
|
||||||
)
|
)
|
||||||
from .util.address import (
|
from basicswap.util.address import (
|
||||||
toWIF,
|
toWIF,
|
||||||
encodeStealthAddress)
|
encodeStealthAddress)
|
||||||
from .chainparams import Coins, chainparams
|
from basicswap.chainparams import Coins, chainparams
|
||||||
from .interface_btc import BTCInterface
|
from .btc import BTCInterface
|
||||||
|
|
||||||
|
|
||||||
class BalanceTypes(IntEnum):
|
class BalanceTypes(IntEnum):
|
@ -5,8 +5,8 @@
|
|||||||
# Distributed under the MIT software license, see the accompanying
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
from .interface_btc import BTCInterface
|
from .btc import BTCInterface
|
||||||
from .contrib.test_framework.messages import (
|
from basicswap.contrib.test_framework.messages import (
|
||||||
CTxOut)
|
CTxOut)
|
||||||
|
|
||||||
|
|
@ -24,18 +24,18 @@ from coincurve.dleag import (
|
|||||||
verify_ed25519_point,
|
verify_ed25519_point,
|
||||||
)
|
)
|
||||||
|
|
||||||
from .util import (
|
from basicswap.util import (
|
||||||
dumpj,
|
dumpj,
|
||||||
ensure,
|
ensure,
|
||||||
make_int,
|
make_int,
|
||||||
TemporaryError)
|
TemporaryError)
|
||||||
from .rpc_xmr import (
|
from basicswap.rpc_xmr import (
|
||||||
make_xmr_rpc_func,
|
make_xmr_rpc_func,
|
||||||
make_xmr_rpc2_func,
|
make_xmr_rpc2_func,
|
||||||
make_xmr_wallet_rpc_func)
|
make_xmr_wallet_rpc_func)
|
||||||
from .util import (
|
from basicswap.util import (
|
||||||
b2i, b2h)
|
b2i, b2h)
|
||||||
from .chainparams import XMR_COIN, CoinInterface, Coins
|
from basicswap.chainparams import XMR_COIN, CoinInterface, Coins
|
||||||
|
|
||||||
|
|
||||||
class XMRInterface(CoinInterface):
|
class XMRInterface(CoinInterface):
|
@ -24,8 +24,8 @@ from coincurve.keys import (
|
|||||||
from basicswap.util import i2b, h2b
|
from basicswap.util import i2b, h2b
|
||||||
from basicswap.util.crypto import ripemd160
|
from basicswap.util.crypto import ripemd160
|
||||||
from basicswap.util.rfc2440 import rfc2440_hash_password
|
from basicswap.util.rfc2440 import rfc2440_hash_password
|
||||||
from basicswap.interface_btc import BTCInterface
|
from basicswap.interface.btc import BTCInterface
|
||||||
from basicswap.interface_xmr import XMRInterface
|
from basicswap.interface.xmr import XMRInterface
|
||||||
|
|
||||||
from basicswap.basicswap_util import (
|
from basicswap.basicswap_util import (
|
||||||
TxLockTypes)
|
TxLockTypes)
|
||||||
|
@ -48,7 +48,7 @@ from basicswap.rpc_xmr import (
|
|||||||
callrpc_xmr,
|
callrpc_xmr,
|
||||||
callrpc_xmr_na,
|
callrpc_xmr_na,
|
||||||
)
|
)
|
||||||
from basicswap.interface_xmr import (
|
from basicswap.interface.xmr import (
|
||||||
XMR_COIN,
|
XMR_COIN,
|
||||||
)
|
)
|
||||||
from basicswap.contrib.key import (
|
from basicswap.contrib.key import (
|
||||||
|
Loading…
Reference in New Issue
Block a user