diff --git a/package.json b/package.json index addf0b8f1..69359687f 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "prisma": "^5.14.0", "prom-client": "^15.1.3", "superjson": "^2.2.1", - "thirdweb": "^5.80.1-nightly-c948e71a16b5e27e10b417cd0ef9cece70179a57-20250104000328", + "thirdweb": "^5.83.0", "uuid": "^9.0.1", "viem": "^2.21.54", "winston": "^3.14.1", diff --git a/sdk/src/services/AccountFactoryService.ts b/sdk/src/services/AccountFactoryService.ts index 76890ee65..6eefd2e3e 100644 --- a/sdk/src/services/AccountFactoryService.ts +++ b/sdk/src/services/AccountFactoryService.ts @@ -167,6 +167,7 @@ export class AccountFactoryService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -215,6 +216,7 @@ export class AccountFactoryService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -237,6 +239,7 @@ export class AccountFactoryService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/sdk/src/services/AccountService.ts b/sdk/src/services/AccountService.ts index f65d53821..c16916400 100644 --- a/sdk/src/services/AccountService.ts +++ b/sdk/src/services/AccountService.ts @@ -88,6 +88,7 @@ export class AccountService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -132,6 +133,7 @@ export class AccountService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -153,6 +155,7 @@ export class AccountService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -179,6 +182,7 @@ export class AccountService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -223,6 +227,7 @@ export class AccountService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -244,6 +249,7 @@ export class AccountService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -270,6 +276,7 @@ export class AccountService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -318,6 +325,7 @@ export class AccountService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -339,6 +347,7 @@ export class AccountService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -365,6 +374,7 @@ export class AccountService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -409,6 +419,7 @@ export class AccountService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -430,6 +441,7 @@ export class AccountService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -456,6 +468,7 @@ export class AccountService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -504,6 +517,7 @@ export class AccountService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -525,6 +539,7 @@ export class AccountService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/sdk/src/services/BackendWalletService.ts b/sdk/src/services/BackendWalletService.ts index fdc0107c8..0001fb3aa 100644 --- a/sdk/src/services/BackendWalletService.ts +++ b/sdk/src/services/BackendWalletService.ts @@ -300,6 +300,7 @@ export class BackendWalletService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @returns any Default Response * @throws ApiError */ @@ -348,6 +349,7 @@ export class BackendWalletService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', ): CancelablePromise<{ result: { /** @@ -365,6 +367,7 @@ export class BackendWalletService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, }, query: { 'simulateTx': simulateTx, @@ -387,6 +390,7 @@ export class BackendWalletService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @returns any Default Response * @throws ApiError */ @@ -423,6 +427,7 @@ export class BackendWalletService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', ): CancelablePromise<{ result: { /** @@ -444,6 +449,7 @@ export class BackendWalletService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, }, query: { 'simulateTx': simulateTx, @@ -466,6 +472,7 @@ export class BackendWalletService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -507,6 +514,7 @@ export class BackendWalletService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -527,6 +535,7 @@ export class BackendWalletService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -550,6 +559,7 @@ export class BackendWalletService { * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param xBackendWalletAddress Backend wallet address * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param requestBody * @returns any Default Response * @throws ApiError @@ -558,6 +568,7 @@ export class BackendWalletService { chain: string, xBackendWalletAddress: string, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', requestBody?: Array<{ /** * A contract or wallet address @@ -606,6 +617,7 @@ export class BackendWalletService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, }, body: requestBody, mediaType: 'application/json', @@ -623,6 +635,7 @@ export class BackendWalletService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @returns any Default Response * @throws ApiError */ @@ -645,6 +658,7 @@ export class BackendWalletService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', ): CancelablePromise<{ result: string; }> { @@ -654,6 +668,7 @@ export class BackendWalletService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, }, body: requestBody, mediaType: 'application/json', @@ -671,6 +686,7 @@ export class BackendWalletService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @returns any Default Response * @throws ApiError */ @@ -682,6 +698,7 @@ export class BackendWalletService { chainId?: number; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', ): CancelablePromise<{ result: string; }> { @@ -691,6 +708,7 @@ export class BackendWalletService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, }, body: requestBody, mediaType: 'application/json', @@ -708,6 +726,7 @@ export class BackendWalletService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @returns any Default Response * @throws ApiError */ @@ -719,6 +738,7 @@ export class BackendWalletService { value: Record; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', ): CancelablePromise<{ result: string; }> { @@ -728,6 +748,7 @@ export class BackendWalletService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, }, body: requestBody, mediaType: 'application/json', @@ -977,6 +998,7 @@ export class BackendWalletService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @returns any Default Response * @throws ApiError */ @@ -991,6 +1013,7 @@ export class BackendWalletService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', ): CancelablePromise<{ result: { cancelledNonces: Array; @@ -1005,6 +1028,7 @@ export class BackendWalletService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, }, query: { 'simulateTx': simulateTx, @@ -1057,6 +1081,7 @@ export class BackendWalletService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1089,6 +1114,7 @@ export class BackendWalletService { data?: string; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1109,6 +1135,7 @@ export class BackendWalletService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/sdk/src/services/ContractRolesService.ts b/sdk/src/services/ContractRolesService.ts index a078e3d9d..1810d20e1 100644 --- a/sdk/src/services/ContractRolesService.ts +++ b/sdk/src/services/ContractRolesService.ts @@ -91,6 +91,7 @@ export class ContractRolesService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -139,6 +140,7 @@ export class ContractRolesService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -160,6 +162,7 @@ export class ContractRolesService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -186,6 +189,7 @@ export class ContractRolesService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -234,6 +238,7 @@ export class ContractRolesService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -255,6 +260,7 @@ export class ContractRolesService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/sdk/src/services/ContractRoyaltiesService.ts b/sdk/src/services/ContractRoyaltiesService.ts index 95a61b756..2d85046ee 100644 --- a/sdk/src/services/ContractRoyaltiesService.ts +++ b/sdk/src/services/ContractRoyaltiesService.ts @@ -97,6 +97,7 @@ export class ContractRoyaltiesService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -145,6 +146,7 @@ export class ContractRoyaltiesService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -166,6 +168,7 @@ export class ContractRoyaltiesService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -192,6 +195,7 @@ export class ContractRoyaltiesService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -244,6 +248,7 @@ export class ContractRoyaltiesService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -265,6 +270,7 @@ export class ContractRoyaltiesService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/sdk/src/services/ContractService.ts b/sdk/src/services/ContractService.ts index 7a3eb1daf..6930052bc 100644 --- a/sdk/src/services/ContractService.ts +++ b/sdk/src/services/ContractService.ts @@ -55,6 +55,7 @@ export class ContractService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -130,6 +131,7 @@ export class ContractService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -151,6 +153,7 @@ export class ContractService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/sdk/src/services/DeployService.ts b/sdk/src/services/DeployService.ts index 9e067a725..c865fc3a0 100644 --- a/sdk/src/services/DeployService.ts +++ b/sdk/src/services/DeployService.ts @@ -16,6 +16,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -80,6 +81,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -101,6 +103,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -122,6 +125,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -187,6 +191,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -208,6 +213,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -229,6 +235,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -289,6 +296,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -310,6 +318,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -331,6 +340,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -392,6 +402,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -413,6 +424,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -434,6 +446,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -498,6 +511,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -519,6 +533,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -540,6 +555,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -605,6 +621,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -626,6 +643,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -647,6 +665,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -710,6 +729,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -731,6 +751,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -752,6 +773,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -817,6 +839,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -838,6 +861,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -859,6 +883,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -924,6 +949,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -945,6 +971,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -966,6 +993,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1028,6 +1056,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1049,6 +1078,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1070,6 +1100,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1133,6 +1164,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1154,6 +1186,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1175,6 +1208,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1241,6 +1275,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1262,6 +1297,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1285,6 +1321,7 @@ export class DeployService { * @param xBackendWalletAddress Backend wallet address * @param requestBody * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1340,6 +1377,7 @@ export class DeployService { }; }, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1362,6 +1400,7 @@ export class DeployService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/sdk/src/services/Erc1155Service.ts b/sdk/src/services/Erc1155Service.ts index b71217414..2c0730372 100644 --- a/sdk/src/services/Erc1155Service.ts +++ b/sdk/src/services/Erc1155Service.ts @@ -276,6 +276,7 @@ export class Erc1155Service { * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -289,6 +290,7 @@ export class Erc1155Service { contractAddress: string, xBackendWalletAddress?: string, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -537,6 +539,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -818,6 +821,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -872,6 +876,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -893,6 +898,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -919,6 +925,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -967,6 +974,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -988,6 +996,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1014,6 +1023,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1056,6 +1066,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1077,6 +1088,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1103,6 +1115,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1159,6 +1172,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1180,6 +1194,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1206,6 +1221,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1280,6 +1296,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1301,6 +1318,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1327,6 +1345,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1379,6 +1398,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1400,6 +1420,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1426,6 +1447,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1507,6 +1529,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1528,6 +1551,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1554,6 +1578,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1635,6 +1660,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1656,6 +1682,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1682,6 +1709,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1730,6 +1758,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1751,6 +1780,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1777,6 +1807,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1833,6 +1864,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1854,6 +1886,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1880,6 +1913,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1940,6 +1974,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1961,6 +1996,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1987,6 +2023,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -2109,6 +2146,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -2130,6 +2168,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -2156,6 +2195,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -2217,6 +2257,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -2238,6 +2279,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -2264,6 +2306,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -2327,6 +2370,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -2348,6 +2392,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -2374,6 +2419,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -2438,6 +2484,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -2459,6 +2506,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -2485,6 +2533,7 @@ export class Erc1155Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -2563,6 +2612,7 @@ export class Erc1155Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -2584,6 +2634,7 @@ export class Erc1155Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/sdk/src/services/Erc20Service.ts b/sdk/src/services/Erc20Service.ts index 1e4008aba..ba1c0005c 100644 --- a/sdk/src/services/Erc20Service.ts +++ b/sdk/src/services/Erc20Service.ts @@ -185,6 +185,7 @@ export class Erc20Service { * @param contractAddress ERC20 contract address * @param xBackendWalletAddress Backend wallet address * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -198,6 +199,7 @@ export class Erc20Service { contractAddress: string, xBackendWalletAddress?: string, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -310,6 +312,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -576,6 +579,7 @@ export class Erc20Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -624,6 +628,7 @@ export class Erc20Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -645,6 +650,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -671,6 +677,7 @@ export class Erc20Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -719,6 +726,7 @@ export class Erc20Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -740,6 +748,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -766,6 +775,7 @@ export class Erc20Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -818,6 +828,7 @@ export class Erc20Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -839,6 +850,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -865,6 +877,7 @@ export class Erc20Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -909,6 +922,7 @@ export class Erc20Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -930,6 +944,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -956,6 +971,7 @@ export class Erc20Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1004,6 +1020,7 @@ export class Erc20Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1025,6 +1042,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1051,6 +1069,7 @@ export class Erc20Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1103,6 +1122,7 @@ export class Erc20Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1124,6 +1144,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1150,6 +1171,7 @@ export class Erc20Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1200,6 +1222,7 @@ export class Erc20Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1221,6 +1244,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1247,6 +1271,7 @@ export class Erc20Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1295,6 +1320,7 @@ export class Erc20Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1316,6 +1342,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1342,6 +1369,7 @@ export class Erc20Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1420,6 +1448,7 @@ export class Erc20Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1441,6 +1470,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1467,6 +1497,7 @@ export class Erc20Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1524,6 +1555,7 @@ export class Erc20Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1545,6 +1577,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1571,6 +1604,7 @@ export class Erc20Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1631,6 +1665,7 @@ export class Erc20Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1652,6 +1687,7 @@ export class Erc20Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/sdk/src/services/Erc721Service.ts b/sdk/src/services/Erc721Service.ts index a63a8e363..e4d8095bb 100644 --- a/sdk/src/services/Erc721Service.ts +++ b/sdk/src/services/Erc721Service.ts @@ -541,6 +541,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -589,6 +590,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -610,6 +612,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -636,6 +639,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -684,6 +688,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -705,6 +710,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -731,6 +737,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -779,6 +786,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -800,6 +808,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -826,6 +835,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -878,6 +888,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -899,6 +910,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -925,6 +937,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1003,6 +1016,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1024,6 +1038,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1050,6 +1065,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1128,6 +1144,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1149,6 +1166,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1175,6 +1193,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1219,6 +1238,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1240,6 +1260,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1266,6 +1287,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1340,6 +1362,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1361,6 +1384,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1387,6 +1411,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1439,6 +1464,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1460,6 +1486,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1484,6 +1511,7 @@ export class Erc721Service { * @param contractAddress ERC721 contract address * @param xBackendWalletAddress Backend wallet address * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1497,6 +1525,7 @@ export class Erc721Service { contractAddress: string, xBackendWalletAddress?: string, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1764,6 +1793,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1788,6 +1818,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1923,6 +1954,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1944,6 +1976,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1970,6 +2003,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -2027,6 +2061,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -2048,6 +2083,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -2074,6 +2110,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -2134,6 +2171,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -2155,6 +2193,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -2357,6 +2396,7 @@ export class Erc721Service { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -2435,6 +2475,7 @@ export class Erc721Service { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -2456,6 +2497,7 @@ export class Erc721Service { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/sdk/src/services/MarketplaceDirectListingsService.ts b/sdk/src/services/MarketplaceDirectListingsService.ts index 467fcf80f..e7d84b53a 100644 --- a/sdk/src/services/MarketplaceDirectListingsService.ts +++ b/sdk/src/services/MarketplaceDirectListingsService.ts @@ -394,6 +394,7 @@ export class MarketplaceDirectListingsService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -466,6 +467,7 @@ export class MarketplaceDirectListingsService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -487,6 +489,7 @@ export class MarketplaceDirectListingsService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -513,6 +516,7 @@ export class MarketplaceDirectListingsService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -589,6 +593,7 @@ export class MarketplaceDirectListingsService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -610,6 +615,7 @@ export class MarketplaceDirectListingsService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -636,6 +642,7 @@ export class MarketplaceDirectListingsService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -688,6 +695,7 @@ export class MarketplaceDirectListingsService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -709,6 +717,7 @@ export class MarketplaceDirectListingsService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -735,6 +744,7 @@ export class MarketplaceDirectListingsService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -783,6 +793,7 @@ export class MarketplaceDirectListingsService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -804,6 +815,7 @@ export class MarketplaceDirectListingsService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -830,6 +842,7 @@ export class MarketplaceDirectListingsService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -878,6 +891,7 @@ export class MarketplaceDirectListingsService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -899,6 +913,7 @@ export class MarketplaceDirectListingsService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -925,6 +940,7 @@ export class MarketplaceDirectListingsService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -973,6 +989,7 @@ export class MarketplaceDirectListingsService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -994,6 +1011,7 @@ export class MarketplaceDirectListingsService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -1020,6 +1038,7 @@ export class MarketplaceDirectListingsService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -1064,6 +1083,7 @@ export class MarketplaceDirectListingsService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -1085,6 +1105,7 @@ export class MarketplaceDirectListingsService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/sdk/src/services/MarketplaceOffersService.ts b/sdk/src/services/MarketplaceOffersService.ts index c264f2325..7a8f1d1e1 100644 --- a/sdk/src/services/MarketplaceOffersService.ts +++ b/sdk/src/services/MarketplaceOffersService.ts @@ -308,6 +308,7 @@ export class MarketplaceOffersService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -372,6 +373,7 @@ export class MarketplaceOffersService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -393,6 +395,7 @@ export class MarketplaceOffersService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -419,6 +422,7 @@ export class MarketplaceOffersService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -463,6 +467,7 @@ export class MarketplaceOffersService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -484,6 +489,7 @@ export class MarketplaceOffersService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, @@ -510,6 +516,7 @@ export class MarketplaceOffersService { * @param requestBody * @param simulateTx Simulates the transaction before adding it to the queue, returning an error if it fails simulation. Note: This step is less performant and recommended only for debugging purposes. * @param xIdempotencyKey Transactions submitted with the same idempotency key will be de-duplicated. Only the last 100000 transactions are compared. + * @param xTransactionMode Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions. * @param xAccountAddress Smart account address * @param xAccountFactoryAddress Smart account factory address. If omitted, Engine will try to resolve it from the contract. * @param xAccountSalt Smart account salt as string or hex. This is used to predict the smart account address. Useful when creating multiple accounts with the same admin and only needed when deploying the account as part of a userop. @@ -554,6 +561,7 @@ export class MarketplaceOffersService { }, simulateTx: boolean = false, xIdempotencyKey?: string, + xTransactionMode?: 'sponsored', xAccountAddress?: string, xAccountFactoryAddress?: string, xAccountSalt?: string, @@ -575,6 +583,7 @@ export class MarketplaceOffersService { headers: { 'x-backend-wallet-address': xBackendWalletAddress, 'x-idempotency-key': xIdempotencyKey, + 'x-transaction-mode': xTransactionMode, 'x-account-address': xAccountAddress, 'x-account-factory-address': xAccountFactoryAddress, 'x-account-salt': xAccountSalt, diff --git a/src/server/routes/backend-wallet/send-transaction-batch.ts b/src/server/routes/backend-wallet/send-transaction-batch.ts index 513f4a4ac..26bd08290 100644 --- a/src/server/routes/backend-wallet/send-transaction-batch.ts +++ b/src/server/routes/backend-wallet/send-transaction-batch.ts @@ -56,8 +56,10 @@ export async function sendTransactionBatch(fastify: FastifyInstance) { }, handler: async (request, reply) => { const { chain } = request.params; - const { "x-backend-wallet-address": fromAddress } = - request.headers as Static; + const { + "x-backend-wallet-address": fromAddress, + "x-transaction-mode": transactionMode, + } = request.headers as Static; const chainId = await getChainIdFromChain(chain); const transactionRequests = request.body; @@ -70,6 +72,7 @@ export async function sendTransactionBatch(fastify: FastifyInstance) { insertedTransaction: { isUserOp: false, chainId, + transactionMode, from: fromAddress as Address, to: toAddress as Address | undefined, data: data as Hex, diff --git a/src/server/routes/backend-wallet/send-transaction.ts b/src/server/routes/backend-wallet/send-transaction.ts index e1dff9a2a..13e2a8f3a 100644 --- a/src/server/routes/backend-wallet/send-transaction.ts +++ b/src/server/routes/backend-wallet/send-transaction.ts @@ -72,6 +72,7 @@ export async function sendTransaction(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-address": accountAddress, "x-account-factory-address": accountFactoryAddress, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -89,6 +90,7 @@ export async function sendTransaction(fastify: FastifyInstance) { accountAddress: accountAddress as Address, signerAddress: fromAddress as Address, target: toAddress as Address | undefined, + transactionMode: undefined, accountFactoryAddress: maybeAddress( accountFactoryAddress, "x-account-factory-address", @@ -106,6 +108,7 @@ export async function sendTransaction(fastify: FastifyInstance) { from: fromAddress as Address, to: toAddress as Address | undefined, data: data as Hex, + transactionMode: transactionMode, value: BigInt(value), ...parseTransactionOverrides(txOverrides), }, diff --git a/src/server/routes/backend-wallet/sign-transaction.ts b/src/server/routes/backend-wallet/sign-transaction.ts index 5e3b3332b..17b312923 100644 --- a/src/server/routes/backend-wallet/sign-transaction.ts +++ b/src/server/routes/backend-wallet/sign-transaction.ts @@ -1,8 +1,6 @@ import { Type, type Static } from "@sinclair/typebox"; import type { FastifyInstance } from "fastify"; import { StatusCodes } from "http-status-codes"; -import type { Hex } from "thirdweb"; -import type { TransactionSerializable } from "viem"; import { getAccount } from "../../../shared/utils/account"; import { getChecksumAddress, @@ -13,6 +11,7 @@ import { toTransactionType } from "../../../shared/utils/sdk"; import { createCustomError } from "../../middleware/error"; import { standardResponseSchema } from "../../schemas/shared-api-schemas"; import { walletHeaderSchema } from "../../schemas/wallet"; +import type { Hex } from "thirdweb"; const requestBodySchema = Type.Object({ transaction: Type.Object({ @@ -86,7 +85,8 @@ export async function signTransaction(fastify: FastifyInstance) { maxFeePerGas: maybeBigInt(transaction.maxFeePerGas), maxPriorityFeePerGas: maybeBigInt(transaction.maxPriorityFeePerGas), ccipReadEnabled: transaction.ccipReadEnabled, - } as TransactionSerializable; + }; + const signature = await account.signTransaction(serializableTransaction); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/backend-wallet/simulate-transaction.ts b/src/server/routes/backend-wallet/simulate-transaction.ts index ece15a242..3c0e76638 100644 --- a/src/server/routes/backend-wallet/simulate-transaction.ts +++ b/src/server/routes/backend-wallet/simulate-transaction.ts @@ -82,6 +82,7 @@ export async function simulateTransaction(fastify: FastifyInstance) { const { "x-backend-wallet-address": walletAddress, "x-account-address": accountAddress, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -99,6 +100,7 @@ export async function simulateTransaction(fastify: FastifyInstance) { functionArgs: args, data: data as Hex | undefined, value: value ? BigInt(value) : 0n, + transactionMode: transactionMode, ...(accountAddress ? { diff --git a/src/server/routes/backend-wallet/transfer.ts b/src/server/routes/backend-wallet/transfer.ts index 48a1daaeb..2c3c7d765 100644 --- a/src/server/routes/backend-wallet/transfer.ts +++ b/src/server/routes/backend-wallet/transfer.ts @@ -88,6 +88,7 @@ export async function transfer(fastify: FastifyInstance) { const { "x-backend-wallet-address": walletAddress, "x-idempotency-key": idempotencyKey, + "x-transaction-mode": transactionMode, } = request.headers as Static; const { simulateTx: shouldSimulate } = request.query; @@ -109,6 +110,7 @@ export async function transfer(fastify: FastifyInstance) { value: toWei(amount), extension: "none", functionName: "transfer", + transactionMode, ...parseTransactionOverrides(txOverrides), }; } else { @@ -143,6 +145,7 @@ export async function transfer(fastify: FastifyInstance) { extension: "erc20", functionName: "transfer", functionArgs: [to, amount, currencyAddress], + transactionMode, ...parseTransactionOverrides(txOverrides), }; } diff --git a/src/server/routes/contract/extensions/account-factory/write/create-account.ts b/src/server/routes/contract/extensions/account-factory/write/create-account.ts index 6ae22e694..a5e82e808 100644 --- a/src/server/routes/contract/extensions/account-factory/write/create-account.ts +++ b/src/server/routes/contract/extensions/account-factory/write/create-account.ts @@ -74,6 +74,7 @@ export const createAccount = async (fastify: FastifyInstance) => { "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, "x-idempotency-key": idempotencyKey, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -116,6 +117,7 @@ export const createAccount = async (fastify: FastifyInstance) => { txOverrides, idempotencyKey, shouldSimulate: simulateTx, + transactionMode, }); // Note: This is a temporary solution to cache the deployed address's factory for 7 days. diff --git a/src/server/routes/contract/extensions/erc1155/write/claim-to.ts b/src/server/routes/contract/extensions/erc1155/write/claim-to.ts index 6b38e9e0b..fce1fd82f 100644 --- a/src/server/routes/contract/extensions/erc1155/write/claim-to.ts +++ b/src/server/routes/contract/extensions/erc1155/write/claim-to.ts @@ -83,6 +83,7 @@ export async function erc1155claimTo(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -113,6 +114,7 @@ export async function erc1155claimTo(fastify: FastifyInstance) { txOverrides, idempotencyKey, shouldSimulate: simulateTx, + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/extensions/erc1155/write/mint-to.ts b/src/server/routes/contract/extensions/erc1155/write/mint-to.ts index 1647d6699..63ca44a70 100644 --- a/src/server/routes/contract/extensions/erc1155/write/mint-to.ts +++ b/src/server/routes/contract/extensions/erc1155/write/mint-to.ts @@ -82,6 +82,7 @@ export async function erc1155mintTo(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(_chain); @@ -129,6 +130,7 @@ export async function erc1155mintTo(fastify: FastifyInstance) { extension: "erc1155", functionName: "mintTo", shouldSimulate: simulateTx, + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/extensions/erc1155/write/transfer-from.ts b/src/server/routes/contract/extensions/erc1155/write/transfer-from.ts index a7930d941..67e046a02 100644 --- a/src/server/routes/contract/extensions/erc1155/write/transfer-from.ts +++ b/src/server/routes/contract/extensions/erc1155/write/transfer-from.ts @@ -87,6 +87,7 @@ export async function erc1155transferFrom(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -117,6 +118,7 @@ export async function erc1155transferFrom(fastify: FastifyInstance) { shouldSimulate: simulateTx, functionName: "safeTransferFrom", extension: "erc1155", + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/extensions/erc1155/write/transfer.ts b/src/server/routes/contract/extensions/erc1155/write/transfer.ts index 4b02fff40..4c1732175 100644 --- a/src/server/routes/contract/extensions/erc1155/write/transfer.ts +++ b/src/server/routes/contract/extensions/erc1155/write/transfer.ts @@ -79,6 +79,7 @@ export async function erc1155transfer(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -109,6 +110,7 @@ export async function erc1155transfer(fastify: FastifyInstance) { shouldSimulate: simulateTx, functionName: "safeTransferFrom", extension: "erc1155", + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/extensions/erc20/write/claim-to.ts b/src/server/routes/contract/extensions/erc20/write/claim-to.ts index 11d5ca69d..45c405f30 100644 --- a/src/server/routes/contract/extensions/erc20/write/claim-to.ts +++ b/src/server/routes/contract/extensions/erc20/write/claim-to.ts @@ -77,6 +77,7 @@ export async function erc20claimTo(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -105,6 +106,7 @@ export async function erc20claimTo(fastify: FastifyInstance) { txOverrides, idempotencyKey, shouldSimulate: simulateTx, + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/extensions/erc20/write/mint-to.ts b/src/server/routes/contract/extensions/erc20/write/mint-to.ts index 3d59cf544..3135dc727 100644 --- a/src/server/routes/contract/extensions/erc20/write/mint-to.ts +++ b/src/server/routes/contract/extensions/erc20/write/mint-to.ts @@ -75,6 +75,7 @@ export async function erc20mintTo(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(_chain); @@ -106,6 +107,7 @@ export async function erc20mintTo(fastify: FastifyInstance) { extension: "erc20", functionName: "mintTo", shouldSimulate: simulateTx, + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/extensions/erc20/write/transfer-from.ts b/src/server/routes/contract/extensions/erc20/write/transfer-from.ts index 5751b264a..a96c54b83 100644 --- a/src/server/routes/contract/extensions/erc20/write/transfer-from.ts +++ b/src/server/routes/contract/extensions/erc20/write/transfer-from.ts @@ -81,6 +81,7 @@ export async function erc20TransferFrom(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -109,6 +110,7 @@ export async function erc20TransferFrom(fastify: FastifyInstance) { shouldSimulate: simulateTx, functionName: "transferFrom", extension: "erc20", + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/extensions/erc20/write/transfer.ts b/src/server/routes/contract/extensions/erc20/write/transfer.ts index 2218f1193..3c7b62ec7 100644 --- a/src/server/routes/contract/extensions/erc20/write/transfer.ts +++ b/src/server/routes/contract/extensions/erc20/write/transfer.ts @@ -74,6 +74,7 @@ export async function erc20Transfer(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -101,6 +102,7 @@ export async function erc20Transfer(fastify: FastifyInstance) { shouldSimulate: simulateTx, functionName: "transfer", extension: "erc20", + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/extensions/erc721/write/claim-to.ts b/src/server/routes/contract/extensions/erc721/write/claim-to.ts index 58e257191..9616b6d44 100644 --- a/src/server/routes/contract/extensions/erc721/write/claim-to.ts +++ b/src/server/routes/contract/extensions/erc721/write/claim-to.ts @@ -78,6 +78,7 @@ export async function erc721claimTo(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -106,6 +107,7 @@ export async function erc721claimTo(fastify: FastifyInstance) { txOverrides, idempotencyKey, shouldSimulate: simulateTx, + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/extensions/erc721/write/mint-to.ts b/src/server/routes/contract/extensions/erc721/write/mint-to.ts index e7516af4a..7e7d0c14f 100644 --- a/src/server/routes/contract/extensions/erc721/write/mint-to.ts +++ b/src/server/routes/contract/extensions/erc721/write/mint-to.ts @@ -78,6 +78,7 @@ export async function erc721mintTo(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(_chain); @@ -123,6 +124,7 @@ export async function erc721mintTo(fastify: FastifyInstance) { extension: "erc721", functionName: "mintTo", shouldSimulate: simulateTx, + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/extensions/erc721/write/signature-mint.ts b/src/server/routes/contract/extensions/erc721/write/signature-mint.ts index 7dcf26dd3..4cd0afddd 100644 --- a/src/server/routes/contract/extensions/erc721/write/signature-mint.ts +++ b/src/server/routes/contract/extensions/erc721/write/signature-mint.ts @@ -87,6 +87,7 @@ export async function erc721SignatureMint(fastify: FastifyInstance) { "x-backend-wallet-address": fromAddress, "x-account-address": accountAddress, "x-idempotency-key": idempotencyKey, + "x-transaction-mode": transactionMode, } = request.headers as Static; const { "x-thirdweb-sdk-version": sdkVersion } = request.headers as Static; @@ -133,6 +134,7 @@ export async function erc721SignatureMint(fastify: FastifyInstance) { accountAddress: accountAddress as Address, signerAddress: fromAddress as Address, target: contractAddress as Address | undefined, + transactionMode: undefined, }, shouldSimulate: simulateTx, idempotencyKey, @@ -142,6 +144,7 @@ export async function erc721SignatureMint(fastify: FastifyInstance) { insertedTransaction: { ...insertedTransaction, isUserOp: false, + transactionMode, }, shouldSimulate: simulateTx, idempotencyKey, diff --git a/src/server/routes/contract/extensions/erc721/write/transfer-from.ts b/src/server/routes/contract/extensions/erc721/write/transfer-from.ts index bf52718be..2bbba5479 100644 --- a/src/server/routes/contract/extensions/erc721/write/transfer-from.ts +++ b/src/server/routes/contract/extensions/erc721/write/transfer-from.ts @@ -79,6 +79,7 @@ export async function erc721transferFrom(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -107,6 +108,7 @@ export async function erc721transferFrom(fastify: FastifyInstance) { shouldSimulate: simulateTx, functionName: "transferFrom", extension: "erc721", + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/extensions/erc721/write/transfer.ts b/src/server/routes/contract/extensions/erc721/write/transfer.ts index 4b450ed33..e2a0127c9 100644 --- a/src/server/routes/contract/extensions/erc721/write/transfer.ts +++ b/src/server/routes/contract/extensions/erc721/write/transfer.ts @@ -72,6 +72,7 @@ export async function erc721transfer(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -100,6 +101,7 @@ export async function erc721transfer(fastify: FastifyInstance) { shouldSimulate: simulateTx, functionName: "transferFrom", extension: "erc721", + transactionMode, }); reply.status(StatusCodes.OK).send({ diff --git a/src/server/routes/contract/write/write.ts b/src/server/routes/contract/write/write.ts index fd5d6e99e..8b9d6abc3 100644 --- a/src/server/routes/contract/write/write.ts +++ b/src/server/routes/contract/write/write.ts @@ -77,6 +77,7 @@ export async function writeToContract(fastify: FastifyInstance) { "x-idempotency-key": idempotencyKey, "x-account-factory-address": accountFactoryAddress, "x-account-salt": accountSalt, + "x-transaction-mode": transactionMode, } = request.headers as Static; const chainId = await getChainIdFromChain(chain); @@ -128,6 +129,7 @@ export async function writeToContract(fastify: FastifyInstance) { accountSalt, txOverrides, idempotencyKey, + transactionMode, shouldSimulate: simulateTx, }); diff --git a/src/server/schemas/wallet/index.ts b/src/server/schemas/wallet/index.ts index 3f4d940f4..ec1aa8e8a 100644 --- a/src/server/schemas/wallet/index.ts +++ b/src/server/schemas/wallet/index.ts @@ -16,6 +16,19 @@ export const walletHeaderSchema = Type.Object({ description: `Transactions submitted with the same idempotency key will be de-duplicated. Only the last ${env.TRANSACTION_HISTORY_COUNT} transactions are compared.`, }), ), + "x-transaction-mode": Type.Optional( + Type.Union( + [ + Type.Literal("sponsored", { + description: "Attempt to use native AA on ZKSync chains", + }), + ], + { + description: + "Transaction mode to use for EOA transactions. Will be ignored if using a smart wallet. If omitted, defaults to regular EOA transactions.", + }, + ), + ), }); export const walletWithAAHeaderSchema = Type.Object({ diff --git a/src/server/utils/wallets/get-aws-kms-account.ts b/src/server/utils/wallets/get-aws-kms-account.ts index eed862cda..69590e8ab 100644 --- a/src/server/utils/wallets/get-aws-kms-account.ts +++ b/src/server/utils/wallets/get-aws-kms-account.ts @@ -1,6 +1,6 @@ import type { KMSClientConfig } from "@aws-sdk/client-kms"; import { KmsSigner } from "aws-kms-signer"; -import type { Hex, ThirdwebClient } from "thirdweb"; +import type { Hex, ThirdwebClient, toSerializableTransaction } from "thirdweb"; import { eth_sendRawTransaction, getRpcClient, @@ -10,12 +10,7 @@ import { import { serializeTransaction } from "thirdweb/transaction"; import { hashMessage } from "thirdweb/utils"; import type { Account } from "thirdweb/wallets"; -import type { - SignableMessage, - TransactionSerializable, - TypedData, - TypedDataDefinition, -} from "viem"; +import type { SignableMessage, TypedData, TypedDataDefinition } from "viem"; import { hashTypedData } from "viem"; import { getChain } from "../../../shared/utils/chain"; @@ -23,7 +18,11 @@ type SendTransactionResult = { transactionHash: Hex; }; -type SendTransactionOption = TransactionSerializable & { +type SerializableTransaction = Awaited< + ReturnType +>; + +type SendTransactionOption = SerializableTransaction & { chainId: number; }; @@ -45,7 +44,7 @@ export async function getAwsKmsAccount( const addressUnprefixed = await signer.getAddress(); const address = `0x${addressUnprefixed}` as Address; - async function signTransaction(tx: TransactionSerializable): Promise { + async function signTransaction(tx: SerializableTransaction): Promise { const serializedTx = serializeTransaction({ transaction: tx }); const txHash = keccak256(serializedTx); const signature = await signer.sign(Buffer.from(txHash.slice(2), "hex")); diff --git a/src/server/utils/wallets/get-gcp-kms-account.ts b/src/server/utils/wallets/get-gcp-kms-account.ts index 83945ac7d..d6dde252b 100644 --- a/src/server/utils/wallets/get-gcp-kms-account.ts +++ b/src/server/utils/wallets/get-gcp-kms-account.ts @@ -1,6 +1,6 @@ import { CloudKmsSigner } from "@cloud-cryptographic-wallet/cloud-kms-signer"; import { Bytes } from "@cloud-cryptographic-wallet/signer"; -import type { Hex, ThirdwebClient } from "thirdweb"; +import type { Hex, ThirdwebClient, toSerializableTransaction } from "thirdweb"; import { eth_sendRawTransaction, getAddress, @@ -10,12 +10,7 @@ import { import { serializeTransaction } from "thirdweb/transaction"; import { hashMessage } from "thirdweb/utils"; import type { Account } from "thirdweb/wallets"; -import type { - SignableMessage, - TransactionSerializable, - TypedData, - TypedDataDefinition, -} from "viem"; +import type { SignableMessage, TypedData, TypedDataDefinition } from "viem"; import { hashTypedData } from "viem"; import { getChain } from "../../../shared/utils/chain"; // Adjust import path as needed @@ -23,7 +18,11 @@ type SendTransactionResult = { transactionHash: Hex; }; -type SendTransactionOption = TransactionSerializable & { +type SerializableTransaction = Awaited< + ReturnType +>; + +type SendTransactionOption = SerializableTransaction & { chainId: number; }; @@ -65,7 +64,7 @@ export async function getGcpKmsAccount( const publicKey = await signer.getPublicKey(); const address = getAddress(publicKey.toAddress().toString()); - async function signTransaction(tx: TransactionSerializable): Promise { + async function signTransaction(tx: SerializableTransaction): Promise { const serializedTx = serializeTransaction({ transaction: tx }); const txHash = keccak256(serializedTx); const signature = await signer.sign(Bytes.fromString(txHash.slice(2))); diff --git a/src/shared/db/transactions/queue-tx.ts b/src/shared/db/transactions/queue-tx.ts index 0bd1d4a8a..ae9e4cccb 100644 --- a/src/shared/db/transactions/queue-tx.ts +++ b/src/shared/db/transactions/queue-tx.ts @@ -72,6 +72,7 @@ export const queueTx = async ({ accountAddress: normalizeAddress(await tx.getSignerAddress()), target: normalizeAddress(tx.getTarget()), accountFactoryAddress, + transactionMode: undefined, }, idempotencyKey, shouldSimulate: simulateTx, @@ -87,6 +88,8 @@ export const queueTx = async ({ insertedTransaction: { ...baseTransaction, isUserOp: false, + // NOTE: v4 endpoints that use queueTx cannot use sponsored mode + transactionMode: undefined, deployedContractAddress, deployedContractType, from: normalizeAddress(await tx.getSignerAddress()), diff --git a/src/shared/utils/transaction/queue-transation.ts b/src/shared/utils/transaction/queue-transation.ts index 611331245..35e391cb3 100644 --- a/src/shared/utils/transaction/queue-transation.ts +++ b/src/shared/utils/transaction/queue-transation.ts @@ -21,6 +21,7 @@ export type QueuedTransactionParams = { accountAddress: Address | undefined; accountFactoryAddress: Address | undefined; accountSalt: string | undefined; + transactionMode: "sponsored" | undefined; txOverrides?: Static< typeof txOverridesWithValueSchema.properties.txOverrides >; @@ -52,6 +53,7 @@ export async function queueTransaction(args: QueuedTransactionParams) { shouldSimulate, functionName, extension, + transactionMode, } = args; let data: Hex; @@ -73,6 +75,7 @@ export async function queueTransaction(args: QueuedTransactionParams) { value: await resolvePromisedValue(transaction.value), functionName, extension, + transactionMode, ...parseTransactionOverrides(txOverrides), ...(accountAddress ? { diff --git a/src/shared/utils/transaction/simulate-queued-transaction.ts b/src/shared/utils/transaction/simulate-queued-transaction.ts index 7fdbd5156..4cdc6c859 100644 --- a/src/shared/utils/transaction/simulate-queued-transaction.ts +++ b/src/shared/utils/transaction/simulate-queued-transaction.ts @@ -4,8 +4,8 @@ import { simulateTransaction, type PreparedTransaction, } from "thirdweb"; -import { stringify } from "thirdweb/utils"; -import type { Account } from "thirdweb/wallets"; +import { isZkSyncChain, stringify } from "thirdweb/utils"; +import { smartWallet, type Account } from "thirdweb/wallets"; import { getAccount } from "../account"; import { getSmartWalletV5 } from "../cache/get-smart-wallet-v5"; import { getChain } from "../chain"; @@ -58,10 +58,26 @@ export const doSimulateTransaction = async ( accountFactoryAddress, }); } else { - account = await getAccount({ + const ownerAccount = await getAccount({ chainId, from, }); + + if (transaction.transactionMode === "sponsored") { + if (!isZkSyncChain(chain)) { + throw new Error( + "Sponsored EOA transactions are only supported on zkSync chains.", + ); + } + + account = await smartWallet({ chain, sponsorGas: true }).connect({ + personalAccount: ownerAccount, + client: thirdwebClient, + }); + } + + // If no account was provided, use the owner account. + account ??= ownerAccount; } try { diff --git a/src/shared/utils/transaction/types.ts b/src/shared/utils/transaction/types.ts index 4509dc18b..b57a5e5a5 100644 --- a/src/shared/utils/transaction/types.ts +++ b/src/shared/utils/transaction/types.ts @@ -34,6 +34,10 @@ export type InsertedTransaction = { }; timeoutSeconds?: number; + // todo: transactionMode should not be specified along with isUserOp: true + // data model needs changes to make incorrect states unrepresentable + transactionMode: "sponsored" | undefined; + // Offchain metadata deployedContractAddress?: Address; deployedContractType?: string; diff --git a/src/worker/tasks/send-transaction-worker.ts b/src/worker/tasks/send-transaction-worker.ts index feee2b500..21ce190b3 100644 --- a/src/worker/tasks/send-transaction-worker.ts +++ b/src/worker/tasks/send-transaction-worker.ts @@ -10,11 +10,12 @@ import { type Hex, } from "thirdweb"; import { getChainMetadata } from "thirdweb/chains"; -import { stringify } from "thirdweb/utils"; +import { isZkSyncChain, stringify } from "thirdweb/utils"; import type { Account } from "thirdweb/wallets"; import { bundleUserOp, createAndSignUserOp, + smartWallet, type UserOperation, } from "thirdweb/wallets/smart"; import { getContractAddress } from "viem"; @@ -280,11 +281,37 @@ const _sendTransaction = async ( const { queueId, chainId, from, to, overrides } = queuedTransaction; const chain = await getChain(chainId); - const account = await getAccount({ + + const ownerAccount = await getAccount({ chainId: chainId, from: from, }); + let account: Account; + + if (queuedTransaction.transactionMode === "sponsored") { + if (!isZkSyncChain(chain)) { + job.log( + "Sponsored EOA transactions are only supported on zkSync chains.", + ); + const erroredTransaction: ErroredTransaction = { + ...queuedTransaction, + status: "errored", + errorMessage: + "Sponsored EOA transactions are only supported on zkSync chains.", + }; + return erroredTransaction; + } + + account = await smartWallet({ chain, sponsorGas: true }).connect({ + personalAccount: ownerAccount, + client: thirdwebClient, + }); + } + + // If no account was provided, use the owner account. + account ??= ownerAccount; + // Populate the transaction to resolve gas values. // This call throws if the execution would be reverted. // The nonce is _not_ set yet. diff --git a/yarn.lock b/yarn.lock index 966cbdaa8..f1dda428b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2748,15 +2748,15 @@ aria-hidden "^1.1.1" react-remove-scroll "2.5.5" -"@radix-ui/react-dialog@1.1.3": - version "1.1.3" - resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-1.1.3.tgz#87cf49f619a6a0f6219980678be0f7c31978dee1" - integrity sha512-ujGvqQNkZ0J7caQyl8XuZRj2/TIrYcOGwqz5TeD1OMcCdfBuEMP0D12ve+8J5F9XuNUth3FAKFWo/wt0E/GJrQ== +"@radix-ui/react-dialog@1.1.4": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-1.1.4.tgz#d68e977acfcc0d044b9dab47b6dd2c179d2b3191" + integrity sha512-Ur7EV1IwQGCyaAuyDRiOLA5JIUZxELJljF+MbM/2NC0BYwfuRrbpS30BiQBJrVruscgUkieKkqXYDOoByaxIoA== dependencies: "@radix-ui/primitive" "1.1.1" "@radix-ui/react-compose-refs" "1.1.1" "@radix-ui/react-context" "1.1.1" - "@radix-ui/react-dismissable-layer" "1.1.2" + "@radix-ui/react-dismissable-layer" "1.1.3" "@radix-ui/react-focus-guards" "1.1.1" "@radix-ui/react-focus-scope" "1.1.1" "@radix-ui/react-id" "1.1.0" @@ -2766,7 +2766,7 @@ "@radix-ui/react-slot" "1.1.1" "@radix-ui/react-use-controllable-state" "1.1.0" aria-hidden "^1.1.1" - react-remove-scroll "2.6.0" + react-remove-scroll "^2.6.1" "@radix-ui/react-dismissable-layer@1.0.5": version "1.0.5" @@ -2791,6 +2791,17 @@ "@radix-ui/react-use-callback-ref" "1.1.0" "@radix-ui/react-use-escape-keydown" "1.1.0" +"@radix-ui/react-dismissable-layer@1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.3.tgz#4ee0f0f82d53bf5bd9db21665799bb0d1bad5ed8" + integrity sha512-onrWn/72lQoEucDmJnr8uczSNTujT0vJnA/X5+3AkChVPowr8n1yvIKIabhWyMQeMvvmdpsvcyDqx3X1LEXCPg== + dependencies: + "@radix-ui/primitive" "1.1.1" + "@radix-ui/react-compose-refs" "1.1.1" + "@radix-ui/react-primitive" "2.0.1" + "@radix-ui/react-use-callback-ref" "1.1.0" + "@radix-ui/react-use-escape-keydown" "1.1.0" + "@radix-ui/react-focus-guards@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-guards/-/react-focus-guards-1.0.1.tgz#1ea7e32092216b946397866199d892f71f7f98ad" @@ -3859,10 +3870,10 @@ resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.29.0.tgz#d0b3d12c07d5a47f42ab0c1ed4f317106f3d4b20" integrity sha512-WgPTRs58hm9CMzEr5jpISe8HXa3qKQ8CxewdYZeVnA54JrPY9B1CZiwsCoLpLkf0dGRZq+LcX5OiJb0bEsOFww== -"@tanstack/query-core@5.62.7": - version "5.62.7" - resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.62.7.tgz#c7f6d0131c08cd2f60e73ec6e7b70e2e9e335def" - integrity sha512-fgpfmwatsrUal6V+8EC2cxZIQVl9xvL7qYa03gsdsCy985UTUlS4N+/3hCzwR0PclYDqisca2AqR1BVgJGpUDA== +"@tanstack/query-core@5.62.16": + version "5.62.16" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-5.62.16.tgz#f7efc92b1562a054748bc00c7f8d9d833407503b" + integrity sha512-9Sgft7Qavcd+sN0V25xVyo0nfmcZXBuODy3FVG7BMWTg1HMLm8wwG5tNlLlmSic1u7l1v786oavn+STiFaPH2g== "@tanstack/react-query@5.29.2": version "5.29.2" @@ -3871,12 +3882,12 @@ dependencies: "@tanstack/query-core" "5.29.0" -"@tanstack/react-query@5.62.7": - version "5.62.7" - resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.62.7.tgz#8f253439a38ad6ce820bc6d42d89ca2556574d1a" - integrity sha512-+xCtP4UAFDTlRTYyEjLx0sRtWyr5GIk7TZjZwBu4YaNahi3Rt2oMyRqfpfVrtwsqY2sayP4iXVCwmC+ZqqFmuw== +"@tanstack/react-query@5.62.16": + version "5.62.16" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-5.62.16.tgz#c267d52650a9e0b61017b04faa43c2e0d2e1de5d" + integrity sha512-XJIZNj65d2IdvU8VBESmrPakfIm6FSdHDzrS1dPrAwmq3ZX+9riMh/ZfbNQHAWnhrgmq7KoXpgZSRyXnqMYT9A== dependencies: - "@tanstack/query-core" "5.62.7" + "@tanstack/query-core" "5.62.16" "@thirdweb-dev/auth@^4.1.87": version "4.1.97" @@ -9513,7 +9524,7 @@ react-is@^16.7.0: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== -react-remove-scroll-bar@^2.3.3, react-remove-scroll-bar@^2.3.6: +react-remove-scroll-bar@^2.3.3: version "2.3.6" resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.6.tgz#3e585e9d163be84a010180b18721e851ac81a29c" integrity sha512-DtSYaao4mBmX+HDo5YWYdBWQwYIQQshUV/dVxFxK+KM26Wjwp1gZ6rv6OC3oujI6Bfu6Xyg3TwK533AQutsn/g== @@ -9521,6 +9532,14 @@ react-remove-scroll-bar@^2.3.3, react-remove-scroll-bar@^2.3.6: react-style-singleton "^2.2.1" tslib "^2.0.0" +react-remove-scroll-bar@^2.3.7: + version "2.3.8" + resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz#99c20f908ee467b385b68a3469b4a3e750012223" + integrity sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q== + dependencies: + react-style-singleton "^2.2.2" + tslib "^2.0.0" + react-remove-scroll@2.5.5: version "2.5.5" resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz#1e31a1260df08887a8a0e46d09271b52b3a37e77" @@ -9532,15 +9551,15 @@ react-remove-scroll@2.5.5: use-callback-ref "^1.3.0" use-sidecar "^1.1.2" -react-remove-scroll@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.6.0.tgz#fb03a0845d7768a4f1519a99fdb84983b793dc07" - integrity sha512-I2U4JVEsQenxDAKaVa3VZ/JeJZe0/2DxPWL8Tj8yLKctQJQiZM52pn/GWFpSp8dftjM3pSAHVJZscAnC/y+ySQ== +react-remove-scroll@^2.6.1: + version "2.6.2" + resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.6.2.tgz#2518d2c5112e71ea8928f1082a58459b5c7a2a97" + integrity sha512-KmONPx5fnlXYJQqC62Q+lwIeAk64ws/cUw6omIumRzMRPqgnYqhSSti99nbj0Ry13bv7dF+BKn7NB+OqkdZGTw== dependencies: - react-remove-scroll-bar "^2.3.6" + react-remove-scroll-bar "^2.3.7" react-style-singleton "^2.2.1" tslib "^2.1.0" - use-callback-ref "^1.3.0" + use-callback-ref "^1.3.3" use-sidecar "^1.1.2" react-style-singleton@^2.2.1: @@ -9552,6 +9571,14 @@ react-style-singleton@^2.2.1: invariant "^2.2.4" tslib "^2.0.0" +react-style-singleton@^2.2.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.2.3.tgz#4265608be69a4d70cfe3047f2c6c88b2c3ace388" + integrity sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ== + dependencies: + get-nonce "^1.0.0" + tslib "^2.0.0" + readable-stream@^2.0.2, readable-stream@^2.3.3, readable-stream@^2.3.6, readable-stream@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b" @@ -10257,10 +10284,10 @@ thirdweb@5.29.6: uqr "0.1.2" viem "2.13.7" -thirdweb@^5.80.1-nightly-c948e71a16b5e27e10b417cd0ef9cece70179a57-20250104000328: - version "5.80.1-nightly-c948e71a16b5e27e10b417cd0ef9cece70179a57-20250104000328" - resolved "https://registry.yarnpkg.com/thirdweb/-/thirdweb-5.80.1-nightly-c948e71a16b5e27e10b417cd0ef9cece70179a57-20250104000328.tgz#a94b685022baaade5fa3299fc4ca4df6d310e5df" - integrity sha512-etQ7sn2uvjL4DglqcBcER6OFHCAwH2YCUjEoqowhls/gT13yjDwE9TDa++fX+vOs1x96YQJUEtzeDzYBdwC0Mg== +thirdweb@^5.83.0: + version "5.83.0" + resolved "https://registry.yarnpkg.com/thirdweb/-/thirdweb-5.83.0.tgz#0fb445daa472fcb9bdde61614979a33d0101f163" + integrity sha512-E0wRMEQvbh9EZvrwfHCDHE+RRhDjJAewk/umhwA55axRf4/LENHM0l3KmlQKEaWRXmla8fu+d6q39OlU1QrSTw== dependencies: "@coinbase/wallet-sdk" "4.2.4" "@emotion/react" "11.14.0" @@ -10269,11 +10296,11 @@ thirdweb@^5.80.1-nightly-c948e71a16b5e27e10b417cd0ef9cece70179a57-20250104000328 "@noble/curves" "1.7.0" "@noble/hashes" "1.6.1" "@passwordless-id/webauthn" "^2.1.2" - "@radix-ui/react-dialog" "1.1.3" + "@radix-ui/react-dialog" "1.1.4" "@radix-ui/react-focus-scope" "1.1.1" "@radix-ui/react-icons" "1.3.2" "@radix-ui/react-tooltip" "1.1.5" - "@tanstack/react-query" "5.62.7" + "@tanstack/react-query" "5.62.16" "@walletconnect/ethereum-provider" "2.17.3" "@walletconnect/sign-client" "2.17.3" abitype "1.0.7" @@ -10602,6 +10629,13 @@ use-callback-ref@^1.3.0: dependencies: tslib "^2.0.0" +use-callback-ref@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.3.3.tgz#98d9fab067075841c5b2c6852090d5d0feabe2bf" + integrity sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg== + dependencies: + tslib "^2.0.0" + use-sidecar@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.1.2.tgz#2f43126ba2d7d7e117aa5855e5d8f0276dfe73c2"