FederationGateway

FederationGateway

class FederationGateway(**kwargs)

Implements the federationgateway api endpoints.

deposits(block_height: int, **kwargs) List[MaturedBlockDepositsModel]

Retrieves block deposits

Parameters:
  • block_height (int) – The block height at which to obtain deposits.

  • **kwargs – Extra keyword arguments.

Returns:

A list of matured block deposits.

Return type:

List[MaturedBlockDepositsModel]

Raises:

APIError – Error thrown by node API. See message for details.

pending_transfer(deposit_id: str | uint256, transaction_id: str | uint256, **kwargs) List[CrossChainTransferModel]

Gets pending transfers.

Parameters:
  • deposit_id (uint256, str) – The deposit id hash.

  • transaction_id (uint256, str) – The transaction id hash.

  • **kwargs – Extra keyword arguments.

Returns:

A list of cross chain transfers.

Return type:

List[CrossChainTransferModel]

Raises:

APIError – Error thrown by node API. See message for details.

fullysigned_transfer(deposit_id: str | uint256, transaction_id: str | uint256, **kwargs) List[CrossChainTransferModel]

Get fully signed transfers.

Parameters:
  • deposit_id (uint256, str) – The deposit id hash.

  • transaction_id (uint256, str) – The transaction id hash.

  • **kwargs – Extra keyword arguments.

Returns:

A list of cross chain transfers.

Return type:

List[CrossChainTransferModel]

Raises:

APIError – Error thrown by node API. See message for details.

member_info(**kwargs) FederationMemberInfoModel

Gets info on the state of a multisig member.

Parameters:

**kwargs – Extra keyword arguments.

Returns:

Information on the current multisig member.

Return type:

FederationMemberInfoModel

Raises:

APIError – Error thrown by node API. See message for details.

info(**kwargs) FederationGatewayInfoModel

Gets info on the state of the federation.

Parameters:

**kwargs – Extra keyword arguments.

Returns:

Information on the federation gateway.

Return type:

FederationGatewayInfoModel

Raises:

APIError – Error thrown by node API. See message for details.

ip_add(ipaddr: str, **kwargs) str

Add a federation member’s IP address to the federation IP list

Parameters:
  • ipaddr (str) – The endpoint.

  • **kwargs – Extra keyword arguments.

Returns:

Response to ip add request.

Return type:

str

Raises:

APIError – Error thrown by node API. See message for details.

ip_remove(ipaddr: str, **kwargs) str

Remove a federation member’s IP address to the federation IP list

Parameters:
  • ipaddr (str) – The endpoint.

  • **kwargs – Extra keyword arguments.

Returns:

response to ip remove request.

Return type:

str

Raises:

APIError – Error thrown by node API. See message for details.

ip_replace(ipaddrtouse: str, ipaddr: str, **kwargs) str

Replace a federation member’s IP from the federation IP list with another.

Parameters:
  • ipaddrtouse (str) – The new endpoint.

  • ipaddr (str) – The endpoint being replaced.

  • **kwargs – Extra keyword arguments.

Returns:

Response to ip replace request.

Return type:

str

Raises:

APIError – Error thrown by node API. See message for details.

verify_transfer(deposit_id_transaction_id: str | uint256, **kwargs) str | ValidateTransactionResultModel

Validate a transfer transaction.

Parameters:
  • deposit_id_transaction_id (uint256, str) – The transaction id containing the deposit with the deposit id.

  • **kwargs – Extra keyword arguments.

Returns:

A model describing the validity of the transfer.

Return type:

Union[str, ValidateTransactionResultModel]

Raises:

APIError – Error thrown by node API. See message for details.

transfers_delete_suspended(**kwargs) str

Delete a suspended transfer transaction.

Parameters:

**kwargs – Extra keyword arguments.

Returns:

A message about the deletion request.

Return type:

str

Raises:

APIError – Error thrown by node API. See message for details.

transfer(deposit_id: str | uint256, **kwargs) CrossChainTransferModel

Gets pending transfers.

Parameters:
  • deposit_id (uint256, str) – The deposit id hash.

  • **kwargs – Extra keyword arguments.

Returns:

A cross chain transfer.

Return type:

CrossChainTransferModel

Raises:

APIError – Error thrown by node API. See message for details.

CrosschainTransferModel

class CrossChainTransferModel(*, depositAmount: Money, depositId: uint256, depositHeight: int, transferStatus: CrossChainTransferStatus, tx: TransactionModel)

A pydantic model of a cross chain transfer.

deposit_amount: Money

The amount deposited.

deposit_id: uint256

The hash of the deposit transaction.

deposit_height: int

The height of the deposit transaction.

transfer_status: CrossChainTransferStatus

The transfer status.

tx: TransactionModel

The transaction model of the cross chain transaction.

FederationGatewayInfoModel

class FederationGatewayInfoModel(*, active: bool, mainchain: bool, endpoints: List[str], multisigPubKey: PubKey, federationMultisigPubKeys: List[PubKey], miningPubKey: PubKey = '', federationMiningPubKeys: List[PubKey] = [], multisigAddress: Address, multisigRedeemScript: str = None, multisigRedeemScriptPaymentScript: str = None, minconfsmalldeposits: int, minconfnormaldeposits: int, minconflargedeposits: int, minconfdistributiondeposits: int)

A pydantic model representing information on the federation gateway.

active: bool

True if federation gateway is active.

mainchain: bool

True if called on mainchain node.

multisig_pubkey: PubKey

The multisig pubkey.

federation_multisig_pubkeys: List[PubKey]

A list of federation multisig pubkeys.

mining_pubkey: PubKey

The mining pubkey.

federation_mining_pubkeys: List[PubKey] | None

The federation mining pubkeys. Only active if federation mining is active.

multisig_address: Address

The multisig address.

multisig_redeem_script: str | None

The multisig redeem script.

multisig_redeem_script_payment_script: str | None

The multisig redeem script payment script.

min_conf_small_deposits: int

The minimum confirmations for small deposits.

min_conf_normal_deposits: int

The minimum confirmations for normal deposits.

min_conf_large_deposits: int

The minimum confirmations for large deposits.

min_conf_distribution_deposits: int

The minimum confirmations for distribution deposits.

FederationMemberConnectionInfoModel

class FederationMemberConnectionInfoModel(*, federationMemberIp: str, isConnected: bool, isBanned: bool)

A pydantic model for federation member connections.

federation_member_ip: str

The federation member ip.

is_connected: bool

If true, federation member is connected.

is_banned: bool

If true, federation member is banned.

FederationMemberInfoModel

class FederationMemberInfoModel(*, asyncLoopState: str, consensusHeight: int, cctsHeight: int, cctsNextDepositHeight: int, cctsPartials: int, cctsSuspended: int, federationWalletActive: bool, federationWalletHeight: int, nodeVersion: str, pubKey: PubKey = None, federationConnectionState: str, federationMemberConnections: List[FederationMemberConnectionInfoModel])

A pydantic model representing information about the current federation member.

async_loop_state: str

The async loop state.

consensus_height: int

The current consensus height.

ccts_height: int

The node’s CCTS height.

ccts_next_deposit_height: int

The next CCTS deposit height.

ccts_partials: int

The number of partial CCTS transactions.

ccts_suspended: int

The number of suspended CCTS transactions.

federation_wallet_active: bool

If true, the federation wallet is active.

federation_wallet_height: int

The local federation wallet height.

node_version: str

The node version.

pubkey: PubKey | None

The member’s pubkey. Could be None.

federation_connection_state: str

The federation connection state.

federation_member_connections: List[FederationMemberConnectionInfoModel]

A list of connected federation members.

MaturedBlockDepositsModel

class MaturedBlockDepositsModel(*, deposits: List[Deposit], blockInfo: MaturedBlockInfoModel)

A pydantic model for matured block deposits.

deposits: List[Deposit]

A list of deposits.

block_info: MaturedBlockInfoModel

Matured block information model.

SerializableResult

class SerializableResult(*, value: Any = None, message: str = '')

A pydantic model for a serializable result.

value: Any | None
message: str | None

ValidateTransactionResultModel

class ValidateTransactionResultModel(*, isValid: bool, errors: List[str] = None)

A pydantic model for a validate transaction result.

is_valid: bool

If true, transaction is valid.

errors: List[str] | None

Transaction validation errors.