P2SH#

class defichain.transactions.address.P2SH(network: Any, address: str)#
static from_publicKey(network: Any, publicKey: str) P2SH#

Generates a P2SH address object from the given public key

Parameters:
  • network (Network) – (required) The network in witch the public key should be used

  • publicKey (str) – (required) public key

Returns:

P2SH - returns the P2SH address object

static from_privateKey(network: Any, privateKey: str) P2SH#

Generates a P2SH address object from the given private key

Parameters:
  • network (Network or DefichainRegtest) – (required) The network in witch the private key should be used

  • privateKey (str) – (required) private key

Returns:

P2SH - returns the P2SH address object

static from_scriptPublicKey(network: Any, scriptPublicKey: str) P2SH#

Generates a P2SH address object from the given script private key

Parameters:
  • network (Network) – (required) The network in witch the script public key should be used

  • scriptPublicKey (str) – (required) script public key

Returns:

P2SH - returns the P2SH address object

get_addressType() str#

Gets the address type

Returns:

AddressType

get_scriptPublicKey() str#

Calculates the script public key

Returns:

string - script public key

get_redeemScript() str#

Calculates the redeem script

Returns:

string - redeem script

get_bytes_scriptPublicKey() bytes#

Calculates the script public key

Returns:

bytes - script public key

get_bytes_redeemScript() bytes#

Calculates the redeem script

Returns:

bytes - redeem script