API

The only module-level functions that should be used are create_client and set_stream_logger. The Client class should only be instantiated by this create_client function, and not be constructed directly.

dragonchain_sdk.create_client(dragonchain_id: Optional[str] = None, auth_key_id: Optional[str] = None, auth_key: Optional[str] = None, endpoint: Optional[str] = None, verify: bool = True, algorithm: str = 'SHA256') → dragonchain_sdk.dragonchain_client.Client[source]

Construct a new Client object

Parameters
  • dragonchain_id (str, optional) – The ID of the chain to connect to.

  • auth_key_id (str, optional) – The authorization key ID

  • auth_key (str, optional) – The authorization key

  • endpoint (str, optional) – The endpoint of the Dragonchain

  • verify (bool, optional) – Verify the TLS cert of the Dragonchain

  • algorithm (str, optional) – The hashing algorithm used for HMAC authentication

Returns

A new Dragonchain client.

dragonchain_sdk.set_stream_logger(name: str = 'dragonchain_sdk', level: int = 10, format_string: Optional[str] = None) → None[source]

Set a stream logger for a module. You can set name to '' to log everything.

Parameters
  • name (str) – Name of the module to set the stream logger for

  • level (int) – Log level, use logging module constants

  • format_string (str) – Logging format

Returns

None, sets a stream logger for the whole SDK

Client Functions

class dragonchain_sdk.dragonchain_client.Client(dragonchain_id: Optional[str], auth_key_id: Optional[str], auth_key: Optional[str], endpoint: Optional[str], verify: bool, algorithm: str)[source]
create_api_key(nickname: Optional[str] = None, permissions_document: Optional[permissions_doc] = None) → request_response[source]

Generate a new HMAC API key

Parameters
  • nickname (str, optional) – The nickname to give to this new api key

  • permissions_document (dict, optional) – The permissions dictionary to use with this key. Check the dragonchain core docs for more details

Returns

The newly created api key

create_binance_interchain(name: str, testnet: Optional[bool] = None, private_key: Optional[str] = None, node_url: Optional[str] = None, rpc_port: Optional[int] = None, api_port: Optional[int] = None) → request_response[source]

Create (or overwrite) a binance wallet/network for interchain use

Parameters
  • name (str) – The name to use for this network. Will overwrite if providing a name that already exists

  • testnet (bool, optional) – Whether or not this is a testnet wallet/address. Defaults to True.

  • private_key (str, optional) – The base64 or hex encoded private key. Will generate randomly if not provided

  • node_url (str, optional) – The endpoint of the binance RPC node to use (i.e. http://my.node.address)

  • rpc_port (int, optional) – The port being used to hit the RPC endpoints (i.e. 27147)

  • api_port (int, optional) – The port being used to hit the API endpoints (i.e. 1169)

Raises

TypeError – with bad parameters

Returns

The created interchain network

create_bitcoin_interchain(name: str, testnet: Optional[bool] = None, private_key: Optional[str] = None, rpc_address: Optional[str] = None, rpc_authorization: Optional[str] = None, utxo_scan: Optional[bool] = None) → request_response[source]

Create (or overwrite) a bitcoin wallet/network for interchain use

Parameters
  • name (str) – The name to use for this network. Will overwrite if providing a name that already exists

  • testnet (bool, optional) – Whether or not this is a testnet wallet/address (not required if providing private_key as WIF)

  • private_key (str, optional) – The base64 encoded private key, or WIF for the desired wallet. Will generate randomly if not provided

  • rpc_address (str, optional) – The endpoint of the bitcoin core RPC node to use (i.e. http://my-node:8332)

  • rpc_authorization (str, optional) – The base64-encoded username:password for the rpc node. For example, user: a pass: b would be ‘YTpi’ (base64(“a:b”))

  • utxo_scan (bool, optional) – Whether or not to force a utxo-rescan for the address. If using a private key for an existing wallet with funds, this must be True to use its existing funds

Raises

TypeError – with bad parameter values

Returns

The created interchain network

create_bitcoin_transaction(network: str, satoshis_per_byte: Optional[int] = None, data: Optional[str] = None, change_address: Optional[str] = None, outputs: Optional[List[Dict[str, Any]]] = None) → request_response[source]

!This method is deprecated and should not be used! Backwards compatibility will exist for legacy chains, but will not work on new chains. sign_bitcoin_transaction should be used instead

Create and sign a bitcoin transaction using your chain’s private keys

Parameters
  • network (str) – network to create transaction for. Only valid values are BTC_MAINNET and BTC_TESTNET3

  • satoshis_per_byte (int, optional) – fee to pay in satoshis/byte. If not supplied, it will be estimated for you.

  • data (str, optional) – string to embed in the transaction as null-data output type

  • change_address (str, optional) – address to send change to. If not supplied, it will default to the address you are sending from

  • outputs (list, optional) – (list of {‘to’: str, ‘value’: float} dictionaries. Value float is in BTC)

Raises
  • TypeError – with bad parameter types

  • ValueError – with bad parameter values

Returns

The built and signed transaction

create_bulk_transaction(transaction_list: List[Dict[Any, Any]]) → request_response[source]

Post many transactions to a chain at once, over a single connnection

Parameters

transaction_list (list) – List of transaction dictionaries. Schema: {'transaction_type': 'str', 'payload': 'str or dict', 'tag': 'str (optional)'}

Raises

TypeError – with bad parameter types

Returns

List of succeeded transaction id’s and list of failed transactions

create_ethereum_interchain(name: str, private_key: Optional[str] = None, rpc_address: Optional[str] = None, chain_id: Optional[int] = None) → request_response[source]

Create (or overwrite) an ethereum wallet/network for interchain use

Parameters
  • name (str) – The name to use for this network. Will overwrite if providing a name that already exists

  • private_key (str, optional) – The base64 or hex encoded private key. Will generate randomly if not provided

  • rpc_address (str, optional) – The endpoint of the ethereum RPC node to use (i.e. http://my-node:8545)

  • chain_id (int, optional) – The ethereum chain id to use. Will automatically derive this if providing a custom rpc_address Without providing a custom rpc_address, Dragonchain manages and supports: 1=ETH Mainnet|3=ETH Ropsten|61=ETC Mainnet

Raises

TypeError – with bad parameters

Returns

The created interchain network

create_ethereum_transaction(network: str, to: str, value: str, data: Optional[str] = None, gas_price: Optional[str] = None, gas: Optional[str] = None) → request_response[source]

!This method is deprecated and should not be used! Backwards compatibility will exist for legacy chains, but will not work on new chains. sign_ethereum_transaction should be used instead

Create and sign a public ethereum transaction using your chain’s private keys

Parameters
  • network (str) – network to create transaction for. Only valid values are: ETH_MAINNET ETH_ROPSTEN ETC_MAINNET

  • to (str) – hex of the address to send to

  • value (str) – hex value (in wei) to send

  • data (str, optional) – hex data to publish in the transaction

  • gas_price (str, optional) – hex value of the gas price to pay (in wei), if not supplied it will be estimated for you

  • gas (str, optional) – hex value of the maximum amount of gas allowed (gasLimit), if not supplied it will be estimated for you

Raises
  • TypeError – with bad parameter types

  • ValueError – with bad parameter values

Returns

The built and signed transaction

create_smart_contract(transaction_type: str, image: str, cmd: str, args: Optional[List[str]] = None, execution_order: str = 'parallel', environment_variables: Optional[Dict[str, str]] = None, secrets: Optional[Dict[str, str]] = None, schedule_interval_in_seconds: Optional[int] = None, cron_expression: Optional[str] = None, registry_credentials: Optional[str] = None, custom_index_fields: Optional[Iterable[custom_index_fields_type]] = None) → request_response[source]

Post a contract to a chain

Parameters
  • transaction_type (str) – transaction_type of the contract to create

  • image (str) – Docker image containing the smart contract logic

  • cmd (str) – Entrypoint command to run in the docker container

  • execution_order (optional, str) – Order of execution. Valid values are ‘serial’ or ‘parallel’. default: ‘parallel’

  • args (optional, list) – List of arguments to the cmd field

  • environment_variables (optional, dict) – dict mapping of environment variables for your contract runtime

  • secrets (optional, dict) – dict mapping of secrets for your contract runtime

  • schedule_interval_in_seconds (optional, int) – The seconds of scheduled execution in seconds. Must not be set if cron_expression is set

  • cron_expression (optional, str) – The rate of scheduled execution specified as a cron. Must not be set if schedule_interval_in_seconds is set

  • registry_credentials (optional, str) – basic-auth for pulling docker images, base64 encoded (e.g. username:password)

  • custom_index_fields (optional) – Custom index fields to assign to the transaction type for this smart contract. See create_transaction_type for details

Raises

TypeError – with bad parameter types

Returns

Success or failure object

create_transaction(transaction_type: str, payload: Union[str, Dict[Any, Any]], tag: Optional[str] = None, callback_url: Optional[str] = None) → request_response[source]

Post a transaction to a chain

Parameters
  • transaction_type (str) – Type of transaction

  • payload (dict or string) – The payload of the transaction

  • tag (str, optional) – A tag string to search on

Returns

Transaction ID on success

create_transaction_type(transaction_type: str, custom_index_fields: Optional[Iterable[custom_index_fields_type]] = None) → request_response[source]

Creates a new custom transaction type.

Parameters
  • transaction_type (str) – transaction_type to update

  • custom_index_fields (optional) –

    custom index fields to create. Ex.: [{"path":"a.b","field_name":"myField","type":"text","options":{"no_index":True}}]

    Transaction Types can optionally link custom search index fields to your transactions for easier querying later. A custom_index_field is a dictionary with ‘path’, ‘field_name’, ‘type’, and an optional ‘options’ dictionary:

    • path (str): the JSONPath of your transaction payload you would like to result form a search on the “key”

    • field_name (str): The field for this custom extracted value to be indexed under

    • type (‘text’, ‘tag’, or ‘number’): The type of redisearch index to use for this field

    • options: (object) The redisearch options for this field

      • no_index (bool) (all types) whether or not to index on this field, or simply make it sortable only if false

      • separator (str) (tag only) what string should be used for the tag separator

      • weight (number) (text only) The weight to give this text field when doing text queries

      • no_stem (bool) (text only) Whether or not to allow search stemming in text searches on this field

      • sortable (bool) (text and number only) Whether or not a search on the index can be sortable by this field

    See the redisearch docs for more details on these options

Raises

TypeError – with bad parameter types

Returns

Parsed json with success message

delete_api_key(key_id: str) → request_response[source]

Delete an existing HMAC API key

Parameters

key_id (str) – The id of the api key to delete

Returns

Generic success message

delete_interchain_network(blockchain: str, name: str) → request_response[source]

Delete an interchain network/wallet from the chain

Parameters
  • blockchain (str) – The blockchain type to delete (i.e. ‘bitcoin’, ‘ethereum’)

  • name (str) – The name of the that blockchain’s network (set when creating the network)

Raises

TypeError – with bad parameter types

Returns

Success message

delete_smart_contract(smart_contract_id: Optional[str] = None, transaction_type: Optional[str] = None) → request_response[source]

Delete an existing contract

Parameters
  • smart_contract_id (str, optional) – Contract ID of the contract to delete

  • transaction_type (str, optional) – Transaction type of the contract to delete

Raises

TypeError – with bad parameter types

Returns

The results of the delete request

delete_transaction_type(transaction_type: str) → request_response[source]

Deletes a transaction type registration

Parameters

transaction_type (str) – transaction_type to delete

Raises

TypeError – with bad parameter types

Returns

Parsed json with success message

get_api_key(key_id: str) → request_response[source]

Get information about an HMAC API key

Parameters

key_id (str) – The ID of the api key to retrieve data about

Raises

TypeError – with bad parameter types

Returns

Data about the API key

get_block(block_id: str) → request_response[source]

Get a specific block by id

Parameters

block_id (str) – ID of the block to get

Raises

TypeError – with bad parameter types

Returns

The block which was retrieved from the chain

get_default_interchain_network() → request_response[source]

Get the set default interchain network for this chain (L5 Only)

Returns

The interchain network which was set as default

get_interchain_network(blockchain: str, name: str) → request_response[source]

Get a configured interchain network/wallet from the chain

Parameters
  • blockchain (str) – The blockchain type to get (i.e. ‘bitcoin’, ‘ethereum’)

  • name (str) – The name of the that blockchain’s network (set when creating the network)

Raises

TypeError – with bad parameter types

Returns

The saved interchain network (exact schema depends on blockchain)

get_pending_verifications(block_id: str) → request_response[source]

Get chain ids for pending and/or scheduled verifications

Parameters

block_id (str) – ID of the block to get pending verifications for

Returns

Chain ids at each level (2-5) for verifications that are scheduled or sent, but not receieved

get_public_blockchain_addresses() → request_response[source]

!This method is deprecated and should not be used! Backwards compatibility will exist for legacy chains, but will not work on new chains. list_interchain_networks should be used instead

Get interchain addresses for this Dragonchain node (L1 and L5 only)

Returns

Dictionary containing addresses

get_smart_contract(smart_contract_id: Optional[str] = None, transaction_type: Optional[str] = None) → request_response[source]

Perform a query on a chain’s smart contracts

Parameters
  • smart_contract_id (str, exclusive) – Id of the contract to get

  • transaction_type (str, exclusive) – Name of the Transaction Type bound to this contract. Usually the contract “name”

Raises

TypeError – with bad parameter types

Returns

The contract returned from the request

get_smart_contract_logs(smart_contract_id: str, tail: Optional[int] = 100, since: Optional[str] = None) → request_response[source]

Perform a query on a chain’s smart contracts logs

Parameters
  • smart_contract_id (str) – Id of the contract to get

  • tail (int, optional) – The number of logs to return

  • since (str, optional) – rfc3339 date string, returns all logs since this date string

Raises
  • TypeError – with bad parameter types

  • ValueError – when no smart_contract_id provided

Returns

The contract returned from the request

get_smart_contract_object(key: str, smart_contract_id: Optional[str] = None) → request_response[source]

Retrieve data from the object storage of a smart contract Note: When ran in an actual smart contract, smart_contract_id will be pulled automatically from the environment if not explicitly provided

Parameters
  • key (str) – The key stored in the heap to retrieve

  • smart_contract_id (str, optional) – The ID of the smart contract, optional if called from within a smart contract

Raises

TypeError – with bad parameter types

Returns

The value of the object in the heap

get_smart_contract_secret(secret_name: str) → str[source]

Gets secrets for smart contracts

Parameters

secret_name (str) – name of the secret to retrieve

Raises
  • TypeError – with bad parameter types

  • RuntimeError – if not running in a smart contract environment

Returns

String of the value of the specified secret

get_status() → request_response[source]

Get the status from a chain

Returns

Returns the status of a Dragonchain

get_transaction(transaction_id: str) → request_response[source]

Get a specific transaction by id

Parameters

transaction_id (str) – ID of the transaction to get (should be a UUID)

Raises

TypeError – with bad parameter types

Returns

The transaction searched for

get_transaction_type(transaction_type: str) → request_response[source]

Gets information on a registered transaction type

Parameters

transaction_type (str) – transaction_type to retrieve data for

Raises

TypeError – with bad parameter types

Returns

parsed json response of the transaction type or None

get_verifications(block_id: str, level: Optional[int] = None) → request_response[source]

Get higher level block verifications by level 1 block id

Parameters
  • block_id (str) – ID of the block to get verifications for

  • level (int, optional) – Level of verifications to get (valid values are 2, 3, 4 and 5)

Raises

TypeError – with bad parameter types

Returns

Higher level block verifications

list_api_keys() → request_response[source]

List of HMAC API keys

Returns

A list of key IDs and their associated data

list_interchain_networks(blockchain: str) → request_response[source]

List all the interchain network/wallets for a blockchain type

Parameters

blockchain (str) – The blockchain type to get (i.e. ‘bitcoin’, ‘ethereum’)

Raises

TypeError – with bad parameter type

Returns

List of interchain networks for the specified blockchain type

list_smart_contract_objects(prefix_key: Optional[str] = None, smart_contract_id: Optional[str] = None) → request_response[source]

Lists all objects stored in a smart contracts heap Note: When ran in an actual smart contract, smart_contract_id will be pulled automatically from the environment if not explicitly provided

Parameters
  • smart_contract_id (str, optional) – smart_contract_id heap to list. If not provided explicitly, it must be in the SMART_CONTRACT_NAME env var

  • prefix_key (str, optional) – the prefix_key or “folder” from which to list objects. Must NOT contain trailing slash “/”. Note: Defaults to the root of the accessable filesystem + /list/{smart_contract_id}/

Raises
  • TypeError – with bad parameter types

  • ValueError – with bad parameter values

Returns

Parsed json response from the chain

list_smart_contracts() → request_response[source]

Get all smart contracts on a chain

Returns

A list of all the smart contracts on the chain

list_transaction_types() → request_response[source]

Lists out all registered transaction types for a chain

Returns

list of registered transaction types

publish_interchain_transaction(blockchain: str, name: str, signed_transaction: str) → request_response[source]

Publish an interchain transaction that’s already been signed

Parameters
  • blockchain (str) – The blockchain type to set (i.e. ‘bitcoin’, ‘ethereum’)

  • name (str) – The name of the that blockchain’s network to use (set when creating the network)

  • signed_transaction (str) – Signed transaction string (return from sign_<network>_transaction function)

Raises

TypeError – with bad parameter type

Returns

The transaction hash (or equivalent) of the published transaction

query_blocks(redisearch_query: str, offset: int = 0, limit: int = 10, sort_by: str = '', sort_ascending: bool = True, ids_only: bool = False) → request_response[source]

Perform a query on a chain’s blocks

Parameters
  • redisearch_query (str) – Redisearch query syntax string to search with

  • offset (int, optional) – Pagination offset of query (default 0)

  • limit (int, optional) – Pagination limit (default 10)

  • sort_by (str, optional) – The name of the field to sort by

  • sort_ascending (bool, optional) – If sort_by is set, this sorts the results by field in ascending order (descending if false)

  • ids_only (bool, optional) – If true, rather than an array of block objects, it will return an array of block id strings instead

Returns

The results of the query

query_transactions(transaction_type: str, redisearch_query: str, verbatim: bool = False, offset: int = 0, limit: int = 10, sort_by: str = '', sort_ascending: bool = True, ids_only: bool = False) → request_response[source]

Perform a query on a chain’s transactions

Parameters
  • transaction_type (str) – The single transaction type to query

  • redisearch_query (str) – Redisearch query syntax string to search with

  • verbatim (bool, optional) – Whether or not to use redisearch’s VERBATIM (if true, no stemming occurs on the query)

  • offset (int, optional) – Pagination offset of query (default 0)

  • limit (int, optional) – Pagination limit (default 10)

  • sort_by (str, optional) – The name of the field to sort by

  • sort_ascending (bool, optional) – If sort_by is set, this sorts the results by field in ascending order (descending if false)

  • ids_only (bool, optional) – If true, rather than an array of transaction objects, it will return an array of transaction id strings instead

Returns

The results of the query

set_default_interchain_network(blockchain: str, name: str) → request_response[source]

Set the default interchain network for the chain to use (L5 Only)

Parameters
  • blockchain (str) – The blockchain type to set (i.e. ‘bitcoin’, ‘ethereum’)

  • name (str) – The name of the that blockchain’s network to use (set when creating the network)

Raises

TypeError – with bad parameter type

Returns

The interchain network which was set as default

sign_binance_transaction(name: str, amount: int, to_address: str, symbol: Optional[str] = None, memo: Optional[str] = None) → request_response[source]

Create and sign a binance transaction using your chain’s interchain network

Parameters
  • name (str) – name of the binance network to use for signing

  • amount (int) – amount of token in transaction

  • to_address (str) – hex of the address to send to

  • symbol (str, optional) – the exchange symbol for the token (defaults to BNB)

  • memo (str, optional) – string of data to publish in the transaction (defaults to “”)

Raises

TypeError – with bad parameter types

Returns

The built and signed transaction

sign_bitcoin_transaction(name: str, satoshis_per_byte: Optional[int] = None, data: Optional[str] = None, change_address: Optional[str] = None, outputs: Optional[List[Dict[str, Any]]] = None) → request_response[source]

Create and sign a bitcoin transaction using your chain’s interchain network

Parameters
  • name (str) – name of the bitcoin network to use for signing

  • satoshis_per_byte (int, optional) – fee to pay in satoshis/byte. If not supplied, it will be estimated for you.

  • data (str, optional) – string to embed in the transaction as null-data output type

  • change_address (str, optional) – address to send change to. If not supplied, it will default to the address you are sending from

  • outputs (list, optional) – (list of {‘to’: str, ‘value’: float} dictionaries. Value float is in BTC)

Raises

TypeError – with bad parameter types

Returns

The built and signed transaction

sign_ethereum_transaction(name: str, to: str, value: str, data: Optional[str] = None, gas_price: Optional[str] = None, gas: Optional[str] = None, nonce: Optional[str] = None) → request_response[source]

Create and sign an ethereum transaction using your chain’s interchain network

Parameters
  • name (str) – name of the ethereum network to use for signing

  • to (str) – hex of the address to send to

  • value (str) – hex value in wei to send

  • data (str, optional) – hex data to publish in the transaction

  • gas_price (str, optional) – hex value of the gas price to pay (in wei), if not supplied it will be estimated for you

  • gas (str, optional) – hex value of the maximum amount of gas allowed (gasLimit), if not supplied it will be estimated for you

  • nonce (str, optional) – hex value of the nonce ot use for this transaction, if not supplied it will be automatically determined

Raises

TypeError – with bad parameter types

Returns

The built and signed transaction

update_api_key(key_id: str, nickname: Optional[str] = None, permissions_document: Optional[permissions_doc] = None) → request_response[source]

Update the nickname of an existing HMAC API key

Parameters
  • key_id (str) – The id of the key to update

  • nickname (str, optional) – The nickname to set on this api key

  • permissions_document (dict, optional) –

    The permissions dictionary to set with this key. Check the dragonchain core docs for more details

Returns

The updated api key

update_binance_interchain(name: str, testnet: Optional[bool] = None, private_key: Optional[str] = None, node_url: Optional[str] = None, rpc_port: Optional[int] = None, api_port: Optional[int] = None) → request_response[source]

Update an existing binance wallet/network for interchain use

Parameters
  • name (str) – The name of the network to update

  • testnet (bool) – Whether or not this is a testnet wallet/address

  • private_key (str, optional) – The base64 or hex encoded private key. Will generate randomly if not provided

  • node_url (str, optional) – The endpoint of the binance RPC node to use (i.e. http://my.node.address)

  • rpc_port (int, optional) – The port being used to hit the RPC endpoints (i.e. 27147)

  • api_port (int, optional) – The port being used to hit the API endpoints (i.e. 1169)

Raises

TypeError – with bad parameters

Returns

The updated interchain network

update_bitcoin_interchain(name: str, testnet: Optional[bool] = None, private_key: Optional[str] = None, rpc_address: Optional[str] = None, rpc_authorization: Optional[str] = None, utxo_scan: Optional[bool] = None) → request_response[source]

Update an existing bitcoin wallet/network for interchain use. Will only update the provided fields

Parameters
  • name (str) – The name of the network to update

  • testnet (bool) – Whether or not this is a testnet wallet/address (not required if providing private_key as WIF)

  • private_key (str, optional) – The base64 encoded private key, or WIF for the desired wallet

  • rpc_address (str, optional) – The endpoint of the bitcoin core RPC node to use (i.e. http://my-node:8332)

  • rpc_authorization (str, optional) – The base64-encoded username:password for the rpc node. For example, user: a pass: b would be ‘YTpi’ (base64(“a:b”))

  • utxo_scan (bool, optional) – Whether or not to force a utxo-rescan for the address. If using a new private key for an existing wallet with funds, this must be True to use its existing funds

Raises

TypeError – with bad parameter values

Returns

The updated bitcoin interchain network

update_ethereum_interchain(name: str, private_key: Optional[str] = None, rpc_address: Optional[str] = None, chain_id: Optional[int] = None) → request_response[source]

Update an existing ethereum wallet/network for interchain use

Parameters
  • name (str) – The name of the network to update

  • private_key (str, optional) – The base64 or hex encoded private key

  • rpc_address (str, optional) – The endpoint of the ethereum RPC node to use (i.e. http://my-node:8545)

  • chain_id (int, optional) – The ethereum chain id to use. Will automatically derive this if providing a custom rpc_address Without providing a custom rpc_address, Dragonchain manages and supports: 1=ETH Mainnet|3=ETH Ropsten|61=ETC Mainnet

Raises

TypeError – with bad parameters

Returns

The updated ethereum interchain network

update_smart_contract(smart_contract_id: str, image: Optional[str] = None, cmd: Optional[str] = None, args: Optional[List[str]] = None, execution_order: Optional[str] = None, enabled: Optional[bool] = None, environment_variables: Optional[Dict[str, str]] = None, secrets: Optional[Dict[str, str]] = None, schedule_interval_in_seconds: Optional[int] = None, cron_expression: Optional[str] = None, registry_credentials: Optional[str] = None, disable_schedule: Optional[bool] = None) → request_response[source]

Update an existing smart contract. The smart_contract_id and at least one optional parameter must be supplied.

Parameters
  • smart_contract_id (str) – id of the contract to update

  • image (str) – Docker image containing the smart contract logic

  • cmd (str) – Entrypoint command to run in the docker container

  • execution_order (str) – Order of execution. Valid values are ‘serial’ or ‘parallel’

  • enabled (bool, optional) – Enabled status of contract

  • args (list, optional) – List of arguments to the cmd field

  • environment_variables (dict, optional) – dict mapping of environment variables for your contract runtime

  • secrets (dict, optional) – dict mapping of secrets for your contract runtime

  • schedule_interval_in_seconds (int, optional) – The seconds of scheduled execution in seconds

  • cron_expression (str, optional) – The rate of scheduled execution specified as a cron

  • registry_credentials (str, optional) – basic-auth for pulling docker images, base64 encoded (e.g. username:password)

  • disable_schedule (bool, optional) – Set True to remove the existing schedule_interval_in_seconds or cron_expression from the contract

Raises

TypeError – with bad parameter types

Returns

Success or failure object