Skip to content

Commit 1eeaa5a

Browse files
authored
fix: make currency optional in transfer (#654)
* fix: make currency optional in transfer * conflict
1 parent 044500b commit 1eeaa5a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/server/routes/backend-wallet/transfer.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Static, Type } from "@sinclair/typebox";
2-
import { constants } from "ethers";
32
import { FastifyInstance } from "fastify";
43
import { StatusCodes } from "http-status-codes";
54
import {
@@ -38,12 +37,12 @@ const requestBodySchema = Type.Object({
3837
...AddressSchema,
3938
description: "The recipient wallet address.",
4039
},
41-
currencyAddress: {
40+
currencyAddress: Type.Optional({
4241
...AddressSchema,
4342
examples: [constants.AddressZero],
4443
description:
4544
"The token address to transfer. Omit to transfer the chain's native currency (e.g. ETH on Ethereum).",
46-
},
45+
}),
4746
amount: Type.String({
4847
description:
4948
'The amount in ether to transfer. Example: "0.1" to send 0.1 ETH.',
@@ -80,7 +79,7 @@ export async function transfer(fastify: FastifyInstance) {
8079
const {
8180
to,
8281
amount,
83-
currencyAddress: _currencyAddress,
82+
currencyAddress: _currencyAddress = ZERO_ADDRESS,
8483
txOverrides,
8584
} = request.body;
8685
const {

0 commit comments

Comments
 (0)