Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@ export abstract class BaseTNClient<T extends EnvironmentType> {
* @param amount The amount to withdraw
* @returns Promise that resolves to the transaction hash, or throws on error
*/
async withdraw(chain: string, amount: string): Promise<string> {
async withdraw(chain: string, amount: string, recipient: string): Promise<string> {
const action = this.loadAction();

// Bridge tokens in a single operation
const bridgeResult = await action.bridgeTokens(chain, amount);
const bridgeResult = await action.bridgeTokens(chain, amount, recipient);
if (!bridgeResult.data?.tx_hash) {
throw new Error("Bridge tokens operation failed: no transaction hash returned");
}
Expand Down
6 changes: 4 additions & 2 deletions src/contracts-api/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,8 @@ export class Action {
*/
public async bridgeTokens(
chain: string,
amount: string
amount: string,
recipient: string
): Promise<Types.GenericResponse<Types.TxReceipt>> {
// Validate amount is greater than 0
const numAmount = parseFloat(amount);
Expand All @@ -1025,7 +1026,8 @@ export class Action {
}

return await this.executeWithNamedParams(`${chain}_bridge_tokens`, [{
$amount: amount,
$recipient: recipient,
$amount: amount
}]);
}
}
Loading