CC Lib
The following methods interact with Antara Modules that make use of the `-ac_cclib` parameter.
cclib
cclib insert_method insert_evalcode \"[%22json_string%22, json_integer, ... ]\"
The cclib
method allows the user to interact with the dynamic Antara Module associated with evalcode
.
Each evalcode
module has unique methods and json parameters associated, as well as unique responses.
cclib formatting
Arguments for cclib
methods are supplied as arrays. When executed in the terminal, the values for the array can be added in a normal fashion. However, when cclib
methods are executed as a part of a script, the shell cannot parse the arrays without additional formatting.
Array Formatting for Terminal
In the terminal, the array is bound by ''
single-quotation characters and strings are bound by ""
double-quotation characters.
Terminal format:
Array Formatting for Bash Scripts
In a bash-script, the array is bound by \"\"
escaped double-quotation characters and strings within the array are bound by %22 %22
characters. (0x22
is the ASCII encoding for "
.)
This format can be used in a terminal directly or in shell scripts, and therefore some developers may default to it, although the format is not always necessary.
Script format:
::: tip The cclibinfo method returns a complete list of available methods and their parameters for each unique evalcode
. :::
Arguments
Name
Type
Description
method
(string)
the unique name of the method
evalcode
(decimal number)
the EVALCODE
of the module of interest
json_params
(array)
the parameters to be supplied to the method, provided as an array
Response
Name
Type
Description
(the response for each EVALCODE
is different)
📌 Examples
Command:
<collapse-text hidden title="Response">
</collapse-text>
<!-- Need to find the correct way to issue the command from jl
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
<collapse-text hidden title="Response">
</collapse-text>
-->
cclibaddress
cclibaddress evalcode pubkey
The cclibaddress
method returns information about the addresses related to the specified pubkey
, and according to the Antara Module associated with the specified evalcode
. If no pubkey
is provided, the pubkey
used to the launch the daemon is the default.
Arguments
Name
Type
Description
evalcode
(decimal number)
the EVALCODE
of the module of interest
pubkey
(string, optional)
the public key related to the requested address information
Response
Name
Type
Description
result
(string)
whether the command executed successfully
CClibCCAddress
(string)
taking the parameter evalcode
as a modifier, this is the public address that corresponds to the Antara Module's privkey
CCbalance
(number)
the amount of coins in the CClibCCAddress
CClibNormalAddress
(string)
the unmodified public address generated from the Antara Module's privkey
CClibCCTokensAddress
(string)
this property is used for development purposes only and can otherwise be ignored
myAddress
(string)
the normal address generated from the pubkey
myCCAddress(CClib)
(string)
taking the parameter evalcode
as a modifier, this is the public address that corresponds to the pubkey
PubkeyCCaddress(CClib)
(string)
taking the parameter evalcode
as a modifier, this is the public address that corresponds to the pubkey
myCCaddress
(string)
taking the parameter evalcode
as a modifier, this is the public address that corresponds to the pubkey
myCCbalance
(number)
the amount of coins in myCCaddress
mybalance
(number)
the amount of coins in myAddress
📌 Examples
Command:
<collapse-text hidden title="Response">
</collapse-text>
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
<collapse-text hidden title="Response">
</collapse-text>
cclibinfo
cclibinfo
The cclibinfo
method displays all the methods of all the modules that are available in the current library.
The library is loaded at runtime using the -ac_cclib parameter.
Arguments
Name
Type
Description
(none)
Response
Name
Type
Description
result
(string)
whether the command executed successfully
CClib
(string)
the name of the given CClibrary
methods
(array of json objects)
an array containing json objects, each of which describe a method of a module
evalcode
(decimal number)
the EVALCODE
of the given Antara Module
funcid
(character)
this value is a mnemonic in the OP_RETURN
for all generated transactions; if the provided method does not generate a transaction, this value is a single character that has no relevant meaning
name
(string)
the name of the Antara module
method
(string)
the name of the method
help
(string)
help for the method, including a description of the method's arguments
params_required
(decimal number)
the number of parameters that are required for the method to succeed
params_max
(decimal number)
the maximum number of parameters the method can accept
📌 Examples
Command:
<collapse-text hidden title="Response">
</collapse-text>
You can find your rpcuser
, rpcpassword
, and rpcport
in the coin's .conf
file.
Command:
<collapse-text hidden title="Response">
</collapse-text>
Last updated
Was this helpful?