Certificate of Deposit Client
Last updated
Was this helpful?
Last updated
Was this helpful?
The CertificateOfDepositClient
class extends ContractEngine
to interact with a specific smart contract implementation for a Certificate of Deposit on the Stellar network. It implements methods for managing deposits, withdrawals, and fetching contract-related data.
Parameters:
contractId
: Contract ID of the deployed contract.
network
: Network configuration.
rpcHandler
: RPC handler for interactions.
Purpose: Initializes the client with the necessary configurations to interact with the Certificate of Deposit contract.
Purpose: Deposits assets into the contract.
Parameters:
address
: Account address making the deposit.
amount
: Deposit amount.
signers
: Authorizing signers.
header
: Transaction header.
feeBump
: Optional fee bump.
Purpose: Withdraws assets from the contract.
Parameters:
address
: Account address withdrawing assets.
acceptPrematureWithdraw
: Flag for premature withdrawal acceptance.
signers
: Authorizing signers.
header
: Transaction header.
feeBump
: Optional fee bump.
Purpose: Fetches estimated yield.
Parameters:
address
: Account address.
header
: Transaction header.
Purpose: Retrieves current position.
Parameters:
address
: Account address.
header
: Transaction header.
Purpose: Estimates premature withdrawal amount.
Parameters:
address
: Account address.
header
: Transaction header.
Purpose: Determines time left for penalty-free withdrawal.
Parameters:
address
: Account address.
header
: Transaction header.
Purpose: Initializes contract state.
Parameters:
admin
, asset
, term
, compoundStep
, yieldRate
, minDeposit
, penaltyRate
, allowancePeriod
: Contract parameters.
signers
: Authorizing signers.
header
: Transaction header.
feeBump
: Optional fee bump.
This class provides a structured and convenient way to interact with the Certificate of Deposit contract on the Stellar network, encapsulating complex contract interactions into simpler method calls.