Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
[BRIDGES-1243] recipient address is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
PoOwAa committed Sep 11, 2023
1 parent 9e250cb commit 36f91fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/bridgedWithdraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const endpoint = '/v1/trading/bridgedWithdrawals'
module.exports = async (dvf, data, authNonce, signature) => {
const { chain, token, amount, nonce, recipientEthAddress } = validateArg0(data)

const payload = await dvf.createBridgedWithdrawalPayload({ chain, token, amount, nonce, recipientEthAddress }, authNonce, signature)
const payload = await dvf.createBridgedWithdrawalPayload({ chain, token, amount, nonce, ...(recipientEthAddress && {recipientEthAddress}) }, authNonce, signature)

// Force the use of header (instead of payload) for authentication.
dvf = FP.set('config.useAuthHeader', true, dvf)
Expand Down
4 changes: 2 additions & 2 deletions src/lib/dvf/createBridgedWithdrawalPayload.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ module.exports = async (dvf, data, authNonce, signature) => {
chain,
token,
amount: quantisedAmount,
recipientEthAddress,
tx,
nonce: nonce || generateRandomNonceV2()
nonce: nonce || generateRandomNonceV2(),
...(recipientEthAddress && { recipientEthAddress }), // optional parameter
}
}

0 comments on commit 36f91fa

Please sign in to comment.