logic

check_program(program, args=None)

Performs program checking for max length and cost

Parameters
  • program (bytes) – compiled program

  • args (list[bytes]) – args are not signed, but are checked by logic

Returns

True on success

Return type

bool

Raises

InvalidProgram – on error

read_program(program, args=None)
check_int_const_block(program, pc)
read_int_const_block(program, pc)
check_byte_const_block(program, pc)
read_byte_const_block(program, pc)
check_push_int_block(program, pc)
read_push_int_block(program, pc)
check_push_byte_block(program, pc)
read_push_byte_block(program, pc)
parse_uvarint(buf)
address(program)

Return the address of the program.

Parameters

program (bytes) – compiled program

Returns

program address

Return type

str

teal_sign(private_key, data, contract_addr)

Return the signature suitable for ed25519verify TEAL opcode

Parameters
  • private_key (str) – private key to sign with

  • data (bytes) – data to sign

  • contract_addr (str) – program hash (contract address) to sign for

Returns

signature

Return type

bytes

teal_sign_from_program(private_key, data, program)

Return the signature suitable for ed25519verify TEAL opcode

Parameters
  • private_key (str) – private key to sign with

  • data (bytes) – data to sign

  • program (bytes) – program to sign for

Returns

signature

Return type

bytes

get_application_address(appID: int)str

Return the escrow address of an application.

Parameters

appID (int) – The ID of the application.

Returns

The address corresponding to that application’s escrow account.

Return type

str