BlockchainContractValue (for bloxberg)
BlockchainContractValue[caddr,func]
calls the function func of a contract with address caddr.
BlockchainContractValue[caddr,assoc]
calls a contract with address caddr with the properties defined in Association assoc.
Details
- Gives basic information about a bloxberg contract. By default, it targets the state of the latest block.
- BlockchainContractValue has option BlockchainBase with default value $BlockchainBase.
- BlockchainContractValue extracts a contract from the bloxberg blockchain, then runs the specified function in it. It cannot write data to a blockchain; this requires BlockchainTransactionSubmit.
- BlockchainContractValue[caddr,func] calls a contract where func must be a Typed expression defining the name of the function and the output data type.
- BlockchainContractValue[caddr,assoc] calls a contract with additional parameters where association assoc must have the following property:
-
"Function" Typed expression defining the function to call - Additionally, the association assoc can also have the following properties:
-
"Inputs" input parameters of the function to call "Sender" address of the sender that is calling the contract "BlockNumber" block number associated to a specific state of the blockchain - If a particular function does not successfully evaluate in the contract at a given address, BlockchainContractValue returns Missing["NoResult"].
Examples
open all close allBasic Examples (1)
Call the functions owner, relayedSet and getValidators, given an address:
address = "9850711951a84ef8a2a31a7868d0dca34b0661ca";BlockchainContractValue[address, Typed["owner", "address"], BlockchainBase -> "Bloxberg"]BlockchainContractValue[address, Typed["relayedSet", "address"], BlockchainBase -> "Bloxberg"]validators = BlockchainContractValue[address, Typed["getValidators", "address[]"], BlockchainBase -> "Bloxberg"];BlockchainContractValue[address, <|"Function" -> Typed["getValidators", "address[]"], "BlockNumber" -> #|>, BlockchainBase -> "Bloxberg"]& /@ {100, 1000000, 2000000}//ColumnSee Also
Blockchains: BlockchainTransaction BlockchainTokenData BlockchainData BlockchainBlockData BlockchainTransactionData
Related Guides
History
Introduced in 2020 (12.1)
Text
Wolfram Research (2020), BlockchainContractValue, Wolfram Language function, https://reference.wolfram.com/language/ref/blockchain/BlockchainContractValue-bloxberg.html.
CMS
Wolfram Language. 2020. "BlockchainContractValue." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/blockchain/BlockchainContractValue-bloxberg.html.
APA
Wolfram Language. (2020). BlockchainContractValue. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/blockchain/BlockchainContractValue-bloxberg.html
BibTeX
@misc{reference.wolfram_2026_blockchaincontractvalue, author="Wolfram Research", title="{BlockchainContractValue}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/blockchain/BlockchainContractValue-bloxberg.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_blockchaincontractvalue, organization={Wolfram Research}, title={BlockchainContractValue}, year={2020}, url={https://reference.wolfram.com/language/ref/blockchain/BlockchainContractValue-bloxberg.html}, note=[Accessed: 13-June-2026]}