Skip to content

Commit d568aa5

Browse files
clemsosjulien51
andauthored
api returns allocator request params (#95)
* api returns allocator request params * Apply suggestions from code review --------- Co-authored-by: Julien Genestoux <[email protected]>
1 parent a9a1e7a commit d568aa5

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/api/requests/withdrawals/v1.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,33 @@ import { externalError } from "../../../common/error";
1414
import { logger } from "../../../common/logger";
1515
import { RequestHandlerService } from "../../../services/request-handler";
1616

17+
const SubmitWithdrawalRequestParamsSchema = Type.Object({
18+
chainId: Type.String({
19+
description: "The chain id of the allocator",
20+
}),
21+
depository: Type.String({
22+
description: "The depository address of the allocator",
23+
}),
24+
currency: Type.String({
25+
description: "The currency to withdraw",
26+
}),
27+
amount: Type.String({
28+
description: "The amount to withdraw",
29+
}),
30+
spender: Type.String({
31+
description: "The address of the spender",
32+
}),
33+
receiver: Type.String({
34+
description: "The address of the receiver on the depository chain",
35+
}),
36+
data: Type.String({
37+
description: "The data to include in the withdrawal request",
38+
}),
39+
nonce: Type.String({
40+
description: "The nonce to include in the withdrawal request",
41+
}),
42+
});
43+
1744
const Schema = {
1845
body: Type.Object({
1946
mode: Type.Optional(
@@ -39,6 +66,7 @@ const Schema = {
3966
description:
4067
"Signature attesting the owner authorized this particular withdrawal request",
4168
}),
69+
submitWithdrawalRequestParams: Type.Optional(SubmitWithdrawalRequestParamsSchema),
4270
additionalData: Type.Optional(
4371
Type.Object(
4472
{

src/services/request-handler/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ export class RequestHandlerService {
699699
return {
700700
id,
701701
encodedData,
702+
submitWithdrawalRequestParams: payloadParams,
702703
signature,
703704
signer:
704705
request.mode === "onchain"

0 commit comments

Comments
 (0)