Scorum
|
Wallet Atomic Swap API. More...
Functions | |
atomicswap_contract_result_api_obj | scorum::wallet::wallet_api::atomicswap_initiate (const std::string &initiator, const std::string &participant, const asset &amount, const std::string &metadata, const uint8_t secret_length, bool broadcast) |
atomicswap_contract_result_api_obj | scorum::wallet::wallet_api::atomicswap_participate (const std::string &secret_hash, const std::string &participant, const std::string &initiator, const asset &amount, const std::string &metadata, bool broadcast) |
atomicswap_contract_info_api_obj | scorum::wallet::wallet_api::atomicswap_auditcontract (const std::string &from, const std::string &to, const std::string &secret_hash) |
annotated_signed_transaction | scorum::wallet::wallet_api::atomicswap_redeem (const std::string &from, const std::string &to, const std::string &secret, bool broadcast) |
std::string | scorum::wallet::wallet_api::atomicswap_extractsecret (const std::string &from, const std::string &to, const std::string &secret_hash) |
annotated_signed_transaction | scorum::wallet::wallet_api::atomicswap_refund (const std::string &participant, const std::string &initiator, const std::string &secret_hash, bool broadcast) |
std::vector< atomicswap_contract_api_obj > | scorum::wallet::wallet_api::get_atomicswap_contracts (const std::string &owner) |
Wallet Atomic Swap API.
atomicswap_contract_info_api_obj scorum::wallet::wallet_api::atomicswap_auditcontract | ( | const std::string & | from, |
const std::string & | to, | ||
const std::string & | secret_hash | ||
) |
The Atomic Swap helper to get contract info.
from | the transfer 'from' address |
to | the transfer 'to' address |
secret_hash | the secret hash |
Definition at line 3173 of file wallet.cpp.
std::string scorum::wallet::wallet_api::atomicswap_extractsecret | ( | const std::string & | from, |
const std::string & | to, | ||
const std::string & | secret_hash | ||
) |
Extracting secret from participant contract if it is redeemed by initiator.
from | the transfer 'from' address |
to | the transfer 'to' address |
secret_hash | the secret hash |
Definition at line 3179 of file wallet.cpp.
atomicswap_contract_result_api_obj scorum::wallet::wallet_api::atomicswap_initiate | ( | const std::string & | initiator, |
const std::string & | participant, | ||
const asset & | amount, | ||
const std::string & | metadata, | ||
const uint8_t | secret_length, | ||
bool | broadcast | ||
) |
Initiating Atomic Swap transfer from initiator to participant.
Asset (amount) will be locked for 48 hours while is not redeemed or refund automatically by timeout.
initiator | the new contract owner |
participant | |
amount | SCR to transfer |
metadata | the additional contract info (obligations, courses) |
secret_length | the length of secret in bytes or 0 to choose length randomly |
broadcast | true if you wish to broadcast the transaction |
Definition at line 3091 of file wallet.cpp.
atomicswap_contract_result_api_obj scorum::wallet::wallet_api::atomicswap_participate | ( | const std::string & | secret_hash, |
const std::string & | participant, | ||
const std::string & | initiator, | ||
const asset & | amount, | ||
const std::string & | metadata, | ||
bool | broadcast | ||
) |
Initiating Atomic Swap transfer from participant to initiator.
Asset (amount) will be locked for 24 hours while is not redeemed or refund before redeem.
secret_hash | the secret hash (received from initiator) |
participant | the new contract owner |
initiator | |
amount | SCR to transfer |
metadata | the additional contract info (obligations, courses) |
broadcast | true if you wish to broadcast the transaction |
Definition at line 3125 of file wallet.cpp.
annotated_signed_transaction scorum::wallet::wallet_api::atomicswap_redeem | ( | const std::string & | from, |
const std::string & | to, | ||
const std::string & | secret, | ||
bool | broadcast | ||
) |
Redeeming Atomic Swap contract.
This API transfers asset to participant balance and declassifies the secret.
from | the transfer 'from' address |
to | the transfer 'to' address |
secret | the secret ("my secret") that was set in atomicswap_initiate |
broadcast | true if you wish to broadcast the transaction |
Definition at line 3152 of file wallet.cpp.
annotated_signed_transaction scorum::wallet::wallet_api::atomicswap_refund | ( | const std::string & | participant, |
const std::string & | initiator, | ||
const std::string & | secret_hash, | ||
bool | broadcast | ||
) |
Refunding contact by participant.
participant | the refunded contract owner |
initiator | the initiator of Atomic Swap |
secret_hash | the secret hash (that was set in atomicswap_participate) |
broadcast | true if you wish to broadcast the transaction |
Definition at line 3189 of file wallet.cpp.
std::vector< atomicswap_contract_api_obj > scorum::wallet::wallet_api::get_atomicswap_contracts | ( | const std::string & | owner | ) |
Atomic Swap helper to get list of contract info.
owner |
Definition at line 3209 of file wallet.cpp.