Skip to content

Commit c1862b0

Browse files
committed
updated wallet schema naming
1 parent d197b58 commit c1862b0

File tree

87 files changed

+259
-265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+259
-265
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
transactionWritesResponseSchema,
99
} from "../../schemas/sharedApiSchemas";
1010
import { txOverridesSchema } from "../../schemas/txOverrides";
11-
import { backendWalletHeaderSchema } from "../../schemas/wallet";
11+
import { walletHeaderSchema } from "../../schemas/wallet";
1212
import { getChainIdFromChain } from "../../utils/chain";
1313

1414
const ParamsSchema = Type.Object({
@@ -57,7 +57,7 @@ export async function sendTransaction(fastify: FastifyInstance) {
5757
operationId: "sendTransaction",
5858
params: ParamsSchema,
5959
body: requestBodySchema,
60-
headers: backendWalletHeaderSchema,
60+
headers: walletHeaderSchema,
6161
querystring: requestQuerystringSchema,
6262
response: {
6363
...standardResponseSchema,
@@ -71,7 +71,7 @@ export async function sendTransaction(fastify: FastifyInstance) {
7171
const {
7272
"x-backend-wallet-address": fromAddress,
7373
"x-idempotency-key": idempotencyKey,
74-
} = request.headers as Static<typeof backendWalletHeaderSchema>;
74+
} = request.headers as Static<typeof walletHeaderSchema>;
7575
const chainId = await getChainIdFromChain(chain);
7676

7777
const { id: queueId } = await queueTxRaw({

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { v4 } from "uuid";
55
import { prisma } from "../../../db/client";
66
import { standardResponseSchema } from "../../schemas/sharedApiSchemas";
77
import { txOverridesWithValueSchema } from "../../schemas/txOverrides";
8-
import { backendWalletHeaderSchema } from "../../schemas/wallet";
8+
import { walletHeaderSchema } from "../../schemas/wallet";
99
import { getChainIdFromChain } from "../../utils/chain";
1010

1111
const ParamsSchema = Type.Object({
@@ -52,7 +52,7 @@ export async function sendTransactionBatch(fastify: FastifyInstance) {
5252
operationId: "sendTransactionBatch",
5353
params: ParamsSchema,
5454
body: requestBodySchema,
55-
headers: backendWalletHeaderSchema,
55+
headers: walletHeaderSchema,
5656
response: {
5757
...standardResponseSchema,
5858
[StatusCodes.OK]: responseBodySchema,
@@ -63,7 +63,7 @@ export async function sendTransactionBatch(fastify: FastifyInstance) {
6363
const txs = request.body;
6464
// The batch endpoint does not support idempotency keys.
6565
const { "x-backend-wallet-address": fromAddress } =
66-
request.headers as Static<typeof backendWalletHeaderSchema>;
66+
request.headers as Static<typeof walletHeaderSchema>;
6767
const chainId = await getChainIdFromChain(chain);
6868

6969
const groupId = v4();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FastifyInstance } from "fastify";
44
import { StatusCodes } from "http-status-codes";
55
import { getWallet } from "../../../utils/cache/getWallet";
66
import { standardResponseSchema } from "../../schemas/sharedApiSchemas";
7-
import { backendWalletHeaderSchema } from "../../schemas/wallet";
7+
import { walletHeaderSchema } from "../../schemas/wallet";
88

99
const requestBodySchema = Type.Object({
1010
message: Type.String(),
@@ -28,7 +28,7 @@ export async function signMessage(fastify: FastifyInstance) {
2828
tags: ["Backend Wallet"],
2929
operationId: "signMessage",
3030
body: requestBodySchema,
31-
headers: backendWalletHeaderSchema,
31+
headers: walletHeaderSchema,
3232
response: {
3333
...standardResponseSchema,
3434
[StatusCodes.OK]: responseBodySchema,
@@ -37,7 +37,7 @@ export async function signMessage(fastify: FastifyInstance) {
3737
handler: async (request, reply) => {
3838
const { message, isBytes } = request.body;
3939
const { "x-backend-wallet-address": walletAddress } =
40-
request.headers as Static<typeof backendWalletHeaderSchema>;
40+
request.headers as Static<typeof walletHeaderSchema>;
4141

4242
const wallet = await getWallet({
4343
chainId: 1,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { FastifyInstance } from "fastify";
33
import { StatusCodes } from "http-status-codes";
44
import { getWallet } from "../../../utils/cache/getWallet";
55
import { standardResponseSchema } from "../../schemas/sharedApiSchemas";
6-
import { backendWalletHeaderSchema } from "../../schemas/wallet";
6+
import { walletHeaderSchema } from "../../schemas/wallet";
77

88
const requestBodySchema = Type.Object({
99
transaction: Type.Object({
@@ -41,7 +41,7 @@ export async function signTransaction(fastify: FastifyInstance) {
4141
tags: ["Backend Wallet"],
4242
operationId: "signTransaction",
4343
body: requestBodySchema,
44-
headers: backendWalletHeaderSchema,
44+
headers: walletHeaderSchema,
4545
response: {
4646
...standardResponseSchema,
4747
[StatusCodes.OK]: responseBodySchema,
@@ -50,7 +50,7 @@ export async function signTransaction(fastify: FastifyInstance) {
5050
handler: async (request, reply) => {
5151
const { transaction } = request.body;
5252
const { "x-backend-wallet-address": walletAddress } =
53-
request.headers as Static<typeof backendWalletHeaderSchema>;
53+
request.headers as Static<typeof walletHeaderSchema>;
5454

5555
const wallet = await getWallet({
5656
chainId: 1,

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FastifyInstance } from "fastify";
44
import { StatusCodes } from "http-status-codes";
55
import { getWallet } from "../../../utils/cache/getWallet";
66
import { standardResponseSchema } from "../../schemas/sharedApiSchemas";
7-
import { backendWalletHeaderSchema } from "../../schemas/wallet";
7+
import { walletHeaderSchema } from "../../schemas/wallet";
88

99
const requestBodySchema = Type.Object({
1010
domain: Type.Object({}, { additionalProperties: true }),
@@ -29,7 +29,7 @@ export async function signTypedData(fastify: FastifyInstance) {
2929
tags: ["Backend Wallet"],
3030
operationId: "signTypedData",
3131
body: requestBodySchema,
32-
headers: backendWalletHeaderSchema,
32+
headers: walletHeaderSchema,
3333
response: {
3434
...standardResponseSchema,
3535
[StatusCodes.OK]: responseBodySchema,
@@ -38,7 +38,7 @@ export async function signTypedData(fastify: FastifyInstance) {
3838
handler: async (request, reply) => {
3939
const { domain, value, types } = request.body;
4040
const { "x-backend-wallet-address": walletAddress } =
41-
request.headers as Static<typeof backendWalletHeaderSchema>;
41+
request.headers as Static<typeof walletHeaderSchema>;
4242

4343
const wallet = await getWallet({ chainId: 1, walletAddress });
4444

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
simulateResponseSchema,
77
standardResponseSchema,
88
} from "../../schemas/sharedApiSchemas";
9-
import { backendWalletWithAAHeaderSchema } from "../../schemas/wallet";
9+
import { walletWithAAHeaderSchema } from "../../schemas/wallet";
1010
import { getChainIdFromChain } from "../../utils/chain";
1111
import { SimulateTxParams, simulateTx } from "../../utils/simulateTx";
1212

@@ -68,7 +68,7 @@ export async function simulateTransaction(fastify: FastifyInstance) {
6868
operationId: "simulateTransaction",
6969
params: ParamsSchema,
7070
body: simulateRequestBodySchema,
71-
headers: backendWalletWithAAHeaderSchema,
71+
headers: walletWithAAHeaderSchema,
7272
response: {
7373
...standardResponseSchema,
7474
[StatusCodes.OK]: simulateResponseSchema,
@@ -81,7 +81,7 @@ export async function simulateTransaction(fastify: FastifyInstance) {
8181
const {
8282
"x-backend-wallet-address": walletAddress,
8383
"x-account-address": accountAddress,
84-
} = request.headers as Static<typeof backendWalletWithAAHeaderSchema>;
84+
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
8585
const chainId = await getChainIdFromChain(chain);
8686

8787
// Get decoded tx simulate args

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ import {
1818
transactionWritesResponseSchema,
1919
} from "../../schemas/sharedApiSchemas";
2020
import { txOverridesWithValueSchema } from "../../schemas/txOverrides";
21-
import {
22-
backendWalletHeaderSchema,
23-
walletParamSchema,
24-
} from "../../schemas/wallet";
21+
import { walletHeaderSchema, walletParamSchema } from "../../schemas/wallet";
2522
import { getChainIdFromChain } from "../../utils/chain";
2623

2724
// INPUTS
@@ -57,7 +54,7 @@ export async function transfer(fastify: FastifyInstance) {
5754
operationId: "transfer",
5855
params: requestSchema,
5956
body: requestBodySchema,
60-
headers: backendWalletHeaderSchema,
57+
headers: walletHeaderSchema,
6158
querystring: requestQuerystringSchema,
6259
response: {
6360
...standardResponseSchema,
@@ -70,7 +67,7 @@ export async function transfer(fastify: FastifyInstance) {
7067
const {
7168
"x-backend-wallet-address": walletAddress,
7269
"x-idempotency-key": idempotencyKey,
73-
} = request.headers as Static<typeof backendWalletHeaderSchema>;
70+
} = request.headers as Static<typeof walletHeaderSchema>;
7471
const { simulateTx } = request.query;
7572
const chainId = await getChainIdFromChain(chain);
7673
const sdk = await getSdk({ chainId, walletAddress });

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import {
66
standardResponseSchema,
77
transactionWritesResponseSchema,
88
} from "../../schemas/sharedApiSchemas";
9-
import {
10-
backendWalletHeaderSchema,
11-
walletParamSchema,
12-
} from "../../schemas/wallet";
9+
import { walletHeaderSchema, walletParamSchema } from "../../schemas/wallet";
1310
import { getChainIdFromChain } from "../../utils/chain";
1411

1512
const ParamsSchema = Type.Omit(walletParamSchema, ["walletAddress"]);
@@ -35,7 +32,7 @@ export async function withdraw(fastify: FastifyInstance) {
3532
operationId: "withdraw",
3633
params: ParamsSchema,
3734
body: requestBodySchema,
38-
headers: backendWalletHeaderSchema,
35+
headers: walletHeaderSchema,
3936
response: {
4037
...standardResponseSchema,
4138
[StatusCodes.OK]: transactionWritesResponseSchema,
@@ -47,7 +44,7 @@ export async function withdraw(fastify: FastifyInstance) {
4744
const {
4845
"x-backend-wallet-address": walletAddress,
4946
"x-idempotency-key": idempotencyKey,
50-
} = request.headers as Static<typeof backendWalletHeaderSchema>;
47+
} = request.headers as Static<typeof walletHeaderSchema>;
5148

5249
const chainId = await getChainIdFromChain(chain);
5350

src/server/routes/contract/extensions/account/write/grantAdmin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
transactionWritesResponseSchema,
1111
} from "../../../../../schemas/sharedApiSchemas";
1212
import { txOverridesWithValueSchema } from "../../../../../schemas/txOverrides";
13-
import { backendWalletWithAAHeaderSchema } from "../../../../../schemas/wallet";
13+
import { walletWithAAHeaderSchema } from "../../../../../schemas/wallet";
1414
import { getChainIdFromChain } from "../../../../../utils/chain";
1515

1616
const requestBodySchema = Type.Object({
@@ -40,7 +40,7 @@ export const grantAdmin = async (fastify: FastifyInstance) => {
4040
description: "Grant a smart account's admin permission.",
4141
tags: ["Account"],
4242
operationId: "grantAdmin",
43-
headers: backendWalletWithAAHeaderSchema,
43+
headers: walletWithAAHeaderSchema,
4444
params: contractParamSchema,
4545
body: requestBodySchema,
4646
querystring: requestQuerystringSchema,
@@ -57,7 +57,7 @@ export const grantAdmin = async (fastify: FastifyInstance) => {
5757
"x-backend-wallet-address": walletAddress,
5858
"x-idempotency-key": idempotencyKey,
5959
"x-account-address": accountAddress,
60-
} = request.headers as Static<typeof backendWalletWithAAHeaderSchema>;
60+
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6161
const chainId = await getChainIdFromChain(chain);
6262

6363
const contract = await getContract({

src/server/routes/contract/extensions/account/write/grantSession.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
transactionWritesResponseSchema,
1212
} from "../../../../../schemas/sharedApiSchemas";
1313
import { txOverridesWithValueSchema } from "../../../../../schemas/txOverrides";
14-
import { backendWalletWithAAHeaderSchema } from "../../../../../schemas/wallet";
14+
import { walletWithAAHeaderSchema } from "../../../../../schemas/wallet";
1515
import { getChainIdFromChain } from "../../../../../utils/chain";
1616

1717
const requestBodySchema = Type.Object({
@@ -44,7 +44,7 @@ export const grantSession = async (fastify: FastifyInstance) => {
4444
tags: ["Account"],
4545
operationId: "grantSession",
4646
params: contractParamSchema,
47-
headers: backendWalletWithAAHeaderSchema,
47+
headers: walletWithAAHeaderSchema,
4848
body: requestBodySchema,
4949
querystring: requestQuerystringSchema,
5050
response: {
@@ -60,7 +60,7 @@ export const grantSession = async (fastify: FastifyInstance) => {
6060
"x-backend-wallet-address": walletAddress,
6161
"x-idempotency-key": idempotencyKey,
6262
"x-account-address": accountAddress,
63-
} = request.headers as Static<typeof backendWalletWithAAHeaderSchema>;
63+
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6464
const chainId = await getChainIdFromChain(chain);
6565

6666
const contract = await getContract({

src/server/routes/contract/extensions/account/write/revokeAdmin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
transactionWritesResponseSchema,
1111
} from "../../../../../schemas/sharedApiSchemas";
1212
import { txOverridesWithValueSchema } from "../../../../../schemas/txOverrides";
13-
import { backendWalletWithAAHeaderSchema } from "../../../../../schemas/wallet";
13+
import { walletWithAAHeaderSchema } from "../../../../../schemas/wallet";
1414
import { getChainIdFromChain } from "../../../../../utils/chain";
1515

1616
const requestBodySchema = Type.Object({
@@ -40,7 +40,7 @@ export const revokeAdmin = async (fastify: FastifyInstance) => {
4040
description: "Revoke a smart account's admin permission.",
4141
tags: ["Account"],
4242
operationId: "revokeAdmin",
43-
headers: backendWalletWithAAHeaderSchema,
43+
headers: walletWithAAHeaderSchema,
4444
params: contractParamSchema,
4545
body: requestBodySchema,
4646
querystring: requestQuerystringSchema,
@@ -57,7 +57,7 @@ export const revokeAdmin = async (fastify: FastifyInstance) => {
5757
"x-backend-wallet-address": backendWalletAddress,
5858
"x-idempotency-key": idempotencyKey,
5959
"x-account-address": accountAddress,
60-
} = request.headers as Static<typeof backendWalletWithAAHeaderSchema>;
60+
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6161
const chainId = await getChainIdFromChain(chain);
6262

6363
const contract = await getContract({

src/server/routes/contract/extensions/account/write/revokeSession.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
transactionWritesResponseSchema,
1111
} from "../../../../../schemas/sharedApiSchemas";
1212
import { txOverridesWithValueSchema } from "../../../../../schemas/txOverrides";
13-
import { backendWalletWithAAHeaderSchema } from "../../../../../schemas/wallet";
13+
import { walletWithAAHeaderSchema } from "../../../../../schemas/wallet";
1414
import { getChainIdFromChain } from "../../../../../utils/chain";
1515

1616
const requestBodySchema = Type.Object({
@@ -41,7 +41,7 @@ export const revokeSession = async (fastify: FastifyInstance) => {
4141
tags: ["Account"],
4242
operationId: "revokeSession",
4343
params: contractParamSchema,
44-
headers: backendWalletWithAAHeaderSchema,
44+
headers: walletWithAAHeaderSchema,
4545
body: requestBodySchema,
4646
querystring: requestQuerystringSchema,
4747
response: {
@@ -57,7 +57,7 @@ export const revokeSession = async (fastify: FastifyInstance) => {
5757
"x-backend-wallet-address": backendWalletAddress,
5858
"x-account-address": accountAddress,
5959
"x-idempotency-key": idempotencyKey,
60-
} = request.headers as Static<typeof backendWalletWithAAHeaderSchema>;
60+
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6161
const chainId = await getChainIdFromChain(chain);
6262

6363
const contract = await getContract({

src/server/routes/contract/extensions/account/write/updateSession.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
transactionWritesResponseSchema,
1111
} from "../../../../../schemas/sharedApiSchemas";
1212
import { txOverridesWithValueSchema } from "../../../../../schemas/txOverrides";
13-
import { backendWalletWithAAHeaderSchema } from "../../../../../schemas/wallet";
13+
import { walletWithAAHeaderSchema } from "../../../../../schemas/wallet";
1414
import { getChainIdFromChain } from "../../../../../utils/chain";
1515

1616
const requestBodySchema = Type.Object({
@@ -44,7 +44,7 @@ export const updateSession = async (fastify: FastifyInstance) => {
4444
tags: ["Account"],
4545
operationId: "updateSession",
4646
params: contractParamSchema,
47-
headers: backendWalletWithAAHeaderSchema,
47+
headers: walletWithAAHeaderSchema,
4848
body: requestBodySchema,
4949
querystring: requestQuerystringSchema,
5050
response: {
@@ -60,7 +60,7 @@ export const updateSession = async (fastify: FastifyInstance) => {
6060
"x-backend-wallet-address": walletAddress,
6161
"x-account-address": accountAddress,
6262
"x-idempotency-key": idempotencyKey,
63-
} = request.headers as Static<typeof backendWalletWithAAHeaderSchema>;
63+
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6464
const chainId = await getChainIdFromChain(chain);
6565

6666
const contract = await getContract({

src/server/routes/contract/extensions/accountFactory/write/createAccount.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
standardResponseSchema,
1111
} from "../../../../../schemas/sharedApiSchemas";
1212
import { txOverridesWithValueSchema } from "../../../../../schemas/txOverrides";
13-
import { backendWalletWithAAHeaderSchema } from "../../../../../schemas/wallet";
13+
import { walletWithAAHeaderSchema } from "../../../../../schemas/wallet";
1414
import { getChainIdFromChain } from "../../../../../utils/chain";
1515

1616
const requestBodySchema = Type.Object({
@@ -46,7 +46,7 @@ export const createAccount = async (fastify: FastifyInstance) => {
4646
tags: ["Account Factory"],
4747
operationId: "createAccount",
4848
params: contractParamSchema,
49-
headers: backendWalletWithAAHeaderSchema,
49+
headers: walletWithAAHeaderSchema,
5050
body: requestBodySchema,
5151
querystring: requestQuerystringSchema,
5252
response: {
@@ -62,7 +62,7 @@ export const createAccount = async (fastify: FastifyInstance) => {
6262
"x-backend-wallet-address": walletAddress,
6363
"x-account-address": accountAddress,
6464
"x-idempotency-key": idempotencyKey,
65-
} = request.headers as Static<typeof backendWalletWithAAHeaderSchema>;
65+
} = request.headers as Static<typeof walletWithAAHeaderSchema>;
6666
const chainId = await getChainIdFromChain(chain);
6767

6868
const contract = await getContract({

0 commit comments

Comments
 (0)