Core

Subpackages

CoinType

class CoinType(value)

Enum representing type of coin, as specified in BIP44. Registered cointypes specified in SLIP44.

Corresponding type from StratisFullNode’s implementation can be found here.

Note

Coin type for Cirrus mainnet is not a registered coin type (as well as testnets). According to SLIP44, ID 401 belongs to another coin, that has nothing to do with Statis Platform.

Bitcoin = 0
Testnet = 1
CirrusTest = 400
Cirrus = 401
Strax = 105105

ContractTransactionItemType

class ContractTransactionItemType(value)

Enum representing type of contract-related transaction item.

Corresponding type from StratisFullNode’s implementation can be found here.

Received = 0
Send = 1
Staked = 2
ContractCall = 3
ContractCreate = 4
GasRefund = 5

ConversionRequestStatus

class ConversionRequestStatus(value)

Enum representing status of interop conversion request.

Corresponding type from StratisFullNode’s implementation can be found here.

Unprocessed = 0
Submitted = 1
Processed = 2
OriginatorNotSubmitted = 3
OriginatorSubmitted = 4
VoteFinalised = 5
NotOriginator = 6

ConversionRequestType

class ConversionRequestType(value)

Enum representing type of interop conversion request.

Corresponding type from StratisFullNode’s implementation can be found here.

Mint = 0
Burn = 1

CrosschainTransferStatus

class CrossChainTransferStatus(value)

Enum representing status of cross chain status.

Corresponding type from StratisFullNode’s implementation can be found here.

Suspended = 'Suspended'
Partial = 'Partial'
FullySigned = 'FullySigned'
SeenInBlock = 'SeenInBlock'
Rejected = 'Rejected'

Deposit

class Deposit(*, id: uint256, amount: Money, targetAddress: Address, targetChain: DestinationChain = None, blockNumber: int, blockHash: uint256, retrievalType: DepositRetrievalType)

A pydantic model representing a deposit made to a sidechain mutlisig, with the aim of triggering a cross chain transfer.

Note

Learn how to acquire CRS token using GUI.

deposit_id: uint256

The hash of the source transaction that originates the fund transfer.

amount: Money

The amount of the requested funds transfer.

target_address: Address

The target address, on the target chain, for the fund deposited on the multisig.

target_chain: DestinationChain | None

Chain on which STRAX minting or burning should occur.

block_number: int

The block number where the source deposit has been persisted.

block_hash: uint256

The hash of the block where the source deposit has been persisted.

retrieval_type: DepositRetrievalType

Whether the deposit is a “faster” or “normal” deposit.

DepositRetrievalType

class DepositRetrievalType(value)

Represents type of deposit retrival.

Small deposits are processed after IFederatedPegSettings.MinimumConfirmationsSmallDeposits confirmations (blocks).

Normal deposits are processed after IFederatedPegSettings.MinimumConfirmationsNormalDeposits confirmations (blocks).

Large deposits are only processed after the height has increased past max re-org (IFederatedPegSettings.MinimumConfirmationsLargeDeposits) confirmations (blocks).

Conversion deposits are processed after similar intervals to the above, according to their size.

Reward distribution deposits are only processed after the height has increased past max re-org (IFederatedPegSettings.MinimumConfirmationsDistributionDeposits) confirmations (blocks).

Small = 0
Normal = 1
Large = 2
Distribution = 3
ConversionSmall = 4
ConversionNormal = 5
ConversionLarge = 6

DestinationChain

class DestinationChain(value)

Chains supported by InterFlux integration. Symbols are defined according to the SLIP44 specification.

STRAX = 0
ETH = 1
BNB = 2
ETC = 3
AVAX = 4
ADA = 5

ExtKey

class ExtKey(value: bytes | str | Key)

Type representing extended private key, as specified in BIP32.

Corresponding type from StratisFullNode’s implementation can be found here.

Parameters:

value (bytes, str, Key) – data for a private key.

Raises:

ValueError – Attempt to create ExtKey with unsupported value type. Attempt to create with incorrect length.

generate_private_key_bytes() bytes

Get private key from this extended private key.

Returns:

private key, represented by the first 32 bytes of extended private key.

Return type:

bytes

generate_chain_code_bytes() bytes

Get chain code from this extended private key.

Returns:

chain code, represented by the last 32 bytes of extended private key.

Return type:

bytes

generate_private_key_base58() str

Get Base58-encoded private key from this extended private key.

Returns:

base58-encoded private key

Return type:

str

generate_private_key() Key

Get private key from this extended private key.

Returns:

private key.

Return type:

Key

generate_wif_key() str

Convert current key to Wallet import format

Returns:

WIF compilant key.

Return type:

str

get_bytes() bytes

Get private key bytes

Returns:

raw private key data

Return type:

bytes

ExtPubKey

class ExtPubKey(extpubkey: str)

Type representing extended public key, as specified in BIP32.

Corresponding type from StratisFullNode’s implementation can be found here.

Parameters:

extpubkey (str) – encoded extended public key.

version: bytes
depth: bytes
parent_fingerprint: bytes
index: bytes
chain_code: bytes
key: bytes
checksum
decode_extpubkey(extpubkey: str)

Deserialize extended public key, as specified in BIP32.

Parameters:

extpubkey (str) – Base58 encoded serialized extended public key.

Raises:

AssertionError – extpubkey has incorrect format.

get_payload() bytes

Serialize extended public key, as specified in BIP32.

Returns:

serialized extended public key.

Return type:

bytes

Key

class Key(value: bytes | str | Key)

Type representing private key. A private key is a secret number, known only to the person that generated it.

Corresponding type from StratisFullNode’s implementation can be found here.

Parameters:

value (bytes, str, Key) – data for private key.

Raises:

ValueError – Attempt to create Key with unsupported value type.

get_bytes() bytes

Get private key bytes

Returns:

raw private key data

Return type:

bytes

generate_wif_key() str

Convert current key to Wallet import format

Returns:

WIF compilant key.

Return type:

str

MultisigSecret

class MultisigSecret(*, mnemonic: SecretStr, passphrase: SecretStr)

A MultisigSecret.

mnemonic: SecretStr
passphrase: SecretStr

Outpoint

class Outpoint(*, transactionId: uint256 = None, index: ConstrainedIntValue)

A pydantic model representing an outpoint.

transaction_id: uint256 | None

The transaction hash of the unspent output.

index: ConstrainedIntValue

The index of the outpoint. Must be >= 0.

PubKey

class PubKey(value: str)

Type representing public key. A public key is the number that corresponds to a private key, but does not need to be kept secret. A public key can be calculated from a private key, but not vice versa.

A public key can be presented in compressed or uncompressed format.

Note

Read more about public key formats.

x
y
uncompressed() str

Retrieves a uncompressed pubkey.

compressed() str

Retreives a compressed pubkey.

Recipient

class Recipient(*, destinationAddress: Address = None, destinationScript: Address = None, subtractFeeFromAmount: bool = True, amount: Money)

A pydantic model for a recipient.

destination_address: Address | None

The destination address, if applicable.

destination_script: Address | None

The destination script, if applicable.

subtraction_fee_from_amount: bool | None

If true, subtract fee from amount.

amount: Money

The amount to send to this recipient.

SmartContractParameter

class SmartContractParameter(value_type: SmartContractParameterType, value: Any)

Type representing smart contract’s parameter.

Parameters:

Note

Learn more about smart contracts in Stratis Academy.

static validate_values(value_type: SmartContractParameterType, value: Any) bool

Validates that type of value matching with value_type.

SmartContractParameterType

class SmartContractParameterType(value)

Defines (de-)serialization rule for smart contract parameters.

Notes

Learn more about contract’s parameters serialization from Stratis Academy.

Boolean = 1
Byte = 2
Char = 3
String = 4
UInt32 = 5
Int32 = 6
UInt64 = 7
Int64 = 8
Address = 9
ByteArray = 10
UInt128 = 11
UInt256 = 12

TransactionItemType

class TransactionItemType(value)

A TransactionItemType.

Received = 'received'
Send = 'send'
Staked = 'staked'
Mined = 'mined'

WalletSecret

class WalletSecret(*, walletName: str, walletPassword: SecretStr)

A pydantic model representing credentials of the wallet.

wallet_name: str

The name of the wallet.

wallet_password: SecretStr

The wallet password.