diff --git a/sdk/src/services/AccountFactoryService.ts b/sdk/src/services/AccountFactoryService.ts index 5d8c4588..76890ee6 100644 --- a/sdk/src/services/AccountFactoryService.ts +++ b/sdk/src/services/AccountFactoryService.ts @@ -12,7 +12,7 @@ export class AccountFactoryService { /** * Get all smart accounts * Get all the smart accounts for this account factory. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -45,7 +45,7 @@ export class AccountFactoryService { * Get associated smart accounts * Get all the smart accounts for this account factory associated with the specific admin wallet. * @param signerAddress The address of the signer to get associated accounts from - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -82,7 +82,7 @@ export class AccountFactoryService { * Check if deployed * Check if a smart account has been deployed to the blockchain. * @param adminAddress The address of the admin to check if the account address is deployed - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param extraData Extra data to use in predicting the account address * @returns any Default Response @@ -122,7 +122,7 @@ export class AccountFactoryService { * Predict smart account address * Get the counterfactual address of a smart account. * @param adminAddress The address of the admin to predict the account address for - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param extraData Extra data (account salt) to add to use in predicting the account address * @returns any Default Response @@ -161,14 +161,14 @@ export class AccountFactoryService { /** * Create smart account * Create a smart account for this account factory. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -191,6 +191,10 @@ export class AccountFactoryService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ diff --git a/sdk/src/services/AccountService.ts b/sdk/src/services/AccountService.ts index 31a575a9..f65d5382 100644 --- a/sdk/src/services/AccountService.ts +++ b/sdk/src/services/AccountService.ts @@ -12,7 +12,7 @@ export class AccountService { /** * Get all admins * Get all admins for a smart account. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -44,7 +44,7 @@ export class AccountService { /** * Get all session keys * Get all session keys for a smart account. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -82,14 +82,14 @@ export class AccountService { /** * Grant admin * Grant a smart account's admin permission. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -108,6 +108,10 @@ export class AccountService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -169,14 +173,14 @@ export class AccountService { /** * Revoke admin * Revoke a smart account's admin permission. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -195,6 +199,10 @@ export class AccountService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -256,14 +264,14 @@ export class AccountService { /** * Create session key * Create a session key for a smart account. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -286,6 +294,10 @@ export class AccountService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -347,14 +359,14 @@ export class AccountService { /** * Revoke session key * Revoke a session key for a smart account. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -373,6 +385,10 @@ export class AccountService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -434,14 +450,14 @@ export class AccountService { /** * Update session key * Update a session key for a smart account. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -464,6 +480,10 @@ export class AccountService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ diff --git a/sdk/src/services/BackendWalletService.ts b/sdk/src/services/BackendWalletService.ts index b9657572..fdc0107c 100644 --- a/sdk/src/services/BackendWalletService.ts +++ b/sdk/src/services/BackendWalletService.ts @@ -210,7 +210,7 @@ export class BackendWalletService { /** * Get balance * Get the native balance for a backend wallet. - * @param chain Chain ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param walletAddress Backend wallet address * @returns any Default Response * @throws ApiError @@ -295,10 +295,10 @@ export class BackendWalletService { /** * Transfer tokens * Transfer native currency or ERC20 tokens to another wallet. - * @param chain Chain ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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. * @returns any Default Response * @throws ApiError @@ -324,6 +324,10 @@ export class BackendWalletService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -378,10 +382,10 @@ export class BackendWalletService { /** * Withdraw funds * Withdraw all funds from this wallet to another wallet. - * @param chain Chain ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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. * @returns any Default Response * @throws ApiError @@ -399,6 +403,10 @@ export class BackendWalletService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -453,13 +461,13 @@ export class BackendWalletService { /** * Send a transaction * Send a transaction with transaction parameters - * @param chain Chain ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -479,6 +487,10 @@ export class BackendWalletService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -535,7 +547,7 @@ export class BackendWalletService { /** * Send a batch of raw transactions * Send a batch of raw transactions with transaction parameters - * @param chain Chain ID + * @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 requestBody @@ -558,6 +570,10 @@ export class BackendWalletService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -615,7 +631,6 @@ export class BackendWalletService { requestBody: { transaction: { to?: string; - from?: string; nonce?: string; gasLimit?: string; gasPrice?: string; @@ -626,7 +641,6 @@ export class BackendWalletService { accessList?: any; maxFeePerGas?: string; maxPriorityFeePerGas?: string; - customData?: Record; ccipReadEnabled?: boolean; }; }, @@ -729,7 +743,7 @@ export class BackendWalletService { * Get recent transactions * Get recent transactions for this backend wallet. * @param status The status to query: 'queued', 'mined', 'errored', or 'cancelled'. Default: 'queued' - * @param chain Chain ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param walletAddress Backend wallet address * @param page Specify the page number. * @param limit Specify the number of results to return per page. @@ -825,7 +839,7 @@ export class BackendWalletService { * Get recent transactions by nonce * Get recent transactions for this backend wallet, sorted by descending nonce. * @param fromNonce The earliest nonce, inclusive. - * @param chain Chain ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param walletAddress Backend wallet address * @param toNonce The latest nonce, inclusive. If omitted, queries up to the latest sent nonce. * @returns any Default Response @@ -918,17 +932,85 @@ export class BackendWalletService { /** * Reset nonces * Reset nonces for all backend wallets. This is for debugging purposes and does not impact held tokens. + * @param requestBody * @returns any Default Response * @throws ApiError */ - public resetNonces(): CancelablePromise<{ + public resetNonces( + requestBody?: { + /** + * The chain ID to reset nonces for. + */ + chainId?: number; + /** + * The backend wallet address to reset nonces for. Omit to reset all backend wallets. + */ + walletAddress?: string; + }, + ): CancelablePromise<{ result: { status: string; + /** + * The number of backend wallets processed. + */ + count: number; }; }> { return this.httpRequest.request({ method: 'POST', url: '/backend-wallet/reset-nonces', + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `Bad Request`, + 404: `Not Found`, + 500: `Internal Server Error`, + }, + }); + } + + /** + * Cancel nonces + * Cancel all nonces up to the provided nonce. This is useful to unblock a backend wallet that has transactions waiting for nonces to be mined. + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. + * @param xBackendWalletAddress Backend wallet address + * @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. + * @returns any Default Response + * @throws ApiError + */ + public cancelNonces( + chain: string, + xBackendWalletAddress: string, + requestBody: { + /** + * The nonce to cancel up to, inclusive. Example: If the onchain nonce is 10 and 'toNonce' is 15, this request will cancel nonces: 11, 12, 13, 14, 15 + */ + toNonce: number; + }, + simulateTx: boolean = false, + xIdempotencyKey?: string, + ): CancelablePromise<{ + result: { + cancelledNonces: Array; + }; + }> { + return this.httpRequest.request({ + method: 'POST', + url: '/backend-wallet/{chain}/cancel-nonces', + path: { + 'chain': chain, + }, + headers: { + 'x-backend-wallet-address': xBackendWalletAddress, + 'x-idempotency-key': xIdempotencyKey, + }, + query: { + 'simulateTx': simulateTx, + }, + body: requestBody, + mediaType: 'application/json', errors: { 400: `Bad Request`, 404: `Not Found`, @@ -940,7 +1022,7 @@ export class BackendWalletService { /** * Get nonce * Get the last used nonce for this backend wallet. This value managed by Engine may differ from the onchain value. Use `/backend-wallet/reset-nonces` if this value looks incorrect while idle. - * @param chain Chain ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param walletAddress Backend wallet address * @returns any Default Response * @throws ApiError @@ -971,12 +1053,12 @@ export class BackendWalletService { /** * Simulate a transaction * Simulate a transaction with transaction parameters - * @param chain Chain ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError diff --git a/sdk/src/services/ChainService.ts b/sdk/src/services/ChainService.ts index efa9808f..f2fb6e54 100644 --- a/sdk/src/services/ChainService.ts +++ b/sdk/src/services/ChainService.ts @@ -12,7 +12,7 @@ export class ChainService { /** * Get chain details * Get details about a chain. - * @param chain Chain name or ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @returns any Default Response * @throws ApiError */ diff --git a/sdk/src/services/ConfigurationService.ts b/sdk/src/services/ConfigurationService.ts index dc25260b..57b32942 100644 --- a/sdk/src/services/ConfigurationService.ts +++ b/sdk/src/services/ConfigurationService.ts @@ -287,14 +287,12 @@ export class ConfigurationService { */ public updateTransactionConfiguration( requestBody?: { - minTxsToProcess?: number; maxTxsToProcess?: number; - minedTxListenerCronSchedule?: (string | null); maxTxsToUpdate?: number; + minedTxListenerCronSchedule?: (string | null); retryTxListenerCronSchedule?: (string | null); minEllapsedBlocksBeforeRetry?: number; maxFeePerGasForRetries?: string; - maxPriorityFeePerGasForRetries?: string; maxRetriesPerTx?: number; }, ): CancelablePromise<{ @@ -622,6 +620,9 @@ export class ConfigurationService { public updateContractSubscriptionsConfiguration( requestBody?: { maxBlocksToIndex?: number; + /** + * Requery after one or more delays. Use comma-separated positive integers. Example: "2,10" means requery after 2s and 10s. + */ contractSubscriptionsRequeryDelaySeconds?: string; }, ): CancelablePromise<{ diff --git a/sdk/src/services/ContractEventsService.ts b/sdk/src/services/ContractEventsService.ts index 27693240..a15c9eab 100644 --- a/sdk/src/services/ContractEventsService.ts +++ b/sdk/src/services/ContractEventsService.ts @@ -12,7 +12,7 @@ export class ContractEventsService { /** * Get all events * Get a list of all blockchain events for this contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param fromBlock * @param toBlock @@ -52,7 +52,7 @@ export class ContractEventsService { /** * Get events * Get a list of specific blockchain events emitted from this contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param requestBody Specify the from and to block numbers to get events for, defaults to all blocks * @returns any Default Response diff --git a/sdk/src/services/ContractMetadataService.ts b/sdk/src/services/ContractMetadataService.ts index 4fd15e17..7fb08c2f 100644 --- a/sdk/src/services/ContractMetadataService.ts +++ b/sdk/src/services/ContractMetadataService.ts @@ -12,7 +12,7 @@ export class ContractMetadataService { /** * Get ABI * Get the ABI of a contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -67,7 +67,7 @@ export class ContractMetadataService { /** * Get events * Get details of all events implemented by a contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -121,7 +121,7 @@ export class ContractMetadataService { /** * Get extensions * Get all detected extensions for a contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -153,7 +153,7 @@ export class ContractMetadataService { /** * Get functions * Get details of all functions implemented by the contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError diff --git a/sdk/src/services/ContractRolesService.ts b/sdk/src/services/ContractRolesService.ts index e840a305..a078e3d9 100644 --- a/sdk/src/services/ContractRolesService.ts +++ b/sdk/src/services/ContractRolesService.ts @@ -13,7 +13,7 @@ export class ContractRolesService { * Get wallets for role * Get all wallets with a specific role for a contract. * @param role The role to list wallet members - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -46,7 +46,7 @@ export class ContractRolesService { /** * Get wallets for all roles * Get all wallets in each role for a contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -85,14 +85,14 @@ export class ContractRolesService { /** * Grant role * Grant a role to a specific wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -115,6 +115,10 @@ export class ContractRolesService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -176,14 +180,14 @@ export class ContractRolesService { /** * Revoke role * Revoke a role from a specific wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -206,6 +210,10 @@ export class ContractRolesService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ diff --git a/sdk/src/services/ContractRoyaltiesService.ts b/sdk/src/services/ContractRoyaltiesService.ts index f60c2498..95a61b75 100644 --- a/sdk/src/services/ContractRoyaltiesService.ts +++ b/sdk/src/services/ContractRoyaltiesService.ts @@ -12,7 +12,7 @@ export class ContractRoyaltiesService { /** * Get royalty details * Gets the royalty recipient and BPS (basis points) of the smart contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -51,7 +51,7 @@ export class ContractRoyaltiesService { * Get token royalty details * Gets the royalty recipient and BPS (basis points) of a particular token in the contract. * @param tokenId - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -91,14 +91,14 @@ export class ContractRoyaltiesService { /** * Set royalty details * Set the royalty recipient and fee for the smart contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -121,6 +121,10 @@ export class ContractRoyaltiesService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -182,14 +186,14 @@ export class ContractRoyaltiesService { /** * Set token royalty details * Set the royalty recipient and fee for a particular token in the contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -216,6 +220,10 @@ export class ContractRoyaltiesService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ diff --git a/sdk/src/services/ContractService.ts b/sdk/src/services/ContractService.ts index a7109ef7..7a3eb1da 100644 --- a/sdk/src/services/ContractService.ts +++ b/sdk/src/services/ContractService.ts @@ -13,7 +13,7 @@ export class ContractService { * Read from contract * Call a read function on a contract. * @param functionName Name of the function to call on Contract - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param args Arguments for the function. Comma Separated * @returns any Default Response @@ -49,14 +49,14 @@ export class ContractService { /** * Write to contract * Call a write function on a contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -67,11 +67,11 @@ export class ContractService { xBackendWalletAddress: string, requestBody: { /** - * The function to call on the contract + * The function to call on the contract. It is highly recommended to provide a full function signature, such as "function mintTo(address to, uint256 amount)", to avoid ambiguity and to skip ABI resolution. */ functionName: string; /** - * The arguments to call on the function + * An array of arguments to provide the function. Supports: numbers, strings, arrays, objects. Do not provide: BigNumber, bigint, Date objects */ args: Array; txOverrides?: { @@ -79,6 +79,10 @@ export class ContractService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ diff --git a/sdk/src/services/ContractSubscriptionsService.ts b/sdk/src/services/ContractSubscriptionsService.ts index cfa357f5..2bfbfcca 100644 --- a/sdk/src/services/ContractSubscriptionsService.ts +++ b/sdk/src/services/ContractSubscriptionsService.ts @@ -24,13 +24,13 @@ export class ContractSubscriptionsService { */ contractAddress: string; webhook?: { + id: number; url: string; name: (string | null); secret?: string; eventType: string; active: boolean; createdAt: string; - id: number; }; processEventLogs: boolean; filterEvents: Array; @@ -60,7 +60,7 @@ export class ContractSubscriptionsService { public addContractSubscription( requestBody: { /** - * The chain for the contract. + * A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. */ chain: string; /** @@ -97,13 +97,13 @@ export class ContractSubscriptionsService { */ contractAddress: string; webhook?: { + id: number; url: string; name: (string | null); secret?: string; eventType: string; active: boolean; createdAt: string; - id: number; }; processEventLogs: boolean; filterEvents: Array; @@ -160,7 +160,7 @@ export class ContractSubscriptionsService { /** * Get subscribed contract indexed block range * Gets the subscribed contract's indexed block range - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -170,6 +170,9 @@ export class ContractSubscriptionsService { contractAddress: string, ): CancelablePromise<{ result: { + /** + * A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. + */ chain: string; /** * A contract or wallet address @@ -198,7 +201,7 @@ export class ContractSubscriptionsService { /** * Get last processed block * Get the last processed block for a chain. - * @param chain Chain name or ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @returns any Default Response * @throws ApiError */ diff --git a/sdk/src/services/DefaultService.ts b/sdk/src/services/DefaultService.ts index 1f2aac2a..54389d7a 100644 --- a/sdk/src/services/DefaultService.ts +++ b/sdk/src/services/DefaultService.ts @@ -31,4 +31,15 @@ export class DefaultService { }); } + /** + * @returns any Default Response + * @throws ApiError + */ + public getJson1(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/json/', + }); + } + } diff --git a/sdk/src/services/DeployService.ts b/sdk/src/services/DeployService.ts index 19ac2567..9e067a72 100644 --- a/sdk/src/services/DeployService.ts +++ b/sdk/src/services/DeployService.ts @@ -12,12 +12,12 @@ export class DeployService { /** * Deploy Edition * Deploy an Edition contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -57,6 +57,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -114,12 +118,12 @@ export class DeployService { /** * Deploy Edition Drop * Deploy an Edition Drop contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -160,6 +164,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -217,12 +225,12 @@ export class DeployService { /** * Deploy Marketplace * Deploy a Marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -258,6 +266,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -315,12 +327,12 @@ export class DeployService { /** * Deploy Multiwrap * Deploy a Multiwrap contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -357,6 +369,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -414,12 +430,12 @@ export class DeployService { /** * Deploy NFT Collection * Deploy an NFT Collection contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -459,6 +475,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -516,12 +536,12 @@ export class DeployService { /** * Deploy NFT Drop * Deploy an NFT Drop contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -562,6 +582,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -619,12 +643,12 @@ export class DeployService { /** * Deploy Pack * Deploy a Pack contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -663,6 +687,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -720,12 +748,12 @@ export class DeployService { /** * Deploy Signature Drop * Deploy a Signature Drop contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -766,6 +794,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -823,12 +855,12 @@ export class DeployService { /** * Deploy Split * Deploy a Split contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -869,6 +901,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -926,12 +962,12 @@ export class DeployService { /** * Deploy Token * Deploy a Token contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -969,6 +1005,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1026,12 +1066,12 @@ export class DeployService { /** * Deploy Token Drop * Deploy a Token Drop contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1070,6 +1110,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1127,12 +1171,12 @@ export class DeployService { /** * Deploy Vote * Deploy a Vote contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1174,6 +1218,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1231,14 +1279,14 @@ export class DeployService { /** * Deploy published contract * Deploy a published contract to the blockchain. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param publisher Address or ENS of the publisher of the contract * @param contractName Name of the published contract to deploy * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1269,6 +1317,10 @@ export class DeployService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ diff --git a/sdk/src/services/Erc1155Service.ts b/sdk/src/services/Erc1155Service.ts index b9e83491..b7121741 100644 --- a/sdk/src/services/Erc1155Service.ts +++ b/sdk/src/services/Erc1155Service.ts @@ -13,7 +13,7 @@ export class Erc1155Service { * Get details * Get the details for a token in an ERC-1155 contract. * @param tokenId The tokenId of the NFT to retrieve - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @returns any Default Response * @throws ApiError @@ -52,7 +52,7 @@ export class Erc1155Service { /** * Get all details * Get details for all tokens in an ERC-1155 contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param start The start token ID for paginated results. Defaults to 0. * @param count The page count for paginated results. Defaults to 100. @@ -96,7 +96,7 @@ export class Erc1155Service { * Get owned tokens * Get all tokens in an ERC-1155 contract owned by a specific wallet. * @param walletAddress Address of the wallet to get NFTs for - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @returns any Default Response * @throws ApiError @@ -137,7 +137,7 @@ export class Erc1155Service { * Get the balance of a specific wallet address for this ERC-1155 contract. * @param walletAddress Address of the wallet to check NFT balance * @param tokenId The tokenId of the NFT to check balance of - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @returns any Default Response * @throws ApiError @@ -174,7 +174,7 @@ export class Erc1155Service { * Check if the specific wallet has approved transfers from a specific operator wallet. * @param ownerWallet Address of the wallet who owns the NFT * @param operator Address of the operator to check approval on - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @returns any Default Response * @throws ApiError @@ -209,7 +209,7 @@ export class Erc1155Service { /** * Get total supply * Get the total supply in circulation for this ERC-1155 contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @returns any Default Response * @throws ApiError @@ -239,7 +239,7 @@ export class Erc1155Service { * Get total supply * Get the total supply in circulation for this ERC-1155 contract. * @param tokenId The tokenId of the NFT to retrieve - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @returns any Default Response * @throws ApiError @@ -272,12 +272,12 @@ export class Erc1155Service { /** * Generate signature * Generate a signature granting access for another wallet to mint tokens from this ERC-1155 contract. This method is typically called by the token contract owner. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @param xThirdwebSdkVersion Override the thirdweb sdk version used. Example: "5" for v5 SDK compatibility. * @param requestBody @@ -372,7 +372,13 @@ export class Erc1155Service { royaltyRecipient?: string; royaltyBps?: number; primarySaleRecipient?: string; + /** + * An amount in native token (decimals allowed). Example: "0.1" + */ pricePerToken?: string; + /** + * An amount in wei (no decimals). Example: "50000000000" + */ pricePerTokenWei?: string; currency?: string; validityStartTimestamp: number; @@ -551,7 +557,7 @@ export class Erc1155Service { * Check if tokens are currently available for claiming, optionally specifying if a specific wallet address can claim. * @param quantity The amount of tokens to claim. * @param tokenId The token ID of the NFT you want to claim. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param addressToCheck The wallet address to check if it can claim tokens. This considers all aspects of the active claim phase, including allowlists, previous claims, etc. * @returns any Default Response @@ -590,7 +596,7 @@ export class Erc1155Service { * Get currently active claim phase for a specific token ID. * Retrieve the currently active claim phase for a specific token ID, if any. * @param tokenId The token ID of the NFT you want to claim. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param withAllowList Provide a boolean value to include the allowlist in the response. * @returns any Default Response @@ -654,7 +660,7 @@ export class Erc1155Service { * Get all the claim phases configured for a specific token ID. * Get all the claim phases configured for a specific token ID. * @param tokenId The token ID of the NFT you want to get the claim conditions for. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param withAllowList Provide a boolean value to include the allowlist in the response. * @returns any Default Response @@ -719,7 +725,7 @@ export class Erc1155Service { * Returns allowlist information and merkle proofs for a given wallet address. Returns null if no proof is found for the given wallet address. * @param tokenId The token ID of the NFT you want to get the claimer proofs for. * @param walletAddress The wallet address to get the merkle proofs for. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -768,7 +774,7 @@ export class Erc1155Service { * Get an array of reasons why a specific wallet address is not eligible to claim tokens, if any. * @param tokenId The token ID of the NFT you want to check if the wallet address can claim. * @param quantity The amount of tokens to claim. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param addressToCheck The wallet address to check if it can claim tokens. * @returns any Default Response @@ -806,14 +812,14 @@ export class Erc1155Service { /** * Airdrop tokens * Airdrop ERC-1155 tokens to specific wallets. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -842,6 +848,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -903,14 +913,14 @@ export class Erc1155Service { /** * Burn token * Burn ERC-1155 tokens in the caller wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -933,6 +943,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -994,14 +1008,14 @@ export class Erc1155Service { /** * Burn tokens (batch) * Burn a batch of ERC-1155 tokens in the caller wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1018,6 +1032,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1079,14 +1097,14 @@ export class Erc1155Service { /** * Claim tokens to wallet * Claim ERC-1155 tokens to a specific wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1108,11 +1126,19 @@ export class Erc1155Service { * Quantity of NFTs to mint */ quantity: string; + /** + * Whether the drop is a single phase drop + */ + singlePhaseDrop?: boolean; txOverrides?: { /** * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1174,14 +1200,14 @@ export class Erc1155Service { /** * Lazy mint * Lazy mint ERC-1155 tokens to be claimed in the future. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1230,6 +1256,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1291,14 +1321,14 @@ export class Erc1155Service { /** * Mint additional supply * Mint additional supply of ERC-1155 tokens to a specific wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1325,6 +1355,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1386,14 +1420,14 @@ export class Erc1155Service { /** * Mint tokens (batch) * Mint ERC-1155 tokens to multiple wallets in one transaction. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1449,6 +1483,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1510,14 +1548,14 @@ export class Erc1155Service { /** * Mint tokens * Mint ERC-1155 tokens to a specific wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1573,6 +1611,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1634,14 +1676,14 @@ export class Erc1155Service { /** * Set approval for all * Approve or remove operator as an operator for the caller. Operators can call transferFrom or safeTransferFrom for any token owned by the caller. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1664,6 +1706,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1725,14 +1771,14 @@ export class Erc1155Service { /** * Transfer token * Transfer an ERC-1155 token from the caller wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1763,6 +1809,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1824,14 +1874,14 @@ export class Erc1155Service { /** * Transfer token from wallet * Transfer an ERC-1155 token from the connected wallet to another wallet. Requires allowance. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC1155 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1866,6 +1916,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1927,14 +1981,14 @@ export class Erc1155Service { /** * Signature mint * Mint ERC-1155 tokens from a generated signature. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -2031,6 +2085,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -2092,14 +2150,14 @@ export class Erc1155Service { /** * Overwrite the claim conditions for a specific token ID.. * Overwrite the claim conditions for a specific token ID. All properties of a phase are optional, with the default being a free, open, unlimited claim, in the native currency, starting immediately. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -2135,6 +2193,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -2196,14 +2258,14 @@ export class Erc1155Service { /** * Overwrite the claim conditions for a specific token ID.. * Allows you to set claim conditions for multiple token IDs in a single transaction. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -2241,6 +2303,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -2302,14 +2368,14 @@ export class Erc1155Service { /** * Update a single claim phase. * Update a single claim phase on a specific token ID, by providing the index of the claim phase and the new phase configuration. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -2348,6 +2414,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -2409,14 +2479,14 @@ export class Erc1155Service { /** * Update token metadata * Update the metadata for an ERC1155 token. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -2469,6 +2539,10 @@ export class Erc1155Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ diff --git a/sdk/src/services/Erc20Service.ts b/sdk/src/services/Erc20Service.ts index 7e3fdd9f..1e4008ab 100644 --- a/sdk/src/services/Erc20Service.ts +++ b/sdk/src/services/Erc20Service.ts @@ -14,7 +14,7 @@ export class Erc20Service { * Get the allowance of a specific wallet for an ERC-20 contract. * @param ownerWallet Address of the wallet who owns the funds * @param spenderWallet Address of the wallet to check token allowance - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @returns any Default Response * @throws ApiError @@ -62,7 +62,7 @@ export class Erc20Service { * Get token balance * Get the balance of a specific wallet address for this ERC-20 contract. * @param walletAddress Address of the wallet to check token balance - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @returns any Default Response * @throws ApiError @@ -107,7 +107,7 @@ export class Erc20Service { /** * Get token details * Get details for this ERC-20 contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @returns any Default Response * @throws ApiError @@ -140,7 +140,7 @@ export class Erc20Service { /** * Get total supply * Get the total supply in circulation for this ERC-20 contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @returns any Default Response * @throws ApiError @@ -181,12 +181,12 @@ export class Erc20Service { /** * Generate signature * Generate a signature granting access for another wallet to mint tokens from this ERC-20 contract. This method is typically called by the token contract owner. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @param xThirdwebSdkVersion Override the thirdweb sdk version used. Example: "5" for v5 SDK compatibility. * @param requestBody @@ -329,7 +329,7 @@ export class Erc20Service { * Check if tokens are available for claiming * Check if tokens are currently available for claiming, optionally specifying if a specific wallet address can claim. * @param quantity The amount of tokens to claim. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param addressToCheck The wallet address to check if it can claim tokens. This considers all aspects of the active claim phase, including allowlists, previous claims, etc. * @returns any Default Response @@ -365,7 +365,7 @@ export class Erc20Service { /** * Retrieve the currently active claim phase, if any. * Retrieve the currently active claim phase, if any. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param withAllowList Provide a boolean value to include the allowlist in the response. * @returns any Default Response @@ -426,7 +426,7 @@ export class Erc20Service { /** * Get all the claim phases configured. * Get all the claim phases configured on the drop contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param withAllowList Provide a boolean value to include the allowlist in the response. * @returns any Default Response @@ -488,7 +488,7 @@ export class Erc20Service { * Get claim ineligibility reasons * Get an array of reasons why a specific wallet address is not eligible to claim tokens, if any. * @param quantity The amount of tokens to claim. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param addressToCheck The wallet address to check if it can claim tokens. * @returns any Default Response @@ -525,7 +525,7 @@ export class Erc20Service { * Get claimer proofs * Returns allowlist information and merkle proofs for a given wallet address. Returns null if no proof is found for the given wallet address. * @param walletAddress The wallet address to get the merkle proofs for. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -570,14 +570,14 @@ export class Erc20Service { /** * Set allowance * Grant a specific wallet address to transfer ERC-20 tokens from the caller wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -600,6 +600,10 @@ export class Erc20Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -661,14 +665,14 @@ export class Erc20Service { /** * Transfer tokens * Transfer ERC-20 tokens from the caller wallet to a specific wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -691,6 +695,10 @@ export class Erc20Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -752,14 +760,14 @@ export class Erc20Service { /** * Transfer tokens from wallet * Transfer ERC-20 tokens from the connected wallet to another wallet. Requires allowance. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -786,6 +794,10 @@ export class Erc20Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -847,14 +859,14 @@ export class Erc20Service { /** * Burn token * Burn ERC-20 tokens in the caller wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -873,6 +885,10 @@ export class Erc20Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -934,14 +950,14 @@ export class Erc20Service { /** * Burn token from wallet * Burn ERC-20 tokens in a specific wallet. Requires allowance. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -964,6 +980,10 @@ export class Erc20Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1025,14 +1045,14 @@ export class Erc20Service { /** * Claim tokens to wallet * Claim ERC-20 tokens to a specific wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1050,11 +1070,19 @@ export class Erc20Service { * The amount of tokens to claim. */ amount: string; + /** + * Whether the drop is a single phase drop + */ + singlePhaseDrop?: boolean; txOverrides?: { /** * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1116,14 +1144,14 @@ export class Erc20Service { /** * Mint tokens (batch) * Mint ERC-20 tokens to multiple wallets in one transaction. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1148,6 +1176,10 @@ export class Erc20Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1209,14 +1241,14 @@ export class Erc20Service { /** * Mint tokens * Mint ERC-20 tokens to a specific wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC20 contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1239,6 +1271,10 @@ export class Erc20Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1300,14 +1336,14 @@ export class Erc20Service { /** * Signature mint * Mint ERC-20 tokens from a generated signature. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1360,6 +1396,10 @@ export class Erc20Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1421,14 +1461,14 @@ export class Erc20Service { /** * Overwrite the claim conditions for the drop. * Overwrite the claim conditions for the drop. All properties of a phase are optional, with the default being a free, open, unlimited claim, in the native currency, starting immediately. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1460,6 +1500,10 @@ export class Erc20Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1521,14 +1565,14 @@ export class Erc20Service { /** * Update a single claim phase. * Update a single claim phase, by providing the index of the claim phase and the new phase configuration. The index is the position of the phase in the list of phases you have made, starting from zero. e.g. if you have two phases, the first phase has an index of 0 and the second phase has an index of 1. All properties of a phase are optional, with the default being a free, open, unlimited claim, in the native currency, starting immediately. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1563,6 +1607,10 @@ export class Erc20Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ diff --git a/sdk/src/services/Erc721Service.ts b/sdk/src/services/Erc721Service.ts index 3fcf716d..a63a8e36 100644 --- a/sdk/src/services/Erc721Service.ts +++ b/sdk/src/services/Erc721Service.ts @@ -13,7 +13,7 @@ export class Erc721Service { * Get details * Get the details for a token in an ERC-721 contract. * @param tokenId The tokenId of the NFT to retrieve - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -52,7 +52,7 @@ export class Erc721Service { /** * Get all details * Get details for all tokens in an ERC-721 contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param start The start token id for paginated results. Defaults to 0. * @param count The page count for paginated results. Defaults to 100. @@ -96,7 +96,7 @@ export class Erc721Service { * Get owned tokens * Get all tokens in an ERC-721 contract owned by a specific wallet. * @param walletAddress Address of the wallet to get NFTs for - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -136,7 +136,7 @@ export class Erc721Service { * Get token balance * Get the balance of a specific wallet address for this ERC-721 contract. * @param walletAddress Address of the wallet to check NFT balance - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC721 contract address * @returns any Default Response * @throws ApiError @@ -171,7 +171,7 @@ export class Erc721Service { * Check if the specific wallet has approved transfers from a specific operator wallet. * @param ownerWallet Address of the wallet who owns the NFT * @param operator Address of the operator to check approval on - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -206,7 +206,7 @@ export class Erc721Service { /** * Get total supply * Get the total supply in circulation for this ERC-721 contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -235,7 +235,7 @@ export class Erc721Service { /** * Get claimed supply * Get the claimed supply for this ERC-721 contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -264,7 +264,7 @@ export class Erc721Service { /** * Get unclaimed supply * Get the unclaimed supply for this ERC-721 contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -294,7 +294,7 @@ export class Erc721Service { * Check if tokens are available for claiming * Check if tokens are currently available for claiming, optionally specifying if a specific wallet address can claim. * @param quantity The amount of tokens to claim. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param addressToCheck The wallet address to check if it can claim tokens. This considers all aspects of the active claim phase, including allowlists, previous claims, etc. * @returns any Default Response @@ -330,7 +330,7 @@ export class Erc721Service { /** * Retrieve the currently active claim phase, if any. * Retrieve the currently active claim phase, if any. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param withAllowList Provide a boolean value to include the allowlist in the response. * @returns any Default Response @@ -391,7 +391,7 @@ export class Erc721Service { /** * Get all the claim phases configured for the drop. * Get all the claim phases configured for the drop. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param withAllowList Provide a boolean value to include the allowlist in the response. * @returns any Default Response @@ -453,7 +453,7 @@ export class Erc721Service { * Get claim ineligibility reasons * Get an array of reasons why a specific wallet address is not eligible to claim tokens, if any. * @param quantity The amount of tokens to claim. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param addressToCheck The wallet address to check if it can claim tokens. * @returns any Default Response @@ -490,7 +490,7 @@ export class Erc721Service { * Get claimer proofs * Returns allowlist information and merkle proofs for a given wallet address. Returns null if no proof is found for the given wallet address. * @param walletAddress The wallet address to get the merkle proofs for. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -535,14 +535,14 @@ export class Erc721Service { /** * Set approval for all * Approve or remove operator as an operator for the caller. Operators can call transferFrom or safeTransferFrom for any token owned by the caller. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -565,6 +565,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -626,14 +630,14 @@ export class Erc721Service { /** * Set approval for token * Approve an operator for the NFT owner. Operators can call transferFrom or safeTransferFrom for the specific token. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -656,6 +660,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -717,14 +725,14 @@ export class Erc721Service { /** * Transfer token * Transfer an ERC-721 token from the caller wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -747,6 +755,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -808,14 +820,14 @@ export class Erc721Service { /** * Transfer token from wallet * Transfer an ERC-721 token from the connected wallet to another wallet. Requires allowance. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -842,6 +854,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -903,14 +919,14 @@ export class Erc721Service { /** * Mint tokens * Mint ERC-721 tokens to a specific wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -963,6 +979,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1024,14 +1044,14 @@ export class Erc721Service { /** * Mint tokens (batch) * Mint ERC-721 tokens to multiple wallets in one transaction. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1084,6 +1104,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1145,14 +1169,14 @@ export class Erc721Service { /** * Burn token * Burn ERC-721 tokens in the caller wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1171,6 +1195,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1232,14 +1260,14 @@ export class Erc721Service { /** * Lazy mint * Lazy mint ERC-721 tokens to be claimed in the future. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1288,6 +1316,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1349,14 +1381,14 @@ export class Erc721Service { /** * Claim tokens to wallet * Claim ERC-721 tokens to a specific wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1374,11 +1406,19 @@ export class Erc721Service { * Quantity of NFTs to mint */ quantity: string; + /** + * Whether the drop is a single phase drop + */ + singlePhaseDrop?: boolean; txOverrides?: { /** * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1440,12 +1480,12 @@ export class Erc721Service { /** * Generate signature * Generate a signature granting access for another wallet to mint tokens from this ERC-721 contract. This method is typically called by the token contract owner. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @param xThirdwebSdkVersion Override the thirdweb sdk version used. Example: "5" for v5 SDK compatibility. * @param requestBody @@ -1742,14 +1782,14 @@ export class Erc721Service { /** * Signature mint * Mint ERC-721 tokens from a generated signature. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1859,6 +1899,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -1920,14 +1964,14 @@ export class Erc721Service { /** * Overwrite the claim conditions for the drop. * Overwrite the claim conditions for the drop. All properties of a phase are optional, with the default being a free, open, unlimited claim, in the native currency, starting immediately. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1959,6 +2003,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -2020,14 +2068,14 @@ export class Erc721Service { /** * Update a single claim phase. * Update a single claim phase, by providing the index of the claim phase and the new phase configuration. The index is the position of the phase in the list of phases you have made, starting from zero. e.g. if you have two phases, the first phase has an index of 0 and the second phase has an index of 1. All properties of a phase are optional, with the default being a free, open, unlimited claim, in the native currency, starting immediately. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -2062,6 +2110,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -2123,7 +2175,7 @@ export class Erc721Service { /** * Prepare signature * Prepares a payload for a wallet to generate a signature. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress ERC721 contract address * @param requestBody * @returns any Default Response @@ -2299,14 +2351,14 @@ export class Erc721Service { /** * Update token metadata * Update the metadata for an ERC721 token. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -2359,6 +2411,10 @@ export class Erc721Service { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ diff --git a/sdk/src/services/MarketplaceDirectListingsService.ts b/sdk/src/services/MarketplaceDirectListingsService.ts index 647a0de1..467fcf80 100644 --- a/sdk/src/services/MarketplaceDirectListingsService.ts +++ b/sdk/src/services/MarketplaceDirectListingsService.ts @@ -12,11 +12,11 @@ export class MarketplaceDirectListingsService { /** * Get all listings * Get all direct listings for this marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param count Number of listings to fetch * @param seller Being sold by this Address - * @param start Satrt from this index (pagination) + * @param start Start from this index (pagination) * @param tokenContract Token contract address to show NFTs from * @param tokenId Only show NFTs with this ID * @returns any Default Response @@ -107,11 +107,11 @@ export class MarketplaceDirectListingsService { /** * Get all valid listings * Get all the valid direct listings for this marketplace contract. A valid listing is where the listing is active, and the creator still owns & has approved Marketplace to transfer the listed NFTs. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param count Number of listings to fetch * @param seller Being sold by this Address - * @param start Satrt from this index (pagination) + * @param start Start from this index (pagination) * @param tokenContract Token contract address to show NFTs from * @param tokenId Only show NFTs with this ID * @returns any Default Response @@ -203,7 +203,7 @@ export class MarketplaceDirectListingsService { * Get direct listing * Gets a direct listing on this marketplace contract. * @param listingId The id of the listing to retrieve. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -287,7 +287,7 @@ export class MarketplaceDirectListingsService { * Check if a buyer is approved to purchase a specific direct listing. * @param listingId The id of the listing to retrieve. * @param walletAddress The wallet address of the buyer to check. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -324,7 +324,7 @@ export class MarketplaceDirectListingsService { * Check if a currency is approved for a specific direct listing. * @param listingId The id of the listing to retrieve. * @param currencyContractAddress The smart contract address of the ERC20 token to check. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -359,7 +359,7 @@ export class MarketplaceDirectListingsService { /** * Transfer token from wallet * Get the total number of direct listings on this marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -388,14 +388,14 @@ export class MarketplaceDirectListingsService { /** * Create direct listing * Create a direct listing on this marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -442,6 +442,10 @@ export class MarketplaceDirectListingsService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -503,14 +507,14 @@ export class MarketplaceDirectListingsService { /** * Update direct listing * Update a direct listing on this marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -561,6 +565,10 @@ export class MarketplaceDirectListingsService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -622,14 +630,14 @@ export class MarketplaceDirectListingsService { /** * Buy from direct listing * Buy from a specific direct listing from this marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -656,6 +664,10 @@ export class MarketplaceDirectListingsService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -717,14 +729,14 @@ export class MarketplaceDirectListingsService { /** * Approve buyer for reserved listing * Approve a wallet address to buy from a reserved listing. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -747,6 +759,10 @@ export class MarketplaceDirectListingsService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -808,14 +824,14 @@ export class MarketplaceDirectListingsService { /** * Revoke approval for reserved listings * Revoke approval for a buyer to purchase a reserved listing. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -838,6 +854,10 @@ export class MarketplaceDirectListingsService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -899,14 +919,14 @@ export class MarketplaceDirectListingsService { /** * Revoke currency approval for reserved listing * Revoke approval of a currency for a reserved listing. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -929,6 +949,10 @@ export class MarketplaceDirectListingsService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -990,14 +1014,14 @@ export class MarketplaceDirectListingsService { /** * Cancel direct listing * Cancel a direct listing from this marketplace contract. Only the creator of the listing can cancel it. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -1016,6 +1040,10 @@ export class MarketplaceDirectListingsService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ diff --git a/sdk/src/services/MarketplaceEnglishAuctionsService.ts b/sdk/src/services/MarketplaceEnglishAuctionsService.ts index ff9fc197..631a58b2 100644 --- a/sdk/src/services/MarketplaceEnglishAuctionsService.ts +++ b/sdk/src/services/MarketplaceEnglishAuctionsService.ts @@ -12,11 +12,11 @@ export class MarketplaceEnglishAuctionsService { /** * Get all English auctions * Get all English auction listings on this marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param count Number of listings to fetch * @param seller Being sold by this Address - * @param start Satrt from this index (pagination) + * @param start Start from this index (pagination) * @param tokenContract Token contract address to show NFTs from * @param tokenId Only show NFTs with this ID * @returns any Default Response @@ -115,11 +115,11 @@ export class MarketplaceEnglishAuctionsService { /** * Get all valid English auctions * Get all valid English auction listings on this marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param count Number of listings to fetch * @param seller Being sold by this Address - * @param start Satrt from this index (pagination) + * @param start Start from this index (pagination) * @param tokenContract Token contract address to show NFTs from * @param tokenId Only show NFTs with this ID * @returns any Default Response @@ -219,7 +219,7 @@ export class MarketplaceEnglishAuctionsService { * Get English auction * Get a specific English auction listing on this marketplace contract. * @param listingId The id of the listing to retrieve. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -313,7 +313,7 @@ export class MarketplaceEnglishAuctionsService { * If there is no current bid, the bid must be at least the minimum bid amount. * Returns the value in percentage format, e.g. 100 = 1%. * @param listingId The id of the listing to retrieve. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -352,7 +352,7 @@ export class MarketplaceEnglishAuctionsService { * If there is no current bid, the bid must be at least the minimum bid amount. * If there is a current bid, the bid must be at least the current bid amount + the bid buffer. * @param listingId The id of the listing to retrieve. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -395,7 +395,7 @@ export class MarketplaceEnglishAuctionsService { * Get winning bid * Get the current highest bid of an active auction. * @param listingId The ID of the listing to retrieve the winner for. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -455,7 +455,7 @@ export class MarketplaceEnglishAuctionsService { /** * Get total listings * Get the count of English auction listings on this marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -486,7 +486,7 @@ export class MarketplaceEnglishAuctionsService { * Check if a bid is or will be the winning bid for an auction. * @param listingId The ID of the listing to retrieve the winner for. * @param bidAmount The amount of the bid to check if it is the winning bid. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -522,7 +522,7 @@ export class MarketplaceEnglishAuctionsService { * Get winner * Get the winner of an English auction. Can only be called after the auction has ended. * @param listingId The ID of the listing to retrieve the winner for. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -555,10 +555,10 @@ export class MarketplaceEnglishAuctionsService { /** * Buyout English auction * Buyout the listing for this auction. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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. * @returns any Default Response * @throws ApiError */ @@ -603,10 +603,10 @@ export class MarketplaceEnglishAuctionsService { /** * Cancel English auction * Cancel an existing auction listing. Only the creator of the listing can cancel it. Auctions cannot be canceled once a bid has been made. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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. * @returns any Default Response * @throws ApiError */ @@ -651,10 +651,10 @@ export class MarketplaceEnglishAuctionsService { /** * Create English auction * Create an English auction listing on this marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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. * @returns any Default Response * @throws ApiError */ @@ -738,10 +738,10 @@ export class MarketplaceEnglishAuctionsService { * execute the sale for the buyer, meaning the buyer receives the NFT(s). * You must also call closeAuctionForSeller to execute the sale for the seller, * meaning the seller receives the payment from the highest bid. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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. * @returns any Default Response * @throws ApiError */ @@ -788,10 +788,10 @@ export class MarketplaceEnglishAuctionsService { * After an auction has concluded (and a buyout did not occur), * execute the sale for the seller, meaning the seller receives the payment from the highest bid. * You must also call closeAuctionForBidder to execute the sale for the buyer, meaning the buyer receives the NFT(s). - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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. * @returns any Default Response * @throws ApiError */ @@ -838,10 +838,10 @@ export class MarketplaceEnglishAuctionsService { * Close the auction for both buyer and seller. * This means the NFT(s) will be transferred to the buyer and the seller will receive the funds. * This function can only be called after the auction has ended. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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. * @returns any Default Response * @throws ApiError */ @@ -886,10 +886,10 @@ export class MarketplaceEnglishAuctionsService { /** * Make bid * Place a bid on an English auction listing. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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. * @returns any Default Response * @throws ApiError */ diff --git a/sdk/src/services/MarketplaceOffersService.ts b/sdk/src/services/MarketplaceOffersService.ts index 3d25ebf1..c264f232 100644 --- a/sdk/src/services/MarketplaceOffersService.ts +++ b/sdk/src/services/MarketplaceOffersService.ts @@ -12,11 +12,11 @@ export class MarketplaceOffersService { /** * Get all offers * Get all offers on this marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param count Number of listings to fetch * @param offeror has offers from this Address - * @param start Satrt from this index (pagination) + * @param start Start from this index (pagination) * @param tokenContract Token contract address to show NFTs from * @param tokenId Only show NFTs with this ID * @returns any Default Response @@ -103,11 +103,11 @@ export class MarketplaceOffersService { /** * Get all valid offers * Get all valid offers on this marketplace contract. Valid offers are offers that have not expired, been canceled, or been accepted. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param count Number of listings to fetch * @param offeror has offers from this Address - * @param start Satrt from this index (pagination) + * @param start Start from this index (pagination) * @param tokenContract Token contract address to show NFTs from * @param tokenId Only show NFTs with this ID * @returns any Default Response @@ -195,7 +195,7 @@ export class MarketplaceOffersService { * Get offer * Get details about an offer. * @param offerId The ID of the offer to get information about. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -273,7 +273,7 @@ export class MarketplaceOffersService { /** * Get total count * Get the total number of offers on this marketplace contract. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @returns any Default Response * @throws ApiError @@ -302,14 +302,14 @@ export class MarketplaceOffersService { /** * Make offer * Make an offer on a token. A valid listing is not required. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -348,6 +348,10 @@ export class MarketplaceOffersService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -409,14 +413,14 @@ export class MarketplaceOffersService { /** * Cancel offer * Cancel a valid offer made by the caller wallet. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -435,6 +439,10 @@ export class MarketplaceOffersService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ @@ -496,14 +504,14 @@ export class MarketplaceOffersService { /** * Accept offer * Accept a valid offer. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param contractAddress Contract address * @param xBackendWalletAddress Backend wallet address * @param requestBody - * @param simulateTx Simulate the transaction on-chain without executing + * @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 xAccountAddress Smart account address - * @param xAccountFactoryAddress Smart account factory address. If omitted, engine will try to resolve it from the chain. + * @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. * @returns any Default Response * @throws ApiError @@ -522,6 +530,10 @@ export class MarketplaceOffersService { * Gas limit for the transaction */ gas?: string; + /** + * Gas price for the transaction. Do not use this if maxFeePerGas is set or if you want to use EIP-1559 type transactions. Only use this if you want to use legacy transactions. + */ + gasPrice?: string; /** * Maximum fee per gas */ diff --git a/sdk/src/services/RelayerService.ts b/sdk/src/services/RelayerService.ts index 46965f4a..fd365786 100644 --- a/sdk/src/services/RelayerService.ts +++ b/sdk/src/services/RelayerService.ts @@ -49,6 +49,9 @@ export class RelayerService { public create( requestBody: { name?: string; + /** + * A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. + */ chain: string; /** * The address of the backend wallet to use for relaying transactions. @@ -115,6 +118,9 @@ export class RelayerService { requestBody: { id: string; name?: string; + /** + * A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. + */ chain?: string; /** * A contract or wallet address diff --git a/sdk/src/services/TransactionService.ts b/sdk/src/services/TransactionService.ts index 863cd47c..a10a731d 100644 --- a/sdk/src/services/TransactionService.ts +++ b/sdk/src/services/TransactionService.ts @@ -384,7 +384,7 @@ export class TransactionService { /** * Send a signed transaction * Send a signed transaction - * @param chain Chain ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param requestBody * @returns any Default Response * @throws ApiError @@ -421,7 +421,7 @@ export class TransactionService { /** * Send a signed user operation * Send a signed user operation - * @param chain Chain ID + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param requestBody * @returns any Default Response * @throws ApiError @@ -462,14 +462,14 @@ export class TransactionService { /** * Get transaction receipt * Get the transaction receipt from a transaction hash. + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param transactionHash Transaction hash - * @param chain Chain ID or name * @returns any Default Response * @throws ApiError */ public getTransactionReceipt( - transactionHash: string, chain: string, + transactionHash: string, ): CancelablePromise<{ result: ({ to?: string; @@ -498,8 +498,8 @@ export class TransactionService { method: 'GET', url: '/transaction/{chain}/tx-hash/{transactionHash}', path: { - 'transactionHash': transactionHash, 'chain': chain, + 'transactionHash': transactionHash, }, errors: { 400: `Bad Request`, @@ -512,14 +512,14 @@ export class TransactionService { /** * Get transaction receipt from user-op hash * Get the transaction receipt from a user-op hash. + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param userOpHash User operation hash - * @param chain Chain ID or name * @returns any Default Response * @throws ApiError */ public useropHashReceipt( - userOpHash: string, chain: string, + userOpHash: string, ): CancelablePromise<{ result: any; }> { @@ -527,8 +527,8 @@ export class TransactionService { method: 'GET', url: '/transaction/{chain}/userop-hash/{userOpHash}', path: { - 'userOpHash': userOpHash, 'chain': chain, + 'userOpHash': userOpHash, }, errors: { 400: `Bad Request`, @@ -541,7 +541,7 @@ export class TransactionService { /** * Get transaction logs * Get transaction logs for a mined transaction. A tranasction queue ID or hash must be provided. Set `parseLogs` to parse the event logs. - * @param chain Chain ID or name + * @param chain A chain ID ("137") or slug ("polygon-amoy-testnet"). Chain ID is preferred. * @param queueId The queue ID for a mined transaction. * @param transactionHash The transaction hash for a mined transaction. * @param parseLogs If true, parse the raw logs as events defined in the contract ABI. (Default: true) diff --git a/sdk/src/services/WebhooksService.ts b/sdk/src/services/WebhooksService.ts index 9411e4e4..88604c53 100644 --- a/sdk/src/services/WebhooksService.ts +++ b/sdk/src/services/WebhooksService.ts @@ -17,13 +17,13 @@ export class WebhooksService { */ public getAll(): CancelablePromise<{ result: Array<{ + id: number; url: string; name: (string | null); secret?: string; eventType: string; active: boolean; createdAt: string; - id: number; }>; }> { return this.httpRequest.request({ @@ -39,7 +39,7 @@ export class WebhooksService { /** * Create a webhook - * Create a webhook to call when certain blockchain events occur. + * Create a webhook to call when a specific Engine event occurs. * @param requestBody * @returns any Default Response * @throws ApiError @@ -47,7 +47,7 @@ export class WebhooksService { public create( requestBody: { /** - * Webhook URL + * Webhook URL. Non-HTTPS URLs are not supported. */ url: string; name?: string; @@ -55,13 +55,13 @@ export class WebhooksService { }, ): CancelablePromise<{ result: { + id: number; url: string; name: (string | null); secret?: string; eventType: string; active: boolean; createdAt: string; - id: number; }; }> { return this.httpRequest.request({ @@ -126,4 +126,34 @@ export class WebhooksService { }); } + /** + * Test webhook + * Send a test payload to a webhook. + * @param webhookId + * @returns any Default Response + * @throws ApiError + */ + public testWebhook( + webhookId: string, + ): CancelablePromise<{ + result: { + ok: boolean; + status: number; + body: string; + }; + }> { + return this.httpRequest.request({ + method: 'POST', + url: '/webhooks/{webhookId}/test', + path: { + 'webhookId': webhookId, + }, + errors: { + 400: `Bad Request`, + 404: `Not Found`, + 500: `Internal Server Error`, + }, + }); + } + } diff --git a/src/index.ts b/src/index.ts index 764540ee..665f2395 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,6 @@ import { logger } from "./utils/logger"; import "./utils/tracer"; import { initWorker } from "./worker"; import { CancelRecycledNoncesQueue } from "./worker/queues/cancelRecycledNoncesQueue"; -import { MigratePostgresTransactionsQueue } from "./worker/queues/migratePostgresTransactionsQueue"; import { MineTransactionQueue } from "./worker/queues/mineTransactionQueue"; import { NonceResyncQueue } from "./worker/queues/nonceResyncQueue"; import { ProcessEventsLogQueue } from "./worker/queues/processEventLogsQueue"; @@ -15,14 +14,14 @@ import { SendTransactionQueue } from "./worker/queues/sendTransactionQueue"; import { SendWebhookQueue } from "./worker/queues/sendWebhookQueue"; const main = async () => { - if (env.ENGINE_MODE === "server_only") { - initServer(); - } else if (env.ENGINE_MODE === "worker_only") { - initWorker(); - } else { - initServer(); - initWorker(); - } + if (env.ENGINE_MODE === "server_only") { + initServer(); + } else if (env.ENGINE_MODE === "worker_only") { + initWorker(); + } else { + initServer(); + initWorker(); + } }; main(); @@ -33,44 +32,43 @@ main(); // entire codebase process.on("uncaughtException", (err) => { - logger({ - message: "Uncaught Exception", - service: "server", - level: "error", - error: err, - }); + logger({ + message: "Uncaught Exception", + service: "server", + level: "error", + error: err, + }); }); process.on("unhandledRejection", (err) => { - logger({ - message: "Unhandled Rejection", - service: "server", - level: "error", - error: err, - }); + logger({ + message: "Unhandled Rejection", + service: "server", + level: "error", + error: err, + }); }); process.on("SIGINT", () => gracefulShutdown("SIGINT")); process.on("SIGTERM", () => gracefulShutdown("SIGTERM")); const gracefulShutdown = async (signal: NodeJS.Signals) => { - logger({ - level: "info", - service: "server", - message: `Received ${signal}, closing server...`, - }); + logger({ + level: "info", + service: "server", + message: `Received ${signal}, closing server...`, + }); - // Gracefully close workers to minimize stalled jobs. - // Source: https://docs.bullmq.io/guide/going-to-production#gracefully-shut-down-workers - await SendWebhookQueue.q.close(); - await ProcessEventsLogQueue.q.close(); - await ProcessTransactionReceiptsQueue.q.close(); - await SendTransactionQueue.q.close(); - await MineTransactionQueue.q.close(); - await CancelRecycledNoncesQueue.q.close(); - await PruneTransactionsQueue.q.close(); - await MigratePostgresTransactionsQueue.q.close(); - await NonceResyncQueue.q.close(); + // Gracefully close workers to minimize stalled jobs. + // Source: https://docs.bullmq.io/guide/going-to-production#gracefully-shut-down-workers + await SendWebhookQueue.q.close(); + await ProcessEventsLogQueue.q.close(); + await ProcessTransactionReceiptsQueue.q.close(); + await SendTransactionQueue.q.close(); + await MineTransactionQueue.q.close(); + await CancelRecycledNoncesQueue.q.close(); + await PruneTransactionsQueue.q.close(); + await NonceResyncQueue.q.close(); - process.exit(0); + process.exit(0); }; diff --git a/src/server/middleware/adminRoutes.ts b/src/server/middleware/adminRoutes.ts index 1dac982d..789b471d 100644 --- a/src/server/middleware/adminRoutes.ts +++ b/src/server/middleware/adminRoutes.ts @@ -7,7 +7,6 @@ import { StatusCodes } from "http-status-codes"; import { timingSafeEqual } from "node:crypto"; import { env } from "../../utils/env"; import { CancelRecycledNoncesQueue } from "../../worker/queues/cancelRecycledNoncesQueue"; -import { MigratePostgresTransactionsQueue } from "../../worker/queues/migratePostgresTransactionsQueue"; import { MineTransactionQueue } from "../../worker/queues/mineTransactionQueue"; import { NonceHealthCheckQueue } from "../../worker/queues/nonceHealthCheckQueue"; import { NonceResyncQueue } from "../../worker/queues/nonceResyncQueue"; @@ -23,72 +22,71 @@ const ADMIN_ROUTES_PASSWORD = env.THIRDWEB_API_SECRET_KEY; // Add queues to monitor here. const QUEUES: Queue[] = [ - SendWebhookQueue.q, - ProcessEventsLogQueue.q, - ProcessTransactionReceiptsQueue.q, - SendTransactionQueue.q, - MineTransactionQueue.q, - CancelRecycledNoncesQueue.q, - PruneTransactionsQueue.q, - MigratePostgresTransactionsQueue.q, - NonceResyncQueue.q, - NonceHealthCheckQueue.q, + SendWebhookQueue.q, + ProcessEventsLogQueue.q, + ProcessTransactionReceiptsQueue.q, + SendTransactionQueue.q, + MineTransactionQueue.q, + CancelRecycledNoncesQueue.q, + PruneTransactionsQueue.q, + NonceResyncQueue.q, + NonceHealthCheckQueue.q, ]; export const withAdminRoutes = async (fastify: FastifyInstance) => { - fastify.after(async () => { - // Create a new route for Bullboard routes. - const serverAdapter = new FastifyAdapter(); - serverAdapter.setBasePath(ADMIN_QUEUES_BASEPATH); + fastify.after(async () => { + // Create a new route for Bullboard routes. + const serverAdapter = new FastifyAdapter(); + serverAdapter.setBasePath(ADMIN_QUEUES_BASEPATH); - createBullBoard({ - queues: QUEUES.map((q) => new BullMQAdapter(q)), - serverAdapter, - }); + createBullBoard({ + queues: QUEUES.map((q) => new BullMQAdapter(q)), + serverAdapter, + }); - await fastify.register(serverAdapter.registerPlugin(), { - basePath: ADMIN_QUEUES_BASEPATH, - prefix: ADMIN_QUEUES_BASEPATH, - }); + await fastify.register(serverAdapter.registerPlugin(), { + basePath: ADMIN_QUEUES_BASEPATH, + prefix: ADMIN_QUEUES_BASEPATH, + }); - fastify.addHook("onRequest", async (req, reply) => { - if (req.url.startsWith(ADMIN_QUEUES_BASEPATH)) { - const authHeader = req.headers.authorization; + fastify.addHook("onRequest", async (req, reply) => { + if (req.url.startsWith(ADMIN_QUEUES_BASEPATH)) { + const authHeader = req.headers.authorization; - if (!authHeader || !authHeader.startsWith("Basic ")) { - reply - .status(StatusCodes.UNAUTHORIZED) - .header("WWW-Authenticate", 'Basic realm="Admin Routes"') - .send({ error: "Unauthorized" }); - return; - } + if (!authHeader || !authHeader.startsWith("Basic ")) { + reply + .status(StatusCodes.UNAUTHORIZED) + .header("WWW-Authenticate", 'Basic realm="Admin Routes"') + .send({ error: "Unauthorized" }); + return; + } - // Parse the basic auth credentials (`Basic `). - const base64Credentials = authHeader.split(" ")[1]; - const credentials = Buffer.from(base64Credentials, "base64").toString( - "utf8", - ); - const [username, password] = credentials.split(":"); + // Parse the basic auth credentials (`Basic `). + const base64Credentials = authHeader.split(" ")[1]; + const credentials = Buffer.from(base64Credentials, "base64").toString( + "utf8", + ); + const [username, password] = credentials.split(":"); - if (!assertAdminBasicAuth(username, password)) { - reply - .status(StatusCodes.UNAUTHORIZED) - .header("WWW-Authenticate", 'Basic realm="Admin Routes"') - .send({ error: "Unauthorized" }); - return; - } - } - }); - }); + if (!assertAdminBasicAuth(username, password)) { + reply + .status(StatusCodes.UNAUTHORIZED) + .header("WWW-Authenticate", 'Basic realm="Admin Routes"') + .send({ error: "Unauthorized" }); + return; + } + } + }); + }); }; const assertAdminBasicAuth = (username: string, password: string) => { - if (username === ADMIN_ROUTES_USERNAME) { - try { - const buf1 = Buffer.from(password.padEnd(100)); - const buf2 = Buffer.from(ADMIN_ROUTES_PASSWORD.padEnd(100)); - return timingSafeEqual(buf1, buf2); - } catch {} - } - return false; + if (username === ADMIN_ROUTES_USERNAME) { + try { + const buf1 = Buffer.from(password.padEnd(100)); + const buf2 = Buffer.from(ADMIN_ROUTES_PASSWORD.padEnd(100)); + return timingSafeEqual(buf1, buf2); + } catch {} + } + return false; }; diff --git a/src/worker/index.ts b/src/worker/index.ts index 638e0fc1..cd9867a2 100644 --- a/src/worker/index.ts +++ b/src/worker/index.ts @@ -8,7 +8,6 @@ import { updatedWebhooksListener, } from "./listeners/webhookListener"; import { initCancelRecycledNoncesWorker } from "./tasks/cancelRecycledNoncesWorker"; -import { initMigratePostgresTransactionsWorker } from "./tasks/migratePostgresTransactionsWorker"; import { initMineTransactionWorker } from "./tasks/mineTransactionWorker"; import { initNonceHealthCheckWorker } from "./tasks/nonceHealthCheckWorker"; import { initNonceResyncWorker } from "./tasks/nonceResyncWorker"; @@ -29,8 +28,6 @@ export const initWorker = async () => { initNonceHealthCheckWorker(); - await initMigratePostgresTransactionsWorker(); - await initNonceResyncWorker(); // Listen for new & updated configuration data. diff --git a/src/worker/queues/migratePostgresTransactionsQueue.ts b/src/worker/queues/migratePostgresTransactionsQueue.ts deleted file mode 100644 index 5e310008..00000000 --- a/src/worker/queues/migratePostgresTransactionsQueue.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Queue } from "bullmq"; -import { redis } from "../../utils/redis/redis"; -import { defaultJobOptions } from "./queues"; - -export class MigratePostgresTransactionsQueue { - static q = new Queue("migrate-postgres-transactions", { - connection: redis, - defaultJobOptions, - }); - - constructor() { - MigratePostgresTransactionsQueue.q.setGlobalConcurrency(1); - - // The cron job is defined in `initMigratePostgresTransactionsWorker` - // because it requires an async call to query configuration. - } -} diff --git a/src/worker/tasks/migratePostgresTransactionsWorker.ts b/src/worker/tasks/migratePostgresTransactionsWorker.ts deleted file mode 100644 index 7547d9b7..00000000 --- a/src/worker/tasks/migratePostgresTransactionsWorker.ts +++ /dev/null @@ -1,227 +0,0 @@ -import type { Transactions } from "@prisma/client"; -import { Worker, type Job, type Processor } from "bullmq"; -import assert from "node:assert"; -import type { Hex } from "thirdweb"; -import { getPrismaWithPostgresTx, prisma } from "../../db/client"; -import { TransactionDB } from "../../db/transactions/db"; -import type { PrismaTransaction } from "../../schema/prisma"; -import { getConfig } from "../../utils/cache/getConfig"; -import { logger } from "../../utils/logger"; -import { maybeBigInt, normalizeAddress } from "../../utils/primitiveTypes"; -import { redis } from "../../utils/redis/redis"; -import type { - QueuedTransaction, - SentTransaction, -} from "../../utils/transaction/types"; -import { MigratePostgresTransactionsQueue } from "../queues/migratePostgresTransactionsQueue"; -import { MineTransactionQueue } from "../queues/mineTransactionQueue"; -import { logWorkerExceptions } from "../queues/queues"; -import { SendTransactionQueue } from "../queues/sendTransactionQueue"; - -// Must be explicitly called for the worker to run on this host. -export const initMigratePostgresTransactionsWorker = async () => { - const config = await getConfig(); - if (config.minedTxListenerCronSchedule) { - MigratePostgresTransactionsQueue.q.add("cron", "", { - repeat: { pattern: config.minedTxListenerCronSchedule }, - jobId: "migrate-postgres-transactions-cron", - }); - } - - const _worker = new Worker(MigratePostgresTransactionsQueue.q.name, handler, { - connection: redis, - concurrency: 1, - }); - logWorkerExceptions(_worker); -}; - -const handler: Processor = async (job: Job) => { - // Migrate sent transactions from PostgresDB -> Redis queue. - await prisma.$transaction(async (pgtx) => { - const sentTransactionRows = await getSentPostgresTransactions(pgtx); - const toCancel: string[] = []; - - for (const row of sentTransactionRows) { - // Update DB, enqueue a "MineTransaction" job, and cancel the transaction in DB. - try { - const sentTransaction = toSentTransaction(row); - await TransactionDB.set(sentTransaction); - await MineTransactionQueue.add({ queueId: sentTransaction.queueId }); - toCancel.push(row.id); - job.log(`Migrated sent transaction ${row.id}.`); - } catch (e) { - const errorMessage = `Error migrating sent transaction: ${e}`; - job.log(errorMessage); - logger({ - service: "worker", - level: "error", - queueId: row.id, - message: errorMessage, - }); - } - } - - await cancelPostgresTransactions({ pgtx, queueIds: toCancel }); - job.log(`Done migrating ${toCancel.length} sent transactions.`); - }); - - // Migrate queued transactions from PostgresDB -> Redis queue. - await prisma.$transaction(async (pgtx) => { - const queuedTransactionRows = await getQueuedPostgresTransactions(pgtx); - const toCancel: string[] = []; - - for (const row of queuedTransactionRows) { - // Update DB, enqueue a "MineTransaction" job, and cancel the transaction in DB. - try { - const queuedTransaction = toQueuedTransaction(row); - await TransactionDB.set(queuedTransaction); - await SendTransactionQueue.add({ - queueId: queuedTransaction.queueId, - resendCount: 0, - }); - toCancel.push(row.id); - job.log(`Migrated queued transaction ${row.id}.`); - } catch (e) { - const errorMessage = `Error migrating sent transaction: ${e}`; - job.log(errorMessage); - logger({ - service: "worker", - level: "error", - queueId: row.id, - message: errorMessage, - }); - } - } - - await cancelPostgresTransactions({ pgtx, queueIds: toCancel }); - job.log(`Done migrating ${toCancel.length} queued transactions.`); - }); -}; - -const cancelPostgresTransactions = async ({ - pgtx, - queueIds, -}: { - pgtx: PrismaTransaction; - queueIds: string[]; -}) => { - if (queueIds.length === 0) { - return; - } - - const cancelledAt = new Date(); - const prisma = getPrismaWithPostgresTx(pgtx); - await prisma.transactions.updateMany({ - where: { id: { in: queueIds } }, - data: { cancelledAt }, - }); -}; - -const getSentPostgresTransactions = async ( - pgtx: PrismaTransaction, -): Promise => { - const config = await getConfig(); - const prisma = getPrismaWithPostgresTx(pgtx); - - return await prisma.$queryRaw` - SELECT * FROM "transactions" - WHERE - "sentAt" IS NOT NULL - AND "minedAt" IS NULL - AND "cancelledAt" IS NULL - AND "errorMessage" IS NULL - ORDER BY "nonce" ASC - LIMIT ${config.maxTxsToUpdate} - FOR UPDATE SKIP LOCKED`; -}; - -const getQueuedPostgresTransactions = async ( - pgtx: PrismaTransaction, -): Promise => { - const config = await getConfig(); - const prisma = getPrismaWithPostgresTx(pgtx); - - return await prisma.$queryRaw` - SELECT * FROM "transactions" - WHERE - "sentAt" IS NULL - AND "minedAt" IS NULL - AND "cancelledAt" IS NULL - AND "errorMessage" IS NULL - ORDER BY "queuedAt" ASC - LIMIT ${config.maxTxsToProcess} - FOR UPDATE SKIP LOCKED`; -}; - -const toSentTransaction = (row: Transactions): SentTransaction => { - assert(row.sentAt); - assert(row.sentAtBlockNumber); - const queuedTransaction = toQueuedTransaction(row); - - if (queuedTransaction.isUserOp) { - assert(row.userOpHash); - return { - ...queuedTransaction, - status: "sent", - isUserOp: true, - sentAt: row.sentAt, - sentAtBlock: BigInt(row.sentAtBlockNumber), - nonce: "", // unused - userOpHash: row.userOpHash as Hex, - gas: maybeBigInt(row.gasLimit ?? undefined) ?? 0n, - }; - } - - assert(row.transactionHash); - assert(row.nonce); - return { - ...queuedTransaction, - ...queuedTransaction.overrides, - status: "sent", - isUserOp: false, - sentAt: row.sentAt, - sentAtBlock: BigInt(row.sentAtBlockNumber), - nonce: row.nonce, - sentTransactionHashes: [row.transactionHash as Hex], - gas: maybeBigInt(row.gasLimit ?? undefined) ?? 0n, - }; -}; - -const toQueuedTransaction = (row: Transactions): QueuedTransaction => { - assert(row.fromAddress); - assert(row.data); - - return { - status: "queued", - queueId: row.idempotencyKey, - queuedAt: row.queuedAt, - resendCount: 0, - - isUserOp: !!row.accountAddress, - chainId: parseInt(row.chainId), - from: normalizeAddress(row.fromAddress), - to: normalizeAddress(row.toAddress), - value: row.value ? BigInt(row.value) : 0n, - - data: row.data as Hex, - functionName: row.functionName ?? undefined, - functionArgs: row.functionArgs?.split(","), - - overrides: { - gas: maybeBigInt(row.gasLimit ?? undefined), - maxFeePerGas: maybeBigInt(row.maxFeePerGas ?? undefined), - maxPriorityFeePerGas: maybeBigInt(row.maxPriorityFeePerGas ?? undefined), - }, - - // Offchain metadata - deployedContractAddress: normalizeAddress(row.deployedContractAddress), - deployedContractType: row.deployedContractType ?? undefined, - extension: row.extension ?? undefined, - - // User Operation - signerAddress: normalizeAddress(row.signerAddress), - accountAddress: normalizeAddress(row.accountAddress), - target: normalizeAddress(row.target), - sender: normalizeAddress(row.sender), - }; -};