File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
src/server/routes/contract/extensions Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
erc721ContractParamSchema ,
12
12
standardResponseSchema ,
13
13
} from "../../../../../schemas/sharedApiSchemas" ;
14
+ import { walletAuthSchema } from "../../../../../schemas/wallet" ;
14
15
import { getChainIdFromChain } from "../../../../../utils/chain" ;
15
16
import { checkAndReturnNFTSignaturePayload } from "../../../../../utils/validator" ;
16
17
@@ -47,6 +48,7 @@ export async function erc1155SignatureGenerate(fastify: FastifyInstance) {
47
48
operationId : "signatureGenerate" ,
48
49
params : requestSchema ,
49
50
body : requestBodySchema ,
51
+ headers : walletAuthSchema ,
50
52
response : {
51
53
...standardResponseSchema ,
52
54
[ StatusCodes . OK ] : responseSchema ,
@@ -67,10 +69,16 @@ export async function erc1155SignatureGenerate(fastify: FastifyInstance) {
67
69
royaltyRecipient,
68
70
uid,
69
71
} = request . body ;
72
+ const walletAddress = request . headers [
73
+ "x-backend-wallet-address"
74
+ ] as string ;
75
+ const accountAddress = request . headers [ "x-account-address" ] as string ;
70
76
const chainId = await getChainIdFromChain ( chain ) ;
71
77
const contract = await getContract ( {
72
78
chainId,
73
79
contractAddress,
80
+ walletAddress,
81
+ accountAddress,
74
82
} ) ;
75
83
76
84
const payload = checkAndReturnNFTSignaturePayload <
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
erc721ContractParamSchema ,
12
12
standardResponseSchema ,
13
13
} from "../../../../../schemas/sharedApiSchemas" ;
14
+ import { walletAuthSchema } from "../../../../../schemas/wallet" ;
14
15
import { getChainIdFromChain } from "../../../../../utils/chain" ;
15
16
import { checkAndReturnERC20SignaturePayload } from "../../../../../utils/validator" ;
16
17
@@ -47,6 +48,7 @@ export async function erc20SignatureGenerate(fastify: FastifyInstance) {
47
48
operationId : "signatureGenerate" ,
48
49
params : requestSchema ,
49
50
body : requestBodySchema ,
51
+ headers : walletAuthSchema ,
50
52
response : {
51
53
...standardResponseSchema ,
52
54
[ StatusCodes . OK ] : responseSchema ,
@@ -67,11 +69,13 @@ export async function erc20SignatureGenerate(fastify: FastifyInstance) {
67
69
const walletAddress = request . headers [
68
70
"x-backend-wallet-address"
69
71
] as string ;
72
+ const accountAddress = request . headers [ "x-account-address" ] as string ;
70
73
const chainId = await getChainIdFromChain ( chain ) ;
71
74
const contract = await getContract ( {
72
75
chainId,
73
76
contractAddress,
74
77
walletAddress,
78
+ accountAddress,
75
79
} ) ;
76
80
77
81
const payload = checkAndReturnERC20SignaturePayload <
Original file line number Diff line number Diff line change @@ -96,11 +96,13 @@ export async function erc721SignatureGenerate(fastify: FastifyInstance) {
96
96
const walletAddress = request . headers [
97
97
"x-backend-wallet-address"
98
98
] as string ;
99
+ const accountAddress = request . headers [ "x-account-address" ] as string ;
99
100
const chainId = await getChainIdFromChain ( chain ) ;
100
101
const contract = await getContract ( {
101
102
chainId,
102
103
contractAddress,
103
104
walletAddress,
105
+ accountAddress,
104
106
} ) ;
105
107
106
108
const payload = checkAndReturnNFTSignaturePayload <
You can’t perform that action at this time.
0 commit comments