DepositManager
The DepositManager subclass provides methods for initiating and checking the status of cross-chain transfers through Hyphen.
Usage: hyphen.depositManager
Methods
Methods
preDepositCheck(checkStatusRequest)
preDepositCheck(checkStatusRequest)
Performs the required status checks before doing a cross-chain transaction. Recommended to call before performing any cross-chain transaction.
Arguments
Returns a Promise which resolves to an object with the following keys:
1. code
: a number of type hyphen.RESPONSE_CODES
, as given below
Code | Status |
---|---|
144 | OK |
145 | ALREADY_EXISTS |
146 | UNSUPPORTED_TOKEN |
148 | NO_LIQUIDITY |
149 | UNSUPPORTED_NETWORK |
150 | ALLOWANCE_NOT_GIVEN |
200 | SUCCESS |
400 | BAD_REQUEST |
500 | ERROR_RESPONSE |
2. message
: a string representing the status
deposit(request, wallet?)
deposit(request, wallet?)
Initiates a cross-chain transfer.
Arguments
Returns
Promise<TransactionResponse | undefined>
: TransactionResponse of the deposit transaction on fromChain.
checkDepositStatus(depositRequest)
checkDepositStatus(depositRequest)
Checks and returns the status of a given deposit transaction
Arguments
Returns: a Promise resolving to an object with the following parameters:
getTransferFee(request)
getTransferFee(request)
Returns the transfer fee for a given token and amount.
Arguments
Type - GetTransferFeeRequest
Returns: a Promise resolving to a GetTransferFeeResponse
object with the following parameters:
Last updated