Log
One of the features provided by the Contract module, Log allows users to record any and all events that happen in the process of closing a contract, on the chain network as transactions. Additionally, users can search logs that are recorded on ContractHash.
Contents
This feature allows users to record events, actions or results that happen in the process of writing a contract on the chain network.
This feature inquires logs that are recorded on the chain using the log ID.
This feature checks all logs that are recorded on the chain network.
This feature estimates gas fee required
to execute the addContractLog transaction.
This feature checks all logs that are registered on the hash.
Parameters required to call API.
1. addContractLog
This function allows users to record events, actions and results that happen in the process of closing a contract on the chain network as transactions. When running this function, transactions are created on the chain based on the predesignated parameters of this function. Users can get a visual confirmation of the result of this function on the FirmaChain block explorer by using the “transactionHash” value of the “Return value”.
Parameters
wallet
Object (FirmaWalletService)
contractHash
String
"da39330a6dfd90a91563603950f742240fa222580beecf36e141fe6410184e8b1669119707"
timeStamp
Number
1669182016039
eventName
String
"createContract"
ownerAddress
String
"firma1nssuz67am2uwc2hjgvphg0fmj3k9l6cx65ux9u"
jsonString
String (JSON)
"{Encryption:{type:"JWT",alg:"HS256"},contracts:[{target:"contractor1",email:"contractor1@gmail.com"}]}"
txMisc (Not required)
Object (TxMisc)
{fee:200000,gas:163821,memo:"custom message"}
Return value
2. getContractLog
This feature allows users to inquire logs that happen in the process of closing a contract. Inquiries are made using the logId, and users can check the transaction information in the addContractLog. * transactionHash information are not included.
Paramters
logId
String (Number)
"6792"
Return value
3. getContractLogAll
This function checks all contract related logs recorded on the chain network. Since this functions goes through all recorded logs on the chain network, using this function might cause serious network delays. Therefore, we do not recommend the universal application of this feature when developing real services. Rather, we recommend developers to apply this feature only to obtain an overall tally of the recorded log data.
Parameters
paginationKey (Not required)
String | Undefined
"AAAAAAAAAGQ="
Return value
4. getGasEstimationAddContractLog
This feature calculates the gas fee that is generated when running the function that creates addContractLog transactions. Used as the last parameter of the addContractLog function, we recommend developers to pay the transaction fees using this function.
Parameters
wallet
Object (FirmaWalletService)
contractHash
String
"da39330a6dfd90a91563603950f742240fa222580beecf36e141fe6410184e8b1669119707"
timeStamp
Number
1669182016039
eventName
String
"createContract"
ownerAddress
String
"firma1nssuz67am2uwc2hjgvphg0fmj3k9l6cx65ux9u"
jsonString
String (JSON)
"{Encryption:{type:"JWT",alg:"HS256"},contracts:[{target:"contractor1",email:"contractor1@gmail.com"}]}"
Return value
5. getContractListFromHash
Parameters
contractHash
String
"da39330a6dfd90a91563603950f742240fa222580beecf36e141fe6410184e8b1669119707"
Return value
6. Parameter Description
wallet
Unique wallet parameter created from the user’s Mnemonic. This parameter can be called by using the Wallet.fromMnemonic function from the FirmaSDK module.
contractHash
This parameter contains the mapped information of a file or a text to a predesignated length. This information can be used to track Contract on the network and allows developers to add multiple Logs to a single Contract Hash. Using the FirmaUtil, developers can call the hash value of a file or a text and we recommend developers to use the unique value.
timeStamp
This parameter timestamps a certain event, action or a result. This parameter is displayed as the "Unix time stamp" format and must be written in numbers.
eventName
This parameter contains information related to a certain event, action or a result. For instance, looking at the life cycle of a contract, this parameter can be devided into “Contract Creation”, “Invite Signatories”, “Sign”, “All Signatues Received” and “Contract Complete”.
ownerAddress
For this parameter, please enter your FirmaChain wallet address. The owner of the wallet can be anyone. (e.g. “Service Wallet Address” or “Signatory’s Wallet Address”)
jsonString
This parameter contains additional information related to a contract. Additional information for instance, includes, public key (encrypted), location of the saved contract, contract download link or the e-mail address of the owner of the contract. Please write this parameter as JSON text format. * There are no set standard so please customize this parameter to suit the purpose of your project.
txMisc
This object contains the gas fee that is deducted when a transaction is called upon.
* The default gas fee is set at 0.02fct.
logId
This parameter contains the Unique ID value of the addContractLog recorded on the chain network. Developers can search the Log registered under a certain ID.
paginationKey
This parameter fetches all logs when the getContractLogAll is inquired. Once the number of log exceeds 100, this parameter is used to inquire data starting with the 101st data set.
Last updated