Skip to content

Commit

Permalink
add babylon unbonding&withdraw interface
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangcongcobo committed Aug 27, 2024
1 parent 80bc0b0 commit 33ffe13
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions MPCClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,37 @@ function babylonDropStaking(string $requestId, string $relatedRequestId, string
return $this->request("POST", "/v1/custody/mpc/babylon/drop_staking/", $params);
}

function babylonUnbonding(string $requestId, string $stakingRequestId)
{
$params = [
"request_id" => $requestId,
"staking_request_id" => $stakingRequestId,
];

return $this->request("POST", "/v1/custody/mpc/babylon/unbonding/", params);
}


function babylonWithdraw(string $requestId, string $feeRate, BigInteger $maxFeeAmount=null, string $unbondingRequestId=null, string $stakingRequestId=null)
{
$params = [
"request_id" => $requestId,
"fee_rate" => $feeRate,
];

if ($maxFeeAmount) {
$params = array_merge($params, ["max_fee_amount" => $maxFeeAmount]);
}
if ($unbondingRequestId) {
$params = array_merge($params, ["unbonding_request_id" => $unbondingRequestId]);
}
if ($stakingRequestId) {
$params = array_merge($params, ["staking_request_id" => $stakingRequestId]);
}
return $this->request("POST", "/v1/custody/mpc/babylon/withdraw/", params);
}


function babylonBroadcastStakingTransaction(string $requestId)
{
$params = [
Expand Down

0 comments on commit 33ffe13

Please sign in to comment.