Skip to content

Commit

Permalink
add get_max_send_amount
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangcongcobo committed Dec 5, 2023
1 parent b829902 commit d4f680e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions MPCClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -680,4 +680,19 @@ function retryDoubleCheck(string $requestId)

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

function getMaxSendAmount(string $coin, string $fee_rate, string $to_address, string $from_address = null)
{
$params = [
"coin" => $coin,
"fee_rate" => $fee_rate,
"to_address" => $to_address
];

if ($from_address) {
$params = array_merge($params, ["from_address" => $from_address]);
}

return $this->request("GET", "/v1/custody/mpc/get_max_send_amount/", $params);
}
}
9 changes: 9 additions & 0 deletions MPCClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,13 @@ public function testListTssNode()

$this->assertTrue($res->success);
}

public function testGetMaxSendAmount()
{
$coin = "GETH";
$to_address = "0xEEACb7a5e53600c144C0b9839A834bb4b39E540c";
$res = $this->mpcClient->getMaxSendAmount($coin, "0", $to_address);

$this->assertTrue($res->success);
}
}

0 comments on commit d4f680e

Please sign in to comment.